feat(ui): Symbol je Engine zeigt, ob sie eine Oberfläche mitbringt, und öffnet sie als Link (#1101)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GmHhg3Td16J38kAyDLzb39
This commit is contained in:
@ -16,6 +16,11 @@ pub trait Engine: Send + Sync {
|
||||
/// Art, Modus und Fähigkeiten der Engine.
|
||||
fn describe(&self) -> EngineInfo;
|
||||
|
||||
/// Bringt die Engine eine eigene Oberfläche mit? Standard: keine bekannt.
|
||||
fn frontend(&self) -> crate::types::Frontend {
|
||||
crate::types::Frontend::None
|
||||
}
|
||||
|
||||
/// Wie die Engine gestartet wird (nur zur Anzeige, ohne Geheimnisse).
|
||||
fn start_info(&self) -> StartInfo {
|
||||
StartInfo::default()
|
||||
|
||||
@ -33,6 +33,6 @@ pub use ollama::{OllamaConfig, OllamaEngine, OllamaMode};
|
||||
pub use process::process_exists;
|
||||
pub use studio::{StudioConfig, StudioEngine};
|
||||
pub use types::{
|
||||
AdapterError, Capabilities, DiscoveredArtifact, Endpoint, EngineInfo, Health, InstanceHandle,
|
||||
Mode, ProfileSpec, Protocol, Result, StartInfo, Usage,
|
||||
AdapterError, Capabilities, DiscoveredArtifact, Endpoint, EngineInfo, Frontend, Health,
|
||||
InstanceHandle, Mode, ProfileSpec, Protocol, Result, StartInfo, Usage,
|
||||
};
|
||||
|
||||
@ -294,6 +294,12 @@ impl LlamaCppEngine {
|
||||
|
||||
#[async_trait]
|
||||
impl Engine for LlamaCppEngine {
|
||||
fn frontend(&self) -> crate::types::Frontend {
|
||||
// `llama-server` liefert seine Web-Oberfläche mit (`--webui`, Standard an; gelesen in der Hilfe
|
||||
// auf srv04, im Browser über das Gateway nicht erreichbar, #1101).
|
||||
crate::types::Frontend::Managed
|
||||
}
|
||||
|
||||
fn start_info(&self) -> StartInfo {
|
||||
let c = &self.config;
|
||||
let mut command = format!(
|
||||
|
||||
@ -23,8 +23,8 @@ use serde_json::Value;
|
||||
|
||||
use crate::engine::Engine;
|
||||
use crate::types::{
|
||||
AdapterError, Capabilities, DiscoveredArtifact, Endpoint, EngineInfo, Health, InstanceHandle,
|
||||
Mode, ProfileSpec, Protocol, Result, StartInfo, Usage,
|
||||
AdapterError, Capabilities, DiscoveredArtifact, Endpoint, EngineInfo, Frontend, Health,
|
||||
InstanceHandle, Mode, ProfileSpec, Protocol, Result, StartInfo, Usage,
|
||||
};
|
||||
|
||||
/// Konfiguration (Abschnitt `[tts]`). Enthält keine Geheimnisse.
|
||||
@ -115,6 +115,11 @@ fn models_from(json: &Value) -> Vec<DiscoveredArtifact> {
|
||||
|
||||
#[async_trait]
|
||||
impl Engine for StudioEngine {
|
||||
fn frontend(&self) -> Frontend {
|
||||
// Das Studio hat seine Oberfläche auf derselben Adresse wie die API.
|
||||
Frontend::Url(self.base().to_string())
|
||||
}
|
||||
|
||||
fn describe(&self) -> EngineInfo {
|
||||
EngineInfo {
|
||||
name: "tts".to_string(),
|
||||
|
||||
@ -32,6 +32,19 @@ pub struct Capabilities {
|
||||
pub speech: bool,
|
||||
}
|
||||
|
||||
/// Ob die Engine eine eigene Web-Oberfläche mitbringt (für das Symbol auf der Seite „Engines“).
|
||||
#[derive(Debug, Clone, Default, PartialEq, Eq)]
|
||||
pub enum Frontend {
|
||||
/// Keine bekannt (oder nicht geprüft).
|
||||
#[default]
|
||||
None,
|
||||
/// Die Engine bringt eine Oberfläche mit, sie läuft aber nur auf `127.0.0.1` mit wechselndem
|
||||
/// Port: erreichbar erst über eine Weiterleitung des Gateways (noch nicht gebaut, #1101).
|
||||
Managed,
|
||||
/// Die Oberfläche hat eine feste, direkt erreichbare Adresse.
|
||||
Url(String),
|
||||
}
|
||||
|
||||
/// Wie das Gateway eine Engine startet, zum Anzeigen in der Oberfläche. Enthält
|
||||
/// keine Geheimnisse und nichts, was das Gateway erst beim Start einsetzt
|
||||
/// (Port, Modellpfad), nur Platzhalter in spitzen Klammern.
|
||||
|
||||
Reference in New Issue
Block a user