mirror of
https://github.com/aljazceru/notedeck.git
synced 2025-12-20 18:04:18 +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 {
|
impl Default for ModelConfig {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
ModelConfig {
|
ModelConfig {
|
||||||
endpoint: None,
|
endpoint: std::env::var("DAVE_ENDPOINT").ok(),
|
||||||
model: "gpt-4o".to_string(),
|
model: std::env::var("DAVE_MODEL")
|
||||||
api_key: std::env::var("OPENAI_API_KEY").ok(),
|
.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