Dataclasses for streaming agent reasoning steps and events.
# Source: https://github.com/SynapseKit/SynapseKit | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
# Provided via justclaw.it.com; keep this notice with the code.
"""Step event types for streaming agent reasoning."""
from __future__ import annotations
from dataclasses import dataclass
from typing import Any
@dataclass
class ThoughtEvent:
"""Agent's internal reasoning step."""
thought: str
type: str = "thought"
@dataclass
class ActionEvent:
"""Agent decided to call a tool."""
tool: str
tool_input: str | dict[str, Any] = ""
type: str = "action"
@dataclass
class ObservationEvent:
"""Result from a tool execution."""
observation: str
tool: str = ""
type: str = "observation"
@dataclass
class To
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key