feat: Add environment variables to override model context limits (#3260)
Co-authored-by: dianed-square <73617011+dianed-square@users.noreply.github.com> Co-authored-by: Angie Jones <jones.angie@gmail.com>
This commit is contained in:
@@ -1303,7 +1303,7 @@ impl Session {
|
||||
pub async fn display_context_usage(&self) -> Result<()> {
|
||||
let provider = self.agent.provider().await?;
|
||||
let model_config = provider.get_model_config();
|
||||
let context_limit = model_config.context_limit.unwrap_or(32000);
|
||||
let context_limit = model_config.context_limit();
|
||||
|
||||
match self.get_metadata() {
|
||||
Ok(metadata) => {
|
||||
@@ -1450,7 +1450,8 @@ fn get_reasoner() -> Result<Arc<dyn Provider>, anyhow::Error> {
|
||||
.expect("No model configured. Run 'goose configure' first")
|
||||
};
|
||||
|
||||
let model_config = ModelConfig::new(model);
|
||||
let model_config =
|
||||
ModelConfig::new_with_context_env(model, Some("GOOSE_PLANNER_CONTEXT_LIMIT"));
|
||||
let reasoner = create(&provider, model_config)?;
|
||||
|
||||
Ok(reasoner)
|
||||
|
||||
Reference in New Issue
Block a user