handleTransferTask processes the transfer_task tool call.
(tc tools.ToolCall)
| 714 | |
| 715 | // handleTransferTask processes the transfer_task tool call. |
| 716 | func (rt *wasmRuntime) handleTransferTask(tc tools.ToolCall) (string, string) { |
| 717 | var params struct { |
| 718 | Agent string `json:"agent"` |
| 719 | Task string `json:"task"` |
| 720 | ExpectedOutput string `json:"expected_output"` |
| 721 | } |
| 722 | if err := json.Unmarshal([]byte(tc.Function.Arguments), ¶ms); err != nil { |
| 723 | return fmt.Sprintf("Invalid arguments: %v", err), "" |
| 724 | } |
| 725 | |
| 726 | if _, ok := rt.agents[params.Agent]; !ok { |
| 727 | return fmt.Sprintf("Agent %q not found", params.Agent), "" |
| 728 | } |
| 729 | |
| 730 | return fmt.Sprintf("Task transferred to %s: %s", params.Agent, params.Task), params.Agent |
| 731 | } |
| 732 | |
| 733 | // handleHandoff processes the handoff tool call. |
| 734 | func (rt *wasmRuntime) handleHandoff(tc tools.ToolCall) (string, string) { |