26 lines
680 B
Rust
26 lines
680 B
Rust
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.
|
||
|
|
fn run_turn(
|
||
|
|
&self,
|
||
|
|
params: AgentTurnParams,
|
||
|
|
) -> impl Future<Output = Result<()>> + Send;
|
||
|
|
}
|
||
|
|
|
||
|
|
pub mod turn_service;
|