refactor: stabilize runtime and unify config

This commit is contained in:
lpf
2026-03-14 21:40:12 +08:00
parent 60eee65fec
commit 341e578c9f
75 changed files with 3081 additions and 1627 deletions

View File

@@ -74,8 +74,8 @@ func (t *ParallelTool) Parameters() map[string]interface{} {
}
func (t *ParallelTool) Execute(ctx context.Context, args map[string]interface{}) (string, error) {
callsRaw, ok := args["calls"].([]interface{})
if !ok {
callsRaw := interfaceSliceArg(args, "calls")
if len(callsRaw) == 0 {
return "", fmt.Errorf("calls must be an array")
}
@@ -86,9 +86,9 @@ func (t *ParallelTool) Execute(ctx context.Context, args map[string]interface{})
continue
}
toolName, _ := call["tool"].(string)
toolArgs, _ := call["arguments"].(map[string]interface{})
id, _ := call["id"].(string)
toolName := MapStringArg(call, "tool")
toolArgs := MapObjectArg(call, "arguments")
id := MapStringArg(call, "id")
if id == "" {
id = fmt.Sprintf("call_%d_%s", i, toolName)
}