Expand description
Text-based agent execution — request/response LLM pipelines.
While Agent::run_live() operates over a Gemini Live WebSocket session,
TextAgent::run() makes standard BaseLlm::generate() calls. This enables
dispatching text-based agent pipelines from Live session event hooks.
§Agent types
| Type | Purpose |
|---|---|
LlmTextAgent | Core agent — generate → tool dispatch → loop |
FnTextAgent | Zero-cost state transform (no LLM call) |
SequentialTextAgent | Run children in order, state flows forward |
ParallelTextAgent | Run children concurrently via tokio::spawn |
LoopTextAgent | Repeat until max iterations or predicate |
FallbackTextAgent | Try each child, first success wins |
RouteTextAgent | State-driven deterministic branching |
RaceTextAgent | Run concurrently, first to finish wins |
TimeoutTextAgent | Wrap an agent with a time limit |
MapOverTextAgent | Iterate an agent over a list in state |
TapTextAgent | Read-only observation (no mutation) |
DispatchTextAgent | Fire-and-forget background tasks |
JoinTextAgent | Wait for dispatched tasks |
Structs§
- Dispatch
Text Agent - Fire-and-forget background task launcher with global task budget.
- Fallback
Text Agent - Tries each child agent in sequence. Returns the first successful result. If all fail, returns the last error.
- FnText
Agent - Zero-cost state transform agent — executes a closure, no LLM call.
- Join
Text Agent - Waits for dispatched background tasks and collects their results.
- LlmText
Agent - Core text agent — calls
BaseLlm::generate(), dispatches tools, loops until the model produces a final text response. - Loop
Text Agent - Runs a text agent repeatedly until max iterations or a state predicate.
- MapOver
Text Agent - Iterates a single agent over each item in a state list.
Reads
state[list_key], runs agent per item (settingstate[item_key]), collects results intostate[output_key]. - Parallel
Text Agent - Runs text agents concurrently. All branches share state. Results are collected and joined with newlines.
- Race
Text Agent - Runs agents concurrently, returns the first to complete. Cancels the rest.
- Route
Rule - A routing rule: predicate over state → target agent.
- Route
Text Agent - State-driven deterministic branching — evaluates predicates in order, dispatches to the first matching agent. Falls back to default if none match.
- Sequential
Text Agent - Runs text agents sequentially. Each agent sees state mutations from previous agents. The final agent’s output is the pipeline’s output.
- TapText
Agent - Read-only observation agent. Calls a function with the state but cannot mutate it. Returns empty string. No LLM call.
- Task
Registry - Shared registry for dispatched background tasks.
- Timeout
Text Agent - Wraps an agent with a time limit. Returns
AgentError::Timeoutif exceeded.
Traits§
- Text
Agent - A text-based agent that runs via
BaseLlm::generate()(request/response).