mirror of
https://github.com/aljazceru/notedeck.git
synced 2025-12-19 09:34:19 +01:00
dave: more flexible env config
With this I was able to get openrouter working: DAVE_API_KEY=$OPENROUTER_API_KEY DAVE_ENDPOINT=https://openrouter.ai/api/v1 DAVE_MODEL="google/gemini-2.0-flash-001" RUST_LOG=async_openai=debug,notedeck_dave=debug ./target/release/notedeck
This commit is contained in:
@@ -10,9 +10,13 @@ pub struct ModelConfig {
|
||||
impl Default for ModelConfig {
|
||||
fn default() -> Self {
|
||||
ModelConfig {
|
||||
endpoint: None,
|
||||
model: "gpt-4o".to_string(),
|
||||
api_key: std::env::var("OPENAI_API_KEY").ok(),
|
||||
endpoint: std::env::var("DAVE_ENDPOINT").ok(),
|
||||
model: std::env::var("DAVE_MODEL")
|
||||
.ok()
|
||||
.unwrap_or("gpt-4o".to_string()),
|
||||
api_key: std::env::var("DAVE_API_KEY")
|
||||
.ok()
|
||||
.or(std::env::var("OPENAI_API_KEY").ok()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user