Expand description
§Module: Agent
§Responsibility
Provides a ReAct (Thought-Action-Observation) agent loop with pluggable tools.
Mirrors the public API of wasm-agent.
§Guarantees
- Deterministic: the loop terminates after at most
max_iterationscycles - Non-panicking: all operations return
Result - Tool handlers support both sync and async
Fnclosures
§NOT Responsible For
- Actual LLM inference (callers supply a mock/stub inference fn)
- WASM compilation or browser execution
- Streaming partial responses
Structs§
- Agent
Config - Configuration for the ReAct agent loop.
- Message
- A single message in the conversation history.
- ReAct
Loop - The ReAct agent loop.
- ReAct
Step - A single ReAct step: Thought → Action → Observation.
- Tool
Registry - Registry of available tools for the agent loop.
- Tool
Spec - Describes and implements a single callable tool.
Enums§
- Agent
Error - Agent-specific errors, mirrors
wasm-agent::AgentError. - Role
- Role of a message in a conversation.
Functions§
- parse_
react_ step - Parses a ReAct response string into a
ReActStep.
Type Aliases§
- Async
Tool Future - A pinned, boxed future returning a
Value. Used for async tool handlers. - Async
Tool Handler - An async tool handler closure.