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

This commit is contained in:
Grace
2025-12-17 18:42:21 -08:00
committed by GitHub
parent 49a9c9ba6a
commit 0fadeffaee
2 changed files with 3 additions and 3 deletions

View File

@@ -341,7 +341,7 @@ type ToolFunctionParameters struct {
Defs any `json:"$defs,omitempty"` Defs any `json:"$defs,omitempty"`
Items any `json:"items,omitempty"` Items any `json:"items,omitempty"`
Required []string `json:"required,omitempty"` Required []string `json:"required,omitempty"`
Properties map[string]ToolProperty `json:"properties"` Properties map[string]ToolProperty `json:"properties,omitempty"`
} }
func (t *ToolFunctionParameters) String() string { func (t *ToolFunctionParameters) String() string {
@@ -352,7 +352,7 @@ func (t *ToolFunctionParameters) String() string {
type ToolFunction struct { type ToolFunction struct {
Name string `json:"name"` Name string `json:"name"`
Description string `json:"description,omitempty"` Description string `json:"description,omitempty"`
Parameters ToolFunctionParameters `json:"parameters"` Parameters ToolFunctionParameters `json:"parameters,omitempty"`
} }
func (t *ToolFunction) String() string { func (t *ToolFunction) String() string {

View File

@@ -363,7 +363,7 @@ func TestChatDebugRenderOnly(t *testing.T) {
DebugRenderOnly: true, DebugRenderOnly: true,
}, },
expectDebug: 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",
}, },
} }