mirror of
https://github.com/CJackHwang/ds2api.git
synced 2026-05-22 00:47:45 +08:00
feat: add strict schema enforcement and strip hallucinated fields from tool call parameters
This commit is contained in:
@@ -158,6 +158,10 @@ func filterToolCallsDetailed(parsed []ParsedToolCall, availableToolNames []strin
|
||||
}
|
||||
if tc.Input == nil {
|
||||
tc.Input = map[string]any{}
|
||||
} else {
|
||||
// Remove known hallucinated fields often generated by models trying to bridge XML and JSON
|
||||
delete(tc.Input, "_raw")
|
||||
delete(tc.Input, "_xml")
|
||||
}
|
||||
out = append(out, tc)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user