This commit is contained in:
2026-08-21 22:39:51 +07:00
parent d2592ab6d6
commit 5f284883b3
5 changed files with 15 additions and 13 deletions
+3 -3
View File
@@ -126,7 +126,7 @@ result = getWeather_tool.execute("call-1", Dict("city" => "Tokyo"), sig, op)
**Via agent loop (production):**
```
user message → runAgent(agent, Dict("role"=>"user", "content"=>...))
user message → promptAgent(agent, Dict("role"=>"user", "content"=>...))
→ _agentLoop detects message → @spawn _processMessage(agent)
→ prepareContext → formatMsgForLLM → llmCall
→ LLM returns tool_calls
@@ -346,7 +346,7 @@ The `_agentLoop()` function runs as a background `@spawn` task, created when `yi
```
yiemAgent struct contains:
- inputChannel (Channel, capacity 16) ← user sends messages here via runAgent()
- inputChannel (Channel, capacity 16) ← user sends messages here via promptAgent()
- followUpChannel (Channel, capacity 32) ← user sends follow-ups here via followUp()
- outputChannel (Channel, capacity 16) ← agent sends responses here via takeResponse()
```
@@ -1243,7 +1243,7 @@ Each `toolStore` gets its own `listTool` instance bound to that store via `listT
```
USER SENDS MESSAGE
└─> runAgent(agent, "What's the weather in Tokyo?")
└─> promptAgent(agent, "What's the weather in Tokyo?")
└─> put!(agent.inputChannel, Dict("role" => "user", "content" => [...]))