Skip to content

Get up and running with Kimi, GLM, MiniMax, DeepSeek, gpt-oss, Qwen, Gemma and other models.

Omit args and params in tool function def and calls (#13516)

Grace0fadeffaee76
diff --git a/api/types.go b/api/types.go
index 3ccf3ce29..d24178d16 100644
--- a/api/types.go
+++ b/api/types.go
@@ -341,7 +341,7 @@ type ToolFunctionParameters struct {
Defs any `json:"$defs,omitempty"`
Items any `json:"items,omitempty"`
Required []string `json:"required,omitempty"`
- Properties map[string]ToolProperty `json:"properties"`
+ Properties map[string]ToolProperty `json:"properties,omitempty"`
}
func (t *ToolFunctionParameters) String() string {
@@ -352,7 +352,7 @@ func (t *ToolFunctionParameters) String() string {
type ToolFunction struct {
Name string `json:"name"`
Description string `json:"description,omitempty"`
- Parameters ToolFunctionParameters `json:"parameters"`
+ Parameters ToolFunctionParameters `json:"parameters,omitempty"`
}
func (t *ToolFunction) String() string {
diff --git a/server/routes_debug_test.go b/server/routes_debug_test.go
index 6f9104c39..012125b5a 100644
--- a/server/routes_debug_test.go
+++ b/server/routes_debug_test.go
@@ -363,7 +363,7 @@ func TestChatDebugRenderOnly(t *testing.T) {
DebugRenderOnly: true,
},
expectDebug: true,
- expectTemplate: "[{\"type\":\"function\",\"function\":{\"name\":\"get_weather\",\"description\":\"Get weather information\",\"parameters\":{\"type\":\"\",\"properties\":null}}}]user: Get the weather\n",
+ expectTemplate: "[{\"type\":\"function\",\"function\":{\"name\":\"get_weather\",\"description\":\"Get weather information\",\"parameters\":{\"type\":\"\"}}}]user: Get the weather\n",
},
}