pub struct Agent { /* private fields */ }Expand description
Agent configuration for building sessions.
This is the stateless component that holds configuration and tools.
Use Agent::builder() or Agent::from_runtime() to create.
Implementations§
Source§impl Agent
impl Agent
Sourcepub fn from_runtime(
runtime: Arc<dyn AgentRuntime>,
tools: Arc<dyn ToolPort>,
) -> AgentBuilder
pub fn from_runtime( runtime: Arc<dyn AgentRuntime>, tools: Arc<dyn ToolPort>, ) -> AgentBuilder
Create an Agent from pre-built runtime components.
This is the most flexible constructor, allowing full control over all components.
Sourcepub fn start_session(&self) -> Session
pub fn start_session(&self) -> Session
Start a new session with auto-generated session ID.
Sourcepub fn start_session_with_id(&self, session_id: impl Into<String>) -> Session
pub fn start_session_with_id(&self, session_id: impl Into<String>) -> Session
Start a new session with a specific session ID.
Sourcepub fn runtime(&self) -> &Arc<dyn AgentRuntime>
pub fn runtime(&self) -> &Arc<dyn AgentRuntime>
Get a reference to the underlying runtime.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Agent
impl !RefUnwindSafe for Agent
impl Send for Agent
impl Sync for Agent
impl Unpin for Agent
impl UnsafeUnpin for Agent
impl !UnwindSafe for Agent
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