agentInstruction returns the instruction for the named agent from cfg.
(name string)
| 237 | |
| 238 | // agentInstruction returns the instruction for the named agent from cfg. |
| 239 | func (rt *wasmRuntime) agentInstruction(name string) string { |
| 240 | for _, a := range rt.cfg.Agents { |
| 241 | if a.Name == name { |
| 242 | return a.Instruction |
| 243 | } |
| 244 | } |
| 245 | return "" |
| 246 | } |
| 247 | |
| 248 | // runAgentLoop runs the full agentic loop: stream completions, process tool |
| 249 | // calls, handle handoffs, and loop until the model says stop or we hit |