#[derive(Debug, Clone, Copy, PartialEq, Eq, Default, serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum OrchestrationProfile {
#[default]
ReAct,
}
impl OrchestrationProfile {
pub fn parse(s: &str) -> Result<Self, String> {
match s.trim().to_ascii_lowercase().as_str() {
"react" => Ok(Self::ReAct),
_ => Err(format!(
"未知 orchestration_profile {:?},应为 react",
s.trim()
)),
}
}
pub fn as_str(self) -> &'static str {
"react"
}
}
pub fn effective_orchestration_path_summary(
_planner_executor_mode: &str,
_profile: OrchestrationProfile,
) -> String {
"react outer loop".to_string()
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn parse_profile_variants() {
assert_eq!(
OrchestrationProfile::parse("react").unwrap(),
OrchestrationProfile::ReAct
);
assert!(OrchestrationProfile::parse("staged").is_err());
assert!(OrchestrationProfile::parse("auto").is_err());
}
}