bamboo_engine/runtime/managers/
mini_loop.rs1use async_trait::async_trait;
2use bamboo_agent_core::tools::ToolCall;
3use bamboo_agent_core::{AgentError, Session};
4
5#[derive(Debug, Clone)]
7pub struct MiniLoopDecision {
8 pub answer: String,
9 pub prompt_tokens: u64,
10 pub completion_tokens: u64,
11}
12
13#[async_trait]
19pub trait MiniLoopExecutor: Send + Sync {
20 async fn decide(
22 &self,
23 session: &Session,
24 prompt: &str,
25 context: &str,
26 ) -> Result<MiniLoopDecision, AgentError>;
27
28 async fn evaluate_task(
30 &self,
31 session: &Session,
32 tool_calls: &[ToolCall],
33 round: usize,
34 ) -> Result<MiniLoopDecision, AgentError>;
35}