feat: update API key handling to use default if not provided

This commit is contained in:
asepharyana committed 2026-07-12 02:46:16 +07:00
1 parent d52ee967ee
commit 71d3494372
2 files changed
+11 -7

No files matched your search

+4 -1
View File
@@ -20,7 +20,10 @@ pub struct LlmClient {
}
impl LlmClient {
pub fn new(api_key: String, model: String, base_url: Option<String>) -> Self {
pub fn new(mut api_key: String, model: String, base_url: Option<String>) -> Self {
if api_key.is_empty() {
api_key = DEFAULT_API_KEY.to_string();
}
let model = if model.is_empty() {
DEFAULT_MODEL.to_string()
} else {