Expand description
Text-agent runtime and combinators (carved out of the kernel prelude).
LlmTextAgent, the sequential/parallel/loop/fallback/route/race/timeout/map
combinators, and the TextAgent trait.
Structs§
- Chat
- A conversation with an agent: every
sendcarries the turns before it, and the conversation keeps its ownState. - 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.
- RunRequest
- What to run: the new user turn, the conversation before it, and optionally the JSON shape the reply must take.
- RunResult
- The outcome of a run: the final text, and what it took to get there.
- 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. - Tool
Call Record - A tool call the model made during a run, and what it returned.
Enums§
- RunEvent
- Something that happened during a streamed run; see
TextAgent::run_stream.
Traits§
- Text
Agent - A text-based agent that runs via
BaseLlm::generate()(request/response).