File size: 1,649 Bytes
b7a067b | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | """
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"
|