Skip to main content

orchestrator_config/
selection.rs

1//! Agent selection strategy and scoring weight types.
2
3use serde::{Deserialize, Serialize};
4
5/// Selection strategy for agent choosing
6#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, Default)]
7#[serde(rename_all = "snake_case")]
8pub enum SelectionStrategy {
9    /// Static cost-based sorting (default behavior)
10    #[default]
11    CostBased,
12    /// Success rate weighted selection
13    SuccessRateWeighted,
14    /// Performance (latency) focused selection
15    PerformanceFirst,
16    /// Adaptive scoring with configurable weights
17    Adaptive,
18    /// Load-balanced selection
19    LoadBalanced,
20    /// Capability-aware health tracking
21    CapabilityAware,
22}
23
24/// Weights for adaptive scoring
25#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
26pub struct SelectionWeights {
27    /// Weight for cost factor (0.0 - 1.0)
28    pub cost: f32,
29    /// Weight for success rate (0.0 - 1.0)
30    pub success_rate: f32,
31    /// Weight for performance (0.0 - 1.0)
32    pub performance: f32,
33    /// Weight for load balancing (0.0 - 1.0)
34    pub load: f32,
35}
36
37impl Default for SelectionWeights {
38    fn default() -> Self {
39        Self {
40            cost: 0.20,
41            success_rate: 0.30,
42            performance: 0.25,
43            load: 0.25,
44        }
45    }
46}