| 54 | |
| 55 | impl AgentExecutor { |
| 56 | pub fn new( |
| 57 | agent: AgentInfo, |
| 58 | providers: Arc<ProviderRegistry>, |
| 59 | tools: Arc<ToolRegistry>, |
| 60 | ) -> Self { |
| 61 | let max_steps = agent.max_steps.unwrap_or(100); |
| 62 | let conversation = Conversation::new(); |
| 63 | |
| 64 | Self { |
| 65 | agent, |
| 66 | conversation, |
| 67 | providers, |
| 68 | tools, |
| 69 | disabled_tools: HashSet::new(), |
| 70 | subsessions: Arc::new(Mutex::new(HashMap::new())), |
| 71 | max_steps, |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | pub fn with_system_prompt(mut self, prompt: impl Into<String>) -> Self { |
| 76 | self.conversation = Conversation::with_system_prompt(prompt); |