feat(ai): add model list fetching in settings (#364)
- Add `ai_list_models` Tauri command and core support for fetching available models from OpenAI-compatible, Claude, and Ollama providers - Replace manual model ID input with SearchableSelect in EditorSettingsDialog, including refresh button and loading state - Add i18n translations for model list UI (en, es, zh-CN) - Add tests for settings dialog layout and web driver management
This commit is contained in:
1 parent
13424588b9
commit
222ebefa6a
14 files changed
+440
-42
No files matched your search
@@ -9,6 +9,11 @@ pub async fn ai_test_connection(config: AiConfig) -> Result<String, String> {
|
||||
dbx_core::ai::test_connection_core(&config).await
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn ai_list_models(config: AiConfig) -> Result<Vec<AiModelInfo>, String> {
|
||||
dbx_core::ai::list_models_core(&config).await
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn save_ai_config(state: State<'_, Arc<AppState>>, config: AiConfig) -> Result<(), String> {
|
||||
state.storage.save_ai_config(&config).await
|
||||
|
||||
@@ -175,6 +175,7 @@ pub fn run() {
|
||||
commands::ai::ai_stream,
|
||||
commands::ai::ai_cancel_stream,
|
||||
commands::ai::ai_test_connection,
|
||||
commands::ai::ai_list_models,
|
||||
commands::ai::save_ai_config,
|
||||
commands::ai::load_ai_config,
|
||||
commands::ai::save_ai_conversation,
|
||||
|
||||
Reference in new issue
Block a user