mirror of
https://github.com/YspCoder/clawgo.git
synced 2026-05-20 03:18:57 +08:00
fix(provider): support dsml tool call markup
This commit is contained in:
@@ -312,3 +312,16 @@ func TestHTTPProviderChatConfiguredCompatBackfillsReasoningContentForToolHistory
|
||||
t.Fatalf("reasoning_content = %#v, want thinking content", got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestParseCompatFunctionCallsSupportsDSMLToolCalls(t *testing.T) {
|
||||
calls, cleaned := parseCompatFunctionCalls(`<||DSML||tool_calls><||DSML||invoke name="read_file"></||DSML||invoke></||DSML||tool_calls>`)
|
||||
if len(calls) != 1 {
|
||||
t.Fatalf("calls = %#v, want one tool call", calls)
|
||||
}
|
||||
if calls[0].Name != "read_file" {
|
||||
t.Fatalf("tool name = %q, want read_file", calls[0].Name)
|
||||
}
|
||||
if strings.TrimSpace(cleaned) != "" {
|
||||
t.Fatalf("cleaned = %q, want empty", cleaned)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user