use serde::{Deserialize, Serialize};
use ai_agents_core::AgentResponse;
#[derive(Debug, Clone)]
pub struct RouteResult {
pub response: AgentResponse,
pub selected_agent: String,
pub reason: String,
pub confidence: Option<f64>,
}
#[derive(Debug, Clone)]
pub struct PipelineResult {
pub response: AgentResponse,
pub stage_outputs: Vec<StageOutput>,
}
#[derive(Debug, Clone)]
pub struct StageOutput {
pub agent_id: String,
pub output: String,
pub duration_ms: u64,
pub skipped: bool,
}
#[derive(Debug, Clone)]
pub struct PipelineStage {
pub agent_id: String,
pub input: Option<String>,
}
impl PipelineStage {
pub fn id(agent_id: impl Into<String>) -> Self {
Self {
agent_id: agent_id.into(),
input: None,
}
}
pub fn with_input(mut self, input: impl Into<String>) -> Self {
self.input = Some(input.into());
self
}
}
impl From<String> for PipelineStage {
fn from(agent_id: String) -> Self {
Self::id(agent_id)
}
}
impl From<&str> for PipelineStage {
fn from(agent_id: &str) -> Self {
Self::id(agent_id)
}
}
#[derive(Debug, Clone)]
pub struct ConcurrentResult {
pub response: AgentResponse,
pub agent_results: Vec<AgentResult>,
pub aggregation_strategy: String,
}
#[derive(Debug, Clone)]
pub struct AgentResult {
pub agent_index: usize,
pub agent_id: String,
pub response: Option<AgentResponse>,
pub duration_ms: u64,
pub success: bool,
pub error: Option<String>,
}
#[derive(Debug, Clone)]
pub struct GroupChatResult {
pub response: AgentResponse,
pub transcript: Vec<ChatTurn>,
pub rounds_completed: u32,
pub termination_reason: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ChatTurn {
pub speaker: String,
pub round: u32,
pub content: String,
}
#[derive(Debug, Clone)]
pub struct HandoffResult {
pub response: AgentResponse,
pub handoff_chain: Vec<HandoffEvent>,
pub final_agent: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct HandoffEvent {
pub from_agent: String,
pub to_agent: String,
pub reason: String,
}
#[derive(Debug, Clone, Default)]
pub enum RoutingMethod {
#[default]
Llm,
RoundRobin,
}