mirror of
https://github.com/ByteAtATime/raycast-linux.git
synced 2025-09-11 16:36:26 +00:00
fix(ai): refactor AI model settings and fallback logic
This commit moves default model mappings into the backend, making it the single source of truth. The `get_ai_settings` command now merges user-defined settings with these defaults, so the UI always receives a complete and correct configuration. The model selection logic in `ai_ask_stream` was also simplified to use the merged settings, which fixes a bug where the system would use a global fallback instead of the correct model-specific default. Additionally, the `set_ai_settings` command now only persists user overrides, keeping the configuration file clean.
This commit is contained in:
parent
9b7b29d720
commit
5dafd76912
5 changed files with 248 additions and 81 deletions
|
@ -255,7 +255,9 @@ pub fn run() {
|
|||
ai::is_ai_api_key_set,
|
||||
ai::clear_ai_api_key,
|
||||
ai::ai_ask_stream,
|
||||
ai::get_ai_usage_history
|
||||
ai::get_ai_usage_history,
|
||||
ai::get_ai_settings,
|
||||
ai::set_ai_settings
|
||||
])
|
||||
.setup(|app| {
|
||||
let app_handle = app.handle().clone();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue