added optional request params and context limit from GOOSE_PREDEFINED_MODELS (#6489)

This commit is contained in:
Zane
2026-01-16 10:12:14 -08:00
committed by GitHub
parent 351e99b82d
commit 080a0e04ba
12 changed files with 140 additions and 13 deletions
+11 -6
View File
@@ -48,6 +48,8 @@ pub struct UpdateProviderRequest {
provider: String,
model: Option<String>,
session_id: String,
context_limit: Option<usize>,
request_params: Option<std::collections::HashMap<String, serde_json::Value>>,
}
#[derive(Deserialize, utoipa::ToSchema)]
@@ -528,12 +530,15 @@ async fn update_agent_provider(
}
};
let model_config = ModelConfig::new(&model).map_err(|e| {
(
StatusCode::BAD_REQUEST,
format!("Invalid model config: {}", e),
)
})?;
let model_config = ModelConfig::new(&model)
.map_err(|e| {
(
StatusCode::BAD_REQUEST,
format!("Invalid model config: {}", e),
)
})?
.with_context_limit(payload.context_limit)
.with_request_params(payload.request_params);
let new_provider = create(&payload.provider, model_config).await.map_err(|e| {
(