Skip to content

Commit 9903be6

Browse files
Uchiha007Folyd
authored andcommitted
Refactor default_model function to prioritize DEEPSEEK_API_KEY and return GPT3_5_TURBO as fallback
1 parent 160e8ed commit 9903be6

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
@@ -48,11 +48,9 @@ pub(crate) fn openai_client() -> OpenAIClient {
4848
}
4949

5050
pub(crate) fn default_model() -> &'static str {
51-
if env::var("OPENAI_API_KEY").is_ok() {
52-
GPT3_5_TURBO
53-
} else if env::var("DEEPSEEK_API_KEY").is_ok() {
51+
if env::var("DEEPSEEK_API_KEY").is_ok() {
5452
DEEPSEEK_CHAT
5553
} else {
56-
panic!("No API key found.");
54+
GPT3_5_TURBO
5755
}
5856
}

0 commit comments

Comments
 (0)