mirror of
https://github.com/likelovewant/ollama-for-amd.git
synced 2025-12-21 22:33:56 +00:00
qwen3-coder: support anyOf when parsing tool calls
This commit is contained in:
@@ -977,6 +977,21 @@ func TestQwenToolCallValueParsing(t *testing.T) {
|
||||
raw: "123",
|
||||
want: 123, // Integer has higher precedence than string
|
||||
},
|
||||
{
|
||||
desc: "anyOf array or string - with array of objects",
|
||||
paramType: api.PropertyType{"array", "string"},
|
||||
raw: `[{"content": "task 1", "status": "pending", "priority": "high", "id": "1"}, {"content": "task 2", "status": "completed", "priority": "low", "id": "2"}]`,
|
||||
want: []any{
|
||||
map[string]any{"content": "task 1", "status": "pending", "priority": "high", "id": "1"},
|
||||
map[string]any{"content": "task 2", "status": "completed", "priority": "low", "id": "2"},
|
||||
},
|
||||
},
|
||||
{
|
||||
desc: "anyOf array or string - with plain string",
|
||||
paramType: api.PropertyType{"array", "string"},
|
||||
raw: "Error: could not load data",
|
||||
want: "Error: could not load data",
|
||||
},
|
||||
}
|
||||
|
||||
for _, tc := range cases {
|
||||
|
||||
Reference in New Issue
Block a user