pub struct AgentKernelBuilder { /* private fields */ }Expand description
Builder for AgentKernel.
Implementations§
Source§impl AgentKernelBuilder
impl AgentKernelBuilder
Sourcepub fn llm(self, llm: Arc<dyn LlmProvider>) -> Self
pub fn llm(self, llm: Arc<dyn LlmProvider>) -> Self
Set the LLM provider.
Sourcepub fn tools(self, tools: ToolRegistry) -> Self
pub fn tools(self, tools: ToolRegistry) -> Self
Set the tool registry.
Sourcepub fn max_transcript_chars(self, n: usize) -> Self
pub fn max_transcript_chars(self, n: usize) -> Self
Set the maximum transcript characters before trimming.
Sourcepub fn compactor(self, compactor: Compactor) -> Self
pub fn compactor(self, compactor: Compactor) -> Self
Set the compactor for summarising old messages.
Sourcepub fn hooks(self, hooks: HookRegistry) -> Self
pub fn hooks(self, hooks: HookRegistry) -> Self
Set the hook registry.
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 kernel’s step loop terminates with
FinishReason::Cancelled
at the next step boundary.
Sourcepub fn with_storage(self, backend: Arc<dyn StorageBackend>) -> Self
pub fn with_storage(self, backend: Arc<dyn StorageBackend>) -> Self
Inject a storage backend. If not set, build() defaults to
LocalStorageBackend rooted at the current working directory.
Sourcepub fn with_session_store(self, store: Arc<dyn SessionStore>) -> Self
pub fn with_session_store(self, store: Arc<dyn SessionStore>) -> Self
Inject a session hot-state store. If not set, build() uses
NoopSessionStore (zero cost, no I/O).
Sourcepub fn with_tool_set_provider(self, provider: Arc<dyn ToolSetProvider>) -> Self
pub fn with_tool_set_provider(self, provider: Arc<dyn ToolSetProvider>) -> Self
Inject a tool set provider. When set and tools() is NOT also called,
build() delegates tools construction to provider.build_registry().
If tools() was set explicitly, that registry takes precedence.
Sourcepub fn build(self) -> Result<AgentKernel>
pub fn build(self) -> Result<AgentKernel>
Build the AgentKernel, or return an error if required fields are missing.
Trait Implementations§
Source§impl Debug for AgentKernelBuilder
impl Debug for AgentKernelBuilder
Source§impl Default for AgentKernelBuilder
impl Default for AgentKernelBuilder
Source§fn default() -> AgentKernelBuilder
fn default() -> AgentKernelBuilder
Auto Trait Implementations§
impl !RefUnwindSafe for AgentKernelBuilder
impl !UnwindSafe for AgentKernelBuilder
impl Freeze for AgentKernelBuilder
impl Send for AgentKernelBuilder
impl Sync for AgentKernelBuilder
impl Unpin for AgentKernelBuilder
impl UnsafeUnpin for AgentKernelBuilder
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