fix(relaykit): preserve parameterless tools in Claude conversion (#6862)

This commit is contained in:
Seefs
2026-08-18 17:30:59 +08:00
committed by GitHub
parent e2c7aa7b10
commit 3dda1d50c6
4 changed files with 105 additions and 39 deletions
@@ -0,0 +1,16 @@
package claude
func FunctionParametersToInputSchema(parameters any) map[string]any {
params, _ := parameters.(map[string]any)
schema := make(map[string]any, len(params)+2)
for key, value := range params {
schema[key] = value
}
if schema["type"] == nil {
schema["type"] = "object"
}
if schema["properties"] == nil {
schema["properties"] = map[string]any{}
}
return schema
}