Preserve reasoning_content with minimal-format diffs
This commit is contained in:
parent
41eaf48516
commit
0a02d462f0
2 changed files with 3 additions and 0 deletions
|
|
@ -301,6 +301,7 @@ func parseResponse(body []byte) (*LLMResponse, error) {
|
|||
type openaiMessage struct {
|
||||
Role string `json:"role"`
|
||||
Content string `json:"content"`
|
||||
Reasoning string `json:"reasoning_content,omitempty"`
|
||||
ToolCalls []ToolCall `json:"tool_calls,omitempty"`
|
||||
ToolCallID string `json:"tool_call_id,omitempty"`
|
||||
}
|
||||
|
|
@ -314,6 +315,7 @@ func stripSystemParts(messages []Message) []openaiMessage {
|
|||
out[i] = openaiMessage{
|
||||
Role: m.Role,
|
||||
Content: m.Content,
|
||||
Reasoning: m.ReasoningContent,
|
||||
ToolCalls: m.ToolCalls,
|
||||
ToolCallID: m.ToolCallID,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -106,6 +106,7 @@ func RunToolLoop(
|
|||
Role: "assistant",
|
||||
Content: response.Content,
|
||||
}
|
||||
assistantMsg.ReasoningContent = response.ReasoningContent
|
||||
for _, tc := range normalizedToolCalls {
|
||||
argumentsJSON, _ := json.Marshal(tc.Arguments)
|
||||
assistantMsg.ToolCalls = append(assistantMsg.ToolCalls, providers.ToolCall{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue