GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix[plugins](soc-ai): changed toolcall usage policy and temperature · utmstack/UTMStack@e933c87

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • plugins/soc-ai/internal
    • agent
      • anthropic.go
      • llm.go
      • loop.go
      • openai.go
      • prompt.go
    • api
      • server.go
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎plugins/soc-ai/internal/agent/anthropic.go‎

Copy file name to clipboardExpand all lines: plugins/soc-ai/internal/agent/anthropic.go
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ func (c *anthropicClient) Complete(ctx context.Context, req CompletionRequest) (
6161
if req.System != "" {
6262
payload["system"] = req.System
6363
}
64+
if req.Temperature > 0 {
65+
payload["temperature"] = req.Temperature
66+
}
6467
if len(tools) > 0 {
6568
payload["tools"] = tools
6669
}
Collapse file

‎plugins/soc-ai/internal/agent/llm.go‎

Copy file name to clipboardExpand all lines: plugins/soc-ai/internal/agent/llm.go
+6-5Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,12 @@ type Message struct {
4444
}
4545

4646
type CompletionRequest struct {
47-
System string
48-
Messages []Message
49-
Tools []ToolSpec
50-
Model string
51-
MaxTokens int
47+
System string
48+
Messages []Message
49+
Tools []ToolSpec
50+
Model string
51+
MaxTokens int
52+
Temperature float64 // 0 = provider default; ops path sets it low to curb exploratory tool use
5253
}
5354

5455
type CompletionResponse struct {
Collapse file

‎plugins/soc-ai/internal/agent/loop.go‎

Copy file name to clipboardExpand all lines: plugins/soc-ai/internal/agent/loop.go
+13-10Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ type RunTask struct {
8585
EnabledGroups []string
8686
AlwaysAllow []string
8787
MaxIters int
88+
Temperature float64 // 0 = provider default
8889
}
8990

9091
type RunResult struct {
@@ -190,11 +191,12 @@ func (a *Agent) Run(ctx context.Context, task RunTask, sink EventSink) (RunResul
190191
}
191192

192193
resp, err := a.llm.Complete(ctx, CompletionRequest{
193-
System: task.System,
194-
Messages: msgs,
195-
Tools: stepTools,
196-
Model: a.model,
197-
MaxTokens: a.maxTokens,
194+
System: task.System,
195+
Messages: msgs,
196+
Tools: stepTools,
197+
Model: a.model,
198+
MaxTokens: a.maxTokens,
199+
Temperature: task.Temperature,
198200
})
199201
if err != nil {
200202
_ = catcher.Error("llm completion failed", err, map[string]any{
@@ -291,11 +293,12 @@ func (a *Agent) Run(ctx context.Context, task RunTask, sink EventSink) (RunResul
291293
func (a *Agent) finalizeGracefully(ctx context.Context, task RunTask, msgs []Message, result RunResult, sink EventSink, prompt, fallbackMsg string) (RunResult, error) {
292294
msgs = append(msgs, Message{Role: RoleUser, Content: prompt})
293295
finalResp, ferr := a.llm.Complete(ctx, CompletionRequest{
294-
System: task.System,
295-
Messages: msgs,
296-
Model: a.model,
297-
MaxTokens: a.maxTokens,
298-
})
296+
System: task.System,
297+
Messages: msgs,
298+
Model: a.model,
299+
MaxTokens: a.maxTokens,
300+
Temperature: task.Temperature,
301+
})
299302
if ferr != nil {
300303
_ = catcher.Error("finalization llm call failed", ferr, map[string]any{
301304
"process": "plugin_com.utmstack.soc-ai",
Collapse file

‎plugins/soc-ai/internal/agent/openai.go‎

Copy file name to clipboardExpand all lines: plugins/soc-ai/internal/agent/openai.go
+7-1Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ type oaRequest struct {
5555
Messages []oaMessage `json:"messages"`
5656
Tools []oaTool `json:"tools,omitempty"`
5757
MaxTokens int `json:"max_tokens,omitempty"`
58+
Temperature *float64 `json:"temperature,omitempty"`
5859
}
5960

6061
type oaResponse struct {
@@ -112,7 +113,12 @@ func (c *openaiClient) Complete(ctx context.Context, req CompletionRequest) (Com
112113
tools = append(tools, oaTool{Type: "function", Function: oaToolDef{Name: t.Name, Description: t.Description, Parameters: params}})
113114
}
114115

115-
body, err := json.Marshal(oaRequest{Model: req.Model, Messages: msgs, Tools: tools, MaxTokens: req.MaxTokens})
116+
oreq := oaRequest{Model: req.Model, Messages: msgs, Tools: tools, MaxTokens: req.MaxTokens}
117+
if req.Temperature > 0 {
118+
t := req.Temperature
119+
oreq.Temperature = &t
120+
}
121+
body, err := json.Marshal(oreq)
116122
if err != nil {
117123
return CompletionResponse{}, fmt.Errorf("marshal request: %w", err)
118124
}
Collapse file

‎plugins/soc-ai/internal/agent/prompt.go‎

Copy file name to clipboardExpand all lines: plugins/soc-ai/internal/agent/prompt.go
+4-3Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,10 @@ Use this to choose the most relevant tools and to craft navigation. For example,
9696
` + permissionsBlock(enabledGroups) + `
9797
9898
## How to work
99-
- Carry the task end to end.
100-
- Use tools ONLY when you need data or actions you don't already have. Many messages need few or no tools — do not over-call; prefer the smallest set of tools that answers the question.
101-
- Prefer read-only tools to investigate before any mutating or response action. Mutating/response actions (changing status, creating incidents, running SOAR jobs, etc.) take effect immediately — only perform them when the task clearly asks for them.
99+
- Answer directly first. If you can answer from your own knowledge or from what the user already said, do not call any tool. Tools are for data you lack, not for confirmation or extra context.
100+
- When tools are needed, carry the task end to end and act autonomously — do not ask the user anything.
101+
- Use read-only tools to investigate before any mutating or response action. Mutating/response actions (changing status, creating incidents, running SOAR jobs, etc.) take effect immediately — only perform them when the task clearly asks for them.
102+
- Prefer the smallest set of tools that answers the question; do not over-call.
102103
- Never invent data; rely on tool results. If a tool fails, adapt or report it plainly.
103104
- Batch independent tool calls into the SAME turn instead of one per turn. If a task involves N similar items (several widgets, several filter fields, several lookups), each tool call for one item never depends on another item's result — issue all of them together, not one-then-wait-then-next. Only go one at a time when a call genuinely needs the previous call's output (e.g. you need a dashboard's id before adding a widget to it). A task that takes 15 round trips done one item at a time usually takes 3-4 done this way.
104105
Collapse file

‎plugins/soc-ai/internal/api/server.go‎

Copy file name to clipboardExpand all lines: plugins/soc-ai/internal/api/server.go
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ func handleAgentTask(w http.ResponseWriter, r *http.Request) {
227227
History: toHistory(req.History),
228228
EnabledGroups: capabilities,
229229
MaxIters: maxIters,
230+
Temperature: 0.3,
230231
}, sink)
231232
}
232233

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.