pub trait BaseAgent: Send + Sync {
// Required method
fn plan<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
intermediate_steps: &'life1 [AgentStep],
inputs: &'life2 HashMap<String, String>,
) -> Pin<Box<dyn Future<Output = Result<AgentOutput, AgentError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
// Provided methods
fn input_keys(&self) -> Vec<&str> { ... }
fn get_allowed_tools(&self) -> Option<Vec<&str>> { ... }
fn return_stopped_response(
&self,
_intermediate_steps: &[AgentStep],
) -> AgentFinish { ... }
}Expand description
Base Agent trait.
Defines the core interface for agents. Agent is responsible for planning, not execution. Execution is handled by AgentExecutor.
Required Methods§
Sourcefn plan<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
intermediate_steps: &'life1 [AgentStep],
inputs: &'life2 HashMap<String, String>,
) -> Pin<Box<dyn Future<Output = Result<AgentOutput, AgentError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn plan<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
intermediate_steps: &'life1 [AgentStep],
inputs: &'life2 HashMap<String, String>,
) -> Pin<Box<dyn Future<Output = Result<AgentOutput, AgentError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Provided Methods§
Sourcefn input_keys(&self) -> Vec<&str>
fn input_keys(&self) -> Vec<&str>
Returns input keys.
Sourcefn get_allowed_tools(&self) -> Option<Vec<&str>>
fn get_allowed_tools(&self) -> Option<Vec<&str>>
Returns allowed tools list.
Sourcefn return_stopped_response(
&self,
_intermediate_steps: &[AgentStep],
) -> AgentFinish
fn return_stopped_response( &self, _intermediate_steps: &[AgentStep], ) -> AgentFinish
Returns stopped response when max iterations reached.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".