WIP v0.2.0: pannello /endpoint e nomi abbreviati dei modelli (in pausa, non compilato)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1856,9 +1856,24 @@ impl Config {
|
||||
workspace_roots
|
||||
}
|
||||
|
||||
/// Per-model context windows of the active provider, keyed by model id.
|
||||
pub fn model_context_windows(&self) -> std::collections::HashMap<String, i64> {
|
||||
self.model_provider
|
||||
.models
|
||||
.iter()
|
||||
.filter_map(|(model, settings)| {
|
||||
settings
|
||||
.context_window
|
||||
.filter(|window| *window > 0)
|
||||
.map(|window| (model.clone(), window))
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
|
||||
pub fn to_models_manager_config(&self) -> ModelsManagerConfig {
|
||||
ModelsManagerConfig {
|
||||
model_context_window: self.model_context_window,
|
||||
model_context_windows: self.model_context_windows(),
|
||||
model_auto_compact_token_limit: self.model_auto_compact_token_limit,
|
||||
tool_output_token_limit: self.tool_output_token_limit,
|
||||
base_instructions: self.base_instructions.clone().filter(|_| {
|
||||
@@ -4593,6 +4608,12 @@ impl Config {
|
||||
)
|
||||
.map_err(std::io::Error::from)?;
|
||||
let otel = otel::resolve_config(cfg.otel.unwrap_or_default());
|
||||
// A reasoning effort configured for the selected model wins over the global one.
|
||||
let model_reasoning_effort = model
|
||||
.as_deref()
|
||||
.and_then(|model| model_provider.model_settings(model))
|
||||
.and_then(|settings| settings.reasoning_effort.clone())
|
||||
.or(cfg.model_reasoning_effort);
|
||||
let mut config = Self {
|
||||
plugins: cfg.plugins,
|
||||
prefer_mxc,
|
||||
@@ -4749,7 +4770,7 @@ impl Config {
|
||||
.as_ref()
|
||||
.and_then(|auto_review| auto_review.circuit_break_action)
|
||||
.unwrap_or_default(),
|
||||
model_reasoning_effort: cfg.model_reasoning_effort,
|
||||
model_reasoning_effort,
|
||||
plan_mode_reasoning_effort: cfg.plan_mode_reasoning_effort,
|
||||
model_reasoning_summary: cfg.model_reasoning_summary,
|
||||
model_catalog,
|
||||
|
||||
Reference in New Issue
Block a user