| """ | |
| Streaming event types yielded by Agent.stream(). | |
| Each event is a plain dict with at least a ``"type"`` key. | |
| """ | |
| # ββ Text chunk ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| # {"type": "text", "content": "partial assistant message"} | |
| TEXT = "text" | |
| # ββ Reasoning (e.g. DeepSeek R1 chain-of-thought) ββββββββββββββββββββββ | |
| # {"type": "reasoning", "content": "model thinking"} | |
| REASONING = "reasoning" | |
| # ββ Tool was called by the model ββββββββββββββββββββββββββββββββββββββββ | |
| # {"type": "tool_call", "name": "fetch_webpage", "arguments": '{"url":"..."}'} | |
| TOOL_CALL = "tool_call" | |
| # ββ Tool execution output βββββββββββββββββββββββββββββββββββββββββββββββ | |
| # {"type": "tool_output", "name": "fetch_webpage", "content": "<html>..."} | |
| TOOL_OUTPUT = "tool_output" | |
| # ββ Final response (no more tool calls) βββββββββββββββββββββββββββββββββ | |
| # {"type": "done", "content": "full assistant message"} | |
| DONE = "done" | |
| # ββ Fatal error βββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| # {"type": "error", "content": "API key invalid"} | |
| ERROR = "error" | |