Add Tool Call ID (#12956)

* routes/types: add tool call id

---------

Co-authored-by: ParthSareen <parth.sareen@ollama.com>
This commit is contained in:
Grace
2025-11-04 16:43:33 -08:00
committed by GitHub
parent ba8c035846
commit 809b9c68fa
5 changed files with 122 additions and 16 deletions

View File

@@ -181,10 +181,11 @@ type Message struct {
Content string `json:"content"`
// Thinking contains the text that was inside thinking tags in the
// original model output when ChatRequest.Think is enabled.
Thinking string `json:"thinking,omitempty"`
Images []ImageData `json:"images,omitempty"`
ToolCalls []ToolCall `json:"tool_calls,omitempty"`
ToolName string `json:"tool_name,omitempty"`
Thinking string `json:"thinking,omitempty"`
Images []ImageData `json:"images,omitempty"`
ToolCalls []ToolCall `json:"tool_calls,omitempty"`
ToolName string `json:"tool_name,omitempty"`
ToolCallID string `json:"tool_call_id,omitempty"`
}
func (m *Message) UnmarshalJSON(b []byte) error {
@@ -200,6 +201,7 @@ func (m *Message) UnmarshalJSON(b []byte) error {
}
type ToolCall struct {
ID string `json:"id,omitempty"`
Function ToolCallFunction `json:"function"`
}