From c84be8f1356fa1ba4c0823919d45179df63a3cbb Mon Sep 17 00:00:00 2001 From: For-ACGN <38399410+For-ACGN@users.noreply.github.com> Date: Tue, 11 Mar 2025 17:16:45 +0800 Subject: [PATCH 1/2] add struct field ToolCalls to ChatCompletionMessage for support tool call. --- chat.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/chat.go b/chat.go index fbd52aa..df02355 100644 --- a/chat.go +++ b/chat.go @@ -24,11 +24,12 @@ var ( // ChatCompletionMessage represents a single message in a chat completion conversation. type ChatCompletionMessage struct { - Role string `json:"role"` // The role of the message sender, e.g., "user", "assistant", "system". - Content string `json:"content"` // The content of the message. - Prefix bool `json:"prefix,omitempty"` // The prefix of the message (optional) for Chat Prefix Completion [Beta Feature]. - ReasoningContent string `json:"reasoning_content,omitempty"` // The reasoning content of the message (optional) when using the reasoner model with Chat Prefix Completion. When using this feature, the Prefix parameter must be set to true. - ToolCallID string `json:"tool_call_id,omitempty"` // Tool call that this message is responding to. + Role string `json:"role"` // The role of the message sender, e.g., "user", "assistant", "system". + Content string `json:"content"` // The content of the message. + Prefix bool `json:"prefix,omitempty"` // The prefix of the message (optional) for Chat Prefix Completion [Beta Feature]. + ReasoningContent string `json:"reasoning_content,omitempty"` // The reasoning content of the message (optional) when using the reasoner model with Chat Prefix Completion. When using this feature, the Prefix parameter must be set to true. + ToolCallID string `json:"tool_call_id,omitempty"` // Tool call that this message is responding to. + ToolCalls []ToolCall `json:"tool_calls,omitempty"` // Optional tool calls. } // FunctionParameters defines the parameters for a function. From 380506b7fb8e1a2ca77eb6e6db651bd16afed519 Mon Sep 17 00:00:00 2001 From: For-ACGN <38399410+For-ACGN@users.noreply.github.com> Date: Tue, 11 Mar 2025 17:18:39 +0800 Subject: [PATCH 2/2] replace go 1.23.3 to go 1.23 for prevent forced toolchains version settings. --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 888df0a..5331fea 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/cohesion-org/deepseek-go -go 1.23.3 +go 1.23 require ( github.com/joho/godotenv v1.5.1