2026-07-21 06:24:20 +07:00
|
|
|
use anyhow::Result;
|
|
|
|
|
use std::future::Future;
|
|
|
|
|
|
|
|
|
|
use zesdex_domain::agent::AgentTurnParams;
|
|
|
|
|
|
|
|
|
|
/// Interface for dispatching tool calls to their concrete implementations.
|
|
|
|
|
pub trait ToolExecutor: Send + Sync {
|
|
|
|
|
/// Execute a tool call asynchronously.
|
|
|
|
|
fn execute(
|
|
|
|
|
&self,
|
|
|
|
|
tool_name: &str,
|
|
|
|
|
args: &serde_json::Value,
|
|
|
|
|
) -> impl Future<Output = Result<String>> + Send;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Service for running agent turns asynchronously.
|
|
|
|
|
pub trait AgentTurnService: Send + Sync {
|
|
|
|
|
/// Run a full agent turn loop asynchronously.
|
2026-08-27 22:10:28 +07:00
|
|
|
fn run_turn(&self, params: AgentTurnParams) -> impl Future<Output = Result<()>> + Send;
|
2026-07-21 06:24:20 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pub mod turn_service;
|
2026-07-21 07:41:28 +07:00
|
|
|
|
|
|
|
|
pub use turn_service::{compact_messages_with_ai, AgentTurnServiceImpl};
|