use serde::{Deserialize, Serialize};
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct ModelConfig {
#[serde(default = "default_loop_detection_enabled")]
pub skip_loop_detection: bool,
#[serde(default = "default_loop_detection_threshold")]
pub loop_detection_threshold: usize,
#[serde(default = "default_loop_detection_interactive")]
pub loop_detection_interactive: bool,
#[serde(default)]
pub model_supports_reasoning: Option<bool>,
#[serde(default)]
pub model_supports_reasoning_effort: Option<bool>,
}
impl Default for ModelConfig {
fn default() -> Self {
Self {
skip_loop_detection: default_loop_detection_enabled(),
loop_detection_threshold: default_loop_detection_threshold(),
loop_detection_interactive: default_loop_detection_interactive(),
model_supports_reasoning: None,
model_supports_reasoning_effort: None,
}
}
}
#[inline]
const fn default_loop_detection_enabled() -> bool {
false
}
#[inline]
const fn default_loop_detection_threshold() -> usize {
2
}
#[inline]
const fn default_loop_detection_interactive() -> bool {
true
}