fix(ollama): preserve reasoning and tool-call context (#6605)

This commit is contained in:
Seefs
2026-08-10 12:49:26 +08:00
committed by GitHub
parent 85feb7a345
commit 8ad159a3bb
4 changed files with 118 additions and 56 deletions
+5 -1
View File
@@ -58,8 +58,12 @@ func ollamaToolCallsToOpenAI(toolCalls []OllamaToolCall, startIndex int, include
argBytes = []byte("{}")
}
}
toolCallID := tc.ID
if toolCallID == "" {
toolCallID = fmt.Sprintf("call_%d", startIndex)
}
tr := dto.ToolCallResponse{
ID: fmt.Sprintf("call_%d", startIndex),
ID: toolCallID,
Type: "function",
Function: dto.FunctionResponse{
Name: tc.Function.Name,