pub struct AgentRuntimeBuilder {
pub parent_agent_last_uuid: Option<String>,
/* private fields */
}Expand description
Builder for AgentRuntime.
§Required
llm(...)— The LLM provider.
All other methods are optional with sensible defaults.
Fields§
§parent_agent_last_uuid: Option<String>UUID of the parent agent’s last message. When set, the first
MessageAppended event will carry this as parent_uuid, branching
the subagent’s messages off that point in the conversation tree (g155).
Stored here for future multi-agent orchestration; not yet wired to
the actual event emission path.
Implementations§
Source§impl AgentRuntimeBuilder
impl AgentRuntimeBuilder
Sourcepub fn parent_agent_last_uuid(self, uuid: impl Into<String>) -> Self
pub fn parent_agent_last_uuid(self, uuid: impl Into<String>) -> Self
Set the UUID of the parent agent’s last message.
When set, this runtime’s messages will be stamped with this UUID as
parent_uuid on their first MessageAppended event, branching the
subagent chain off the given point in the parent’s conversation tree
(g155). Currently stored for future multi-agent orchestration.
Sourcepub fn llm(self, llm: Arc<dyn LlmProvider>) -> Self
pub fn llm(self, llm: Arc<dyn LlmProvider>) -> Self
Set the LLM provider (required).
Sourcepub fn tools(self, tools: ToolRegistry) -> Self
pub fn tools(self, tools: ToolRegistry) -> Self
Set the tool registry (optional, defaults to a local empty registry).
Sourcepub fn system_prompt(self, prompt: impl Into<String>) -> Self
pub fn system_prompt(self, prompt: impl Into<String>) -> Self
Set an initial system prompt (optional).
This is prepended to the transcript as the first message.
Sourcepub fn max_steps(self, n: usize) -> Self
pub fn max_steps(self, n: usize) -> Self
Set the maximum number of LLM calls per turn (optional, default 32).
Sourcepub fn max_transcript_chars(self, n: usize) -> Self
pub fn max_transcript_chars(self, n: usize) -> Self
Set a transcript character limit (optional, default unlimited).
Sourcepub fn compactor(self, compactor: Compactor) -> Self
pub fn compactor(self, compactor: Compactor) -> Self
Set an optional compactor for summarising old messages.
Sourcepub fn streaming(self, enabled: bool) -> Self
pub fn streaming(self, enabled: bool) -> Self
Enable or disable streaming of partial tokens (optional, default false).
Sourcepub fn planning_mode(self, mode: PlanningMode) -> Self
pub fn planning_mode(self, mode: PlanningMode) -> Self
Set the planning mode (optional, defaults to PlanningMode::Immediate).
Sourcepub fn hooks(self, hooks: HookRegistry) -> Self
pub fn hooks(self, hooks: HookRegistry) -> Self
Set the hook registry (optional).
Sourcepub fn seed_transcript(self, messages: Vec<Message>) -> Self
pub fn seed_transcript(self, messages: Vec<Message>) -> Self
Seed the transcript with messages from a previous session.
These messages are placed after any system prompt, before the first user turn. Use this to resume an existing conversation.
Sourcepub fn permission_hook(self, hook: Arc<dyn PermissionHook>) -> Self
pub fn permission_hook(self, hook: Arc<dyn PermissionHook>) -> Self
Set an optional permission hook for tool-call interception.
Sourcepub fn event_sink(self, sink: Arc<dyn EventSink>) -> Self
pub fn event_sink(self, sink: Arc<dyn EventSink>) -> Self
Set the event sink for streaming events (optional, defaults to NullSink).
Sourcepub fn shutdown_token(self, token: CancellationToken) -> Self
pub fn shutdown_token(self, token: CancellationToken) -> Self
Set the cancellation token for graceful shutdown. When the token
is cancelled, the runtime’s underlying kernel terminates the
step loop with
FinishReason::Cancelled
at the next step boundary.
Sourcepub fn build(self) -> Result<AgentRuntime>
pub fn build(self) -> Result<AgentRuntime>
Build the AgentRuntime.
Returns an error if the LLM provider is missing.
Trait Implementations§
Source§impl Debug for AgentRuntimeBuilder
impl Debug for AgentRuntimeBuilder
Auto Trait Implementations§
impl !RefUnwindSafe for AgentRuntimeBuilder
impl !UnwindSafe for AgentRuntimeBuilder
impl Freeze for AgentRuntimeBuilder
impl Send for AgentRuntimeBuilder
impl Sync for AgentRuntimeBuilder
impl Unpin for AgentRuntimeBuilder
impl UnsafeUnpin for AgentRuntimeBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more