qwen3-coder: fix tool definition type rendering

This commit is contained in:
Devon Rifkin
2025-09-30 15:03:15 -07:00
parent 0469861d9d
commit 83021fcf0f
2 changed files with 54 additions and 3 deletions

View File

@@ -336,3 +336,35 @@ func TestFormatToolCallArgument(t *testing.T) {
})
}
}
func TestQwen3ToolDefinitionTypes(t *testing.T) {
tests := []struct {
name string
propertyType api.PropertyType
expected string
}{
{
name: "simple",
propertyType: api.PropertyType{"string"},
expected: "string",
},
{
name: "multiple",
propertyType: api.PropertyType{"string", "number"},
expected: "[\"string\",\"number\"]",
},
{
name: "empty",
propertyType: api.PropertyType{},
expected: "[]",
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
got := formatToolDefinitionType(tt.propertyType)
if got != tt.expected {
t.Errorf("formatToolDefinitionType() = %v, want %v", got, tt.expected)
}
})
}
}