Merge PR #1346
This commit is contained in:
commit
e456715dd8
2 changed files with 11 additions and 2 deletions
|
|
@ -1168,9 +1168,10 @@ func (al *AgentLoop) runLLMIteration(
|
|||
return "", iteration, fmt.Errorf("LLM call failed after retries: %w", err)
|
||||
}
|
||||
|
||||
effectiveReasoning := response.EffectiveReasoning()
|
||||
go al.handleReasoning(
|
||||
ctx,
|
||||
response.Reasoning,
|
||||
effectiveReasoning,
|
||||
opts.Channel,
|
||||
al.targetReasoningChannelID(opts.Channel),
|
||||
)
|
||||
|
|
@ -1181,7 +1182,7 @@ func (al *AgentLoop) runLLMIteration(
|
|||
"iteration": iteration,
|
||||
"content_chars": len(response.Content),
|
||||
"tool_calls": len(response.ToolCalls),
|
||||
"reasoning": response.Reasoning,
|
||||
"reasoning": effectiveReasoning,
|
||||
"target_channel": al.targetReasoningChannelID(opts.Channel),
|
||||
"channel": opts.Channel,
|
||||
})
|
||||
|
|
|
|||
|
|
@ -34,6 +34,14 @@ type LLMResponse struct {
|
|||
ReasoningDetails []ReasoningDetail `json:"reasoning_details"`
|
||||
}
|
||||
|
||||
// EffectiveReasoning returns Reasoning if non-empty, otherwise ReasoningContent.
|
||||
func (r *LLMResponse) EffectiveReasoning() string {
|
||||
if r.Reasoning != "" {
|
||||
return r.Reasoning
|
||||
}
|
||||
return r.ReasoningContent
|
||||
}
|
||||
|
||||
type ReasoningDetail struct {
|
||||
Format string `json:"format"`
|
||||
Index int `json:"index"`
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue