Apply model capability flags to an LlmConfig. - `temperature = false` → omit temperature (model ignores it, e.g. o1) - `reasoning = true` + `thinking_budget` set → pass budget to client - `limit.output > 0` → use as max_tokens
(
mut config: LlmConfig,
model: &ModelConfig,
thinking_budget: Option<usize>,
)
| 129 | /// - `reasoning = true` + `thinking_budget` set → pass budget to client |
| 130 | /// - `limit.output > 0` → use as max_tokens |
| 131 | pub(crate) fn apply_model_caps( |
| 132 | mut config: LlmConfig, |
| 133 | model: &ModelConfig, |
| 134 | thinking_budget: Option<usize>, |
| 135 | ) -> LlmConfig { |
| 136 | // reasoning=true + thinking_budget set → pass budget to client (Anthropic only) |
| 137 | if model.reasoning { |
| 138 | if let Some(budget) = thinking_budget { |
| 139 | config = config.with_thinking_budget(budget); |
| 140 | } |
| 141 | } |
| 142 | |
| 143 | // limit.output > 0 → use as max_tokens cap |
| 144 | if model.limit.output > 0 { |
| 145 | config = config.with_max_tokens(model.limit.output as usize); |
| 146 | } |
| 147 | |
| 148 | // temperature=false models (e.g. o1) must not receive a temperature param. |
| 149 | // Store the flag so the LLM client can gate it at call time. |
| 150 | if !model.temperature { |
| 151 | config.disable_temperature = true; |
| 152 | } |
| 153 | |
| 154 | config |
| 155 | } |
| 156 | |
| 157 | impl ProviderConfig { |
| 158 | /// Find a model by ID |
no test coverage detected