feat(ai): unify model discovery and effort handling
This commit is contained in:
1 parent
c54b95e274
commit
c7e7b7c9d9
41 files changed
+3291
-634
No files matched your search
@@ -17,6 +17,12 @@ 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 ai_resolve_model_effort(config: AiConfig, model_id: String) -> Result<AiEffortCapability, String> {
|
||||
let config = resolve_cli_provider_config(config);
|
||||
dbx_core::ai::resolve_model_effort_core(&config, &model_id).await
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn save_ai_config(state: State<'_, Arc<AppState>>, config: AiConfig) -> Result<(), String> {
|
||||
state.storage.save_ai_config(&config).await
|
||||
@@ -47,6 +53,19 @@ pub async fn load_ai_provider_configs(
|
||||
state.storage.load_ai_provider_configs().await
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn save_ai_chat_selection(
|
||||
state: State<'_, Arc<AppState>>,
|
||||
selection: AiChatSelectionState,
|
||||
) -> Result<(), String> {
|
||||
state.storage.save_ai_chat_selection(&selection).await
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn load_ai_chat_selection(state: State<'_, Arc<AppState>>) -> Result<Option<AiChatSelectionState>, String> {
|
||||
state.storage.load_ai_chat_selection().await
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn ai_complete(request: AiCompletionRequest) -> Result<String, String> {
|
||||
dbx_core::ai::complete(&request).await
|
||||
|
||||
Reference in new issue
Block a user