langchain_rust/agent/agent.rs
1use std::sync::Arc;
2
3use async_trait::async_trait;
4
5use crate::{
6 prompt::PromptArgs,
7 schemas::agent::{AgentAction, AgentEvent},
8 tools::Tool,
9};
10
11use super::AgentError;
12
13#[async_trait]
14pub trait Agent: Send + Sync {
15 async fn plan(
16 &self,
17 intermediate_steps: &[(AgentAction, String)],
18 inputs: PromptArgs,
19 ) -> Result<AgentEvent, AgentError>;
20
21 fn get_tools(&self) -> Vec<Arc<dyn Tool>>;
22}