agent_service/manager/
run_executor.rs1use super::ExecutionReport;
4use crate::RunId;
5use agent_runtime::{CancellationToken, EventSink, Message, ToolContext};
6use async_trait::async_trait;
7use std::sync::Arc;
8
9#[async_trait]
11pub trait RunExecutor: Send + Sync + 'static {
12 async fn execute(
13 &self,
14 run_id: RunId,
15 agent: String,
16 input: String,
17 history: Vec<Message>,
18 context: ToolContext,
19 cancellation: CancellationToken,
20 ) -> Result<ExecutionReport, String>;
21
22 async fn execute_with_event_sink(
25 &self,
26 run_id: RunId,
27 agent: String,
28 input: String,
29 history: Vec<Message>,
30 context: ToolContext,
31 cancellation: CancellationToken,
32 event_sink: Arc<dyn EventSink>,
33 ) -> Result<ExecutionReport, String> {
34 drop(event_sink);
35 self.execute(run_id, agent, input, history, context, cancellation)
36 .await
37 }
38}