refactor(dynamic_routing): add support for shuffle on tie flag to success_based routing (#8241)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Chethan Rao
2025-06-13 12:02:49 +05:30
committed by GitHub
parent 953bace38c
commit c72d365fde
6 changed files with 18 additions and 2 deletions

View File

@ -1016,6 +1016,7 @@ impl Default for SuccessBasedRoutingConfig {
}),
specificity_level: SuccessRateSpecificityLevel::default(),
exploration_percent: Some(20.0),
shuffle_on_tie_during_exploitation: Some(false),
}),
decision_engine_configs: None,
}
@ -1044,6 +1045,7 @@ pub struct SuccessBasedRoutingConfigBody {
#[serde(default)]
pub specificity_level: SuccessRateSpecificityLevel,
pub exploration_percent: Option<f64>,
pub shuffle_on_tie_during_exploitation: Option<bool>,
}
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, ToSchema)]
@ -1173,6 +1175,9 @@ impl SuccessBasedRoutingConfigBody {
if let Some(exploration_percent) = new.exploration_percent {
self.exploration_percent = Some(exploration_percent);
}
if let Some(shuffle_on_tie_during_exploitation) = new.shuffle_on_tie_during_exploitation {
self.shuffle_on_tie_during_exploitation = Some(shuffle_on_tie_during_exploitation);
}
}
}