use crate::model::ReasoningEffort;
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[cfg_attr(feature = "openapi", derive(utoipa::ToSchema))]
pub struct ReasoningState {
#[cfg_attr(
feature = "openapi",
schema(example = "01933b5a-0000-7000-8000-000000000001")
)]
pub epoch: String,
#[cfg_attr(feature = "openapi", schema(example = "low"))]
pub baseline: Option<ReasoningEffort>,
#[cfg_attr(feature = "openapi", schema(example = "high"))]
pub effective: Option<ReasoningEffort>,
#[serde(skip)]
pub pending: Option<ReasoningEffort>,
}
impl ReasoningState {
pub fn is_supported(&self) -> bool {
[self.baseline, self.effective, self.pending]
.into_iter()
.flatten()
.all(supported_update_effort)
}
}
pub fn supports_configuration_updates(model: &str) -> bool {
model == "gpt-6-astra"
}
pub fn supported_update_effort(effort: ReasoningEffort) -> bool {
matches!(
effort,
ReasoningEffort::Low
| ReasoningEffort::Medium
| ReasoningEffort::High
| ReasoningEffort::Xhigh
| ReasoningEffort::Max
)
}