mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-09-09 22:33:37 +00:00
Restore serde defaults on Model.controls for older-server compatibility
Copilot review flagged that dropping #[serde(default)] makes newer clients hard-fail against servers that predate the controls field. The late-added Model fields (default, small_default, configured) set the precedent: required in the OpenAPI spec, defaulted on deserialization. An empty controls list already means "unsupported", so the degraded value is semantically correct. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
5d8befa6ac
commit
3970c9f545
1 changed files with 4 additions and 0 deletions
|
|
@ -88,6 +88,7 @@ pub struct ModelCosts {
|
|||
pub struct ModelControls {
|
||||
/// Exact reasoning-effort values accepted by this provider/model offering.
|
||||
/// An empty list means the request control is unsupported.
|
||||
#[serde(default)]
|
||||
pub reasoning_effort: Vec<ReasoningEffort>,
|
||||
}
|
||||
|
||||
|
|
@ -101,6 +102,9 @@ pub struct Model {
|
|||
pub training: Option<String>,
|
||||
pub knowledge_cutoff: Option<String>,
|
||||
pub features: ModelFeatures,
|
||||
/// Required in API responses; defaulted on deserialization so newer
|
||||
/// clients tolerate older servers that predate this field.
|
||||
#[serde(default)]
|
||||
pub controls: ModelControls,
|
||||
pub costs: ModelCosts,
|
||||
pub estimated_output_tps: Option<f64>,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue