Get up and running with Kimi, GLM, MiniMax, DeepSeek, gpt-oss, Qwen, Gemma and other models.
remove unneeded tool calls
Michael Yang5a83f79afdf1
diff --git a/api/types.go b/api/types.goindex e670d1149..b18ee2287 100644--- a/api/types.go+++ b/api/types.go@@ -115,8 +115,6 @@ type Message struct {}type ToolCall struct {- ID string `json:"id"`- Type string `json:"type"`Function struct {Name string `json:"name"`Arguments map[string]any `json:"arguments"`diff --git a/server/model.go b/server/model.goindex 9e22d63a5..de65d6b61 100644--- a/server/model.go+++ b/server/model.go@@ -16,7 +16,6 @@ import ("strings""text/template/parse"- "github.com/google/uuid""github.com/ollama/ollama/api""github.com/ollama/ollama/convert""github.com/ollama/ollama/llm"@@ -363,11 +362,7 @@ func (m *Model) parseToolCalls(s string) ([]api.ToolCall, bool) {var toolCalls []api.ToolCallfor _, kv := range objs {- call := api.ToolCall{- ID: uuid.New().String(),- Type: "function",- }-+ var call api.ToolCallfor k, v := range kv {switch k {case name:diff --git a/server/model_test.go b/server/model_test.goindex d39f28911..2e9dad3dd 100644--- a/server/model_test.go+++ b/server/model_test.go@@ -181,7 +181,6 @@ The temperature in San Francisco, CA is 70°F and in Toronto, Canada is 20°C.`,calls := []api.ToolCall{{- Type: "function",Function: function{Name: "get_current_weather",Arguments: map[string]any{@@ -191,7 +190,6 @@ The temperature in San Francisco, CA is 70°F and in Toronto, Canada is 20°C.`,},},{- Type: "function",Function: function{Name: "get_current_weather",Arguments: map[string]any{@@ -228,11 +226,6 @@ The temperature in San Francisco, CA is 70°F and in Toronto, Canada is 20°C.`,}if tt.ok {- for i := range actual {- // ID is randomly generated so clear it for comparison- actual[i].ID = ""- }-if diff := cmp.Diff(actual, calls); diff != "" {t.Errorf("mismatch (-got +want):\n%s", diff)}