GUI: Einstellungen mit Bereitschafts-Ampel, einklappbaren Modellkarten und Modell-Liste vom Server
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
mod agent;
|
||||
mod config;
|
||||
mod discover;
|
||||
mod images;
|
||||
mod ranking;
|
||||
mod runner;
|
||||
@ -170,6 +171,17 @@ async fn test_model(cfg: State<'_, ConfigState>, name: String) -> Result<ModelTe
|
||||
.map_err(|e| format!("Test abgebrochen: {e}"))
|
||||
}
|
||||
|
||||
/// Fragt einen Server nach seinen Modellen. Der Schlüssel kommt aus der Umgebungsvariable `api_key_env`.
|
||||
#[tauri::command]
|
||||
async fn discover_models(adapter: String, url: String, api_key_env: String) -> Result<Vec<String>, String> {
|
||||
tauri::async_runtime::spawn_blocking(move || {
|
||||
let key = if api_key_env.trim().is_empty() { None } else { std::env::var(api_key_env.trim()).ok() };
|
||||
discover::list(&adapter, &url, key.as_deref())
|
||||
})
|
||||
.await
|
||||
.map_err(|e| format!("Abfrage abgebrochen: {e}"))?
|
||||
}
|
||||
|
||||
/// Startet einen Batch mit den angegebenen Modellen (Anzeigenamen) und Aufgaben-IDs.
|
||||
/// Fortschritt kommt als Ereignis `batch-event`. Das Ergebnis ist die Zusammenfassung.
|
||||
#[tauri::command]
|
||||
@ -442,6 +454,7 @@ pub fn run() {
|
||||
list_models,
|
||||
save_models,
|
||||
test_model,
|
||||
discover_models,
|
||||
start_batch,
|
||||
cancel_batch,
|
||||
list_batches,
|
||||
|
||||
Reference in New Issue
Block a user