pub struct AgentBuilder { /* private fields */ }Expand description
Builder for constructing AgentCore instances
Implementations§
Source§impl AgentBuilder
impl AgentBuilder
Sourcepub fn new() -> AgentBuilder
pub fn new() -> AgentBuilder
Create a new agent builder
Sourcepub fn new_with_registry(
registry: &AgentRegistry,
config: &AppConfig,
session_id: Option<String>,
) -> Result<AgentCore, Error>
pub fn new_with_registry( registry: &AgentRegistry, config: &AppConfig, session_id: Option<String>, ) -> Result<AgentCore, Error>
Create an agent from the registry with the active profile This is a convenience method for CLI use
Sourcepub fn with_profile(self, profile: AgentProfile) -> AgentBuilder
pub fn with_profile(self, profile: AgentProfile) -> AgentBuilder
Set the agent profile
Sourcepub fn with_provider(self, provider: Arc<dyn ModelProvider>) -> AgentBuilder
pub fn with_provider(self, provider: Arc<dyn ModelProvider>) -> AgentBuilder
Set the model provider
Sourcepub fn with_embeddings_client(
self,
embeddings_client: EmbeddingsClient,
) -> AgentBuilder
pub fn with_embeddings_client( self, embeddings_client: EmbeddingsClient, ) -> AgentBuilder
Set a custom embeddings client
Sourcepub fn with_persistence(self, persistence: Persistence) -> AgentBuilder
pub fn with_persistence(self, persistence: Persistence) -> AgentBuilder
Set the persistence layer
Sourcepub fn with_session_id(self, session_id: impl Into<String>) -> AgentBuilder
pub fn with_session_id(self, session_id: impl Into<String>) -> AgentBuilder
Set the session ID
Sourcepub fn with_config(self, config: AppConfig) -> AgentBuilder
pub fn with_config(self, config: AppConfig) -> AgentBuilder
Set the application configuration (used to derive defaults)
Sourcepub fn with_tool_registry(
self,
tool_registry: Arc<ToolRegistry>,
) -> AgentBuilder
pub fn with_tool_registry( self, tool_registry: Arc<ToolRegistry>, ) -> AgentBuilder
Set the tool registry
Sourcepub fn with_policy_engine(
self,
policy_engine: Arc<PolicyEngine>,
) -> AgentBuilder
pub fn with_policy_engine( self, policy_engine: Arc<PolicyEngine>, ) -> AgentBuilder
Set the policy engine
Sourcepub fn with_agent_name(self, agent_name: impl Into<String>) -> AgentBuilder
pub fn with_agent_name(self, agent_name: impl Into<String>) -> AgentBuilder
Set the logical agent name (used for telemetry/logging)
Trait Implementations§
Source§impl Default for AgentBuilder
impl Default for AgentBuilder
Source§fn default() -> AgentBuilder
fn default() -> AgentBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for AgentBuilder
impl !RefUnwindSafe for AgentBuilder
impl Send for AgentBuilder
impl Sync for AgentBuilder
impl Unpin for AgentBuilder
impl !UnwindSafe for AgentBuilder
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().