Use Canonical Models to set context window sizes (#6723)
This commit is contained in:
@@ -1629,6 +1629,7 @@ impl Agent {
|
||||
.ok_or_else(|| anyhow!("Could not configure agent: missing model"))?;
|
||||
crate::model::ModelConfig::new(&model_name)
|
||||
.map_err(|e| anyhow!("Could not configure agent: invalid model {}", e))?
|
||||
.with_canonical_limits(&provider_name)
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -1417,11 +1417,10 @@ impl SummonClient {
|
||||
.or_else(|| session.provider_name.clone())
|
||||
.ok_or_else(|| anyhow::anyhow!("No provider configured"))?;
|
||||
|
||||
let mut model_config = session
|
||||
.model_config
|
||||
.clone()
|
||||
.map(Ok)
|
||||
.unwrap_or_else(|| crate::model::ModelConfig::new("default"))?;
|
||||
let mut model_config = session.model_config.clone().map(Ok).unwrap_or_else(|| {
|
||||
crate::model::ModelConfig::new("default")
|
||||
.map(|c| c.with_canonical_limits(&provider_name))
|
||||
})?;
|
||||
|
||||
if let Some(model) = ¶ms.model {
|
||||
model_config.model_name = model.clone();
|
||||
|
||||
Reference in New Issue
Block a user