feat: update config endpoints for use with providers (#1563)
This commit is contained in:
@@ -21,11 +21,11 @@ pub async fn build_session(
|
||||
let config = Config::global();
|
||||
|
||||
let provider_name: String = config
|
||||
.get("GOOSE_PROVIDER")
|
||||
.get_param("GOOSE_PROVIDER")
|
||||
.expect("No provider configured. Run 'goose configure' first");
|
||||
|
||||
let model: String = config
|
||||
.get("GOOSE_MODEL")
|
||||
.get_param("GOOSE_MODEL")
|
||||
.expect("No model configured. Run 'goose configure' first");
|
||||
let model_config = goose::model::ModelConfig::new(model.clone());
|
||||
let provider =
|
||||
@@ -137,7 +137,7 @@ pub async fn build_session(
|
||||
.await;
|
||||
|
||||
// Only override system prompt if a system override exists
|
||||
let system_prompt_file: Option<String> = config.get("GOOSE_SYSTEM_PROMPT_FILE_PATH").ok();
|
||||
let system_prompt_file: Option<String> = config.get_param("GOOSE_SYSTEM_PROMPT_FILE_PATH").ok();
|
||||
if let Some(ref path) = system_prompt_file {
|
||||
let override_prompt =
|
||||
std::fs::read_to_string(path).expect("Failed to read system prompt file");
|
||||
|
||||
@@ -343,7 +343,7 @@ impl Session {
|
||||
}
|
||||
|
||||
config
|
||||
.set("GOOSE_MODE", Value::String(mode.to_string()))
|
||||
.set_param("GOOSE_MODE", Value::String(mode.to_string()))
|
||||
.unwrap();
|
||||
println!("Goose mode set to '{}'", mode);
|
||||
continue;
|
||||
|
||||
@@ -150,7 +150,7 @@ fn render_tool_response(resp: &ToolResponse, theme: Theme, debug: bool) {
|
||||
}
|
||||
|
||||
let min_priority = config
|
||||
.get::<f32>("GOOSE_CLI_MIN_PRIORITY")
|
||||
.get_param::<f32>("GOOSE_CLI_MIN_PRIORITY")
|
||||
.ok()
|
||||
.unwrap_or(0.0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user