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

This commit is contained in:
asepharyana
2026-07-12 02:46:16 +07:00
parent d52ee967ee
commit 71d3494372
2 changed files with 11 additions and 7 deletions
+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 {