Skip to content

Commit a836820

Browse files
committed
Refactor default_model function to prioritize DEEPSEEK_API_KEY and return GPT3_5_TURBO as fallback
1 parent 4332215 commit a836820

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

aiscript-vm/src/ai/mod.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,9 @@ pub(crate) fn openai_client() -> OpenAIClient {
3333
}
3434

3535
pub(crate) fn default_model() -> &'static str {
36-
if env::var("OPENAI_API_KEY").is_ok() {
37-
GPT3_5_TURBO
38-
} else if env::var("DEEPSEEK_API_KEY").is_ok() {
36+
if env::var("DEEPSEEK_API_KEY").is_ok() {
3937
DEEPSEEK_CHAT
4038
} else {
41-
panic!("No API key found.");
39+
GPT3_5_TURBO
4240
}
4341
}

0 commit comments

Comments
 (0)