pub struct BaseAgent<T: AgentDeriveT> {
pub inner: Arc<T>,
pub llm: Arc<dyn LLMProvider>,
pub id: AgentID,
pub memory: Option<Arc<RwLock<Box<dyn MemoryProvider>>>>,
}Expand description
Base agent type that wraps an AgentDeriveT implementation with additional runtime components
Fields§
§inner: Arc<T>The inner agent implementation (from macro)
llm: Arc<dyn LLMProvider>LLM provider for this agent
id: AgentID§memory: Option<Arc<RwLock<Box<dyn MemoryProvider>>>>Optional memory provider
Implementations§
Source§impl<T: AgentDeriveT> BaseAgent<T>
impl<T: AgentDeriveT> BaseAgent<T>
Sourcepub fn new(
inner: T,
llm: Arc<dyn LLMProvider>,
memory: Option<Box<dyn MemoryProvider>>,
) -> Self
pub fn new( inner: T, llm: Arc<dyn LLMProvider>, memory: Option<Box<dyn MemoryProvider>>, ) -> Self
Create a new BaseAgent wrapping an AgentDeriveT implementation
pub fn inner(&self) -> Arc<T>
Sourcepub fn description(&self) -> &'static str
pub fn description(&self) -> &'static str
Get the agent’s description
pub fn agent_config(&self) -> AgentConfig
Sourcepub fn llm(&self) -> Arc<dyn LLMProvider>
pub fn llm(&self) -> Arc<dyn LLMProvider>
Get the LLM provider
Trait Implementations§
Source§impl<T: AgentDeriveT> Debug for BaseAgent<T>
impl<T: AgentDeriveT> Debug for BaseAgent<T>
Source§impl<T: AgentDeriveT> IntoRunnable<T> for BaseAgent<T>
impl<T: AgentDeriveT> IntoRunnable<T> for BaseAgent<T>
fn into_runnable(self) -> Arc<dyn RunnableAgent>
Auto Trait Implementations§
impl<T> Freeze for BaseAgent<T>
impl<T> !RefUnwindSafe for BaseAgent<T>
impl<T> Send for BaseAgent<T>
impl<T> Sync for BaseAgent<T>
impl<T> Unpin for BaseAgent<T>
impl<T> !UnwindSafe for BaseAgent<T>
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