2026-06-17 01:48:56 +02:00
|
|
|
from typing import Literal
|
|
|
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class EndpointCapabilities(BaseModel):
|
|
|
|
|
id: str
|
|
|
|
|
kind: str
|
|
|
|
|
direction: Literal["input", "output"]
|
|
|
|
|
sample_rate: int = 16000
|
|
|
|
|
channels: int = 1
|
|
|
|
|
latency_class: Literal["low", "medium", "high"] = "medium"
|
|
|
|
|
supports_aec: bool = False
|
|
|
|
|
supports_barge_in: bool = False
|
|
|
|
|
networked: bool = False
|
|
|
|
|
bluetooth: bool = False
|
|
|
|
|
mobile: bool = False
|
|
|
|
|
default: bool = False
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class AudioChunk(BaseModel):
|
|
|
|
|
data: bytes
|
|
|
|
|
sample_rate: int = 16000
|
|
|
|
|
channels: int = 1
|
|
|
|
|
format: str = "wav"
|
|
|
|
|
timestamp_ms: int = 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class PipelineTrace(BaseModel):
|
|
|
|
|
raw_transcript: str | None = None
|
|
|
|
|
cleaned_transcript: str | None = None
|
|
|
|
|
semantic_response: str | None = None
|
|
|
|
|
spoken_response: str | None = None
|
|
|
|
|
tts_ready_text: str | None = None
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class SpeakRequest(BaseModel):
|
|
|
|
|
text: str = Field(min_length=1)
|
|
|
|
|
voice: str | None = None
|
|
|
|
|
language: str | None = None
|
|
|
|
|
output_endpoint: str | None = None
|
|
|
|
|
tts_provider: str | None = None
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ChatRequest(BaseModel):
|
|
|
|
|
text: str = Field(min_length=1)
|
|
|
|
|
input_endpoint: str | None = None
|
|
|
|
|
output_endpoint: str | None = None
|
|
|
|
|
language: str | None = None
|
|
|
|
|
voice: str | None = None
|
|
|
|
|
stt_provider: str | None = None
|
|
|
|
|
llm_provider: str | None = None
|
|
|
|
|
tts_provider: str | None = None
|
feat: Geräte-TTS, native Stimmen, Favicon, Auth-Gate, UI-Fixes
Web-UI / TTS:
- Geräte-TTS ("📱 Gerät"): Antwort wird on-device vorgelesen (Web Speech
API), Server sendet nur Text (text_only) -> spart Bandbreite/Kosten.
Mobil-Default, geräte-lokale Speicherung, iOS-Autoplay-Freischaltung.
- Vorlese-Symbol (🔊) je Bubble: Hybrid-Replay (Assistent-PCM gecacht,
Eingabe via /api/speak); SVG-Icon mit kontrastreicher Farbe.
- Kombiniertes Sprachmenü (Flex + feste Sprachen) statt separatem Modus-Menü.
- "Neues Gespräch"-Button (frische Session gegen Sprach-Trägheit).
- Dark-Mode: lesbare <option>-Popups (Kontrast-Fix).
- Favicon (SVG + PNG-Fallbacks) aus mund.png.
TTS-Backend:
- Sprache wird an alle TTS-Provider durchgereicht; Piper-Stimme folgt der
Sprache; Chatterbox mehrsprachig + cross-lingual.
- Native Referenz-Stimmen je Sprache (config/voices/<lang>.wav, FLEURS CC-BY),
loudness-normalisiert.
LLM-Sprache:
- Antwort folgt zuverlässig der gewählten Sprache (verstärkte Anweisung +
Erinnerung an der letzten Nutzer-Nachricht gegen History-Trägheit).
Admin / Auth:
- Wörterbuch: alle 8 Sprachen, Zeilen editierbar, alphabetische Sortierung.
- Web-UI hinter Auth-Gate (Redirect auf SSO_LOGIN_URL / 401); Favicons offen.
- Log-Tab: Hinweis, wenn der systemd-Dienst nicht aktiv ist.
- Einstellungen: Hinweis "pro Nutzer überschreibbar" bei Sprache/Modus/Qualität.
Doku (BEDIENUNGSANLEITUNG.md): Geräte-TTS §6.5.0, Fix/Flex §6.6, native
Stimmen §6.5.3, llama.cpp<->Ollama-Wechsel §4.7, Auth/SSO §7.4.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-20 13:12:04 +02:00
|
|
|
text_only: bool | None = None # True -> kein Server-Audio (Geräte-TTS spricht selbst)
|
2026-06-17 01:48:56 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
class SessionRouteRequest(BaseModel):
|
|
|
|
|
input_endpoint: str | None = None
|
|
|
|
|
output_endpoint: str | None = None
|
|
|
|
|
stt_provider: str | None = None
|
|
|
|
|
llm_provider: str | None = None
|
|
|
|
|
tts_provider: str | None = None
|
|
|
|
|
language: str | None = None
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class RouteInfo(BaseModel):
|
|
|
|
|
input_endpoint: str
|
|
|
|
|
output_endpoint: str
|
|
|
|
|
stt_provider: str
|
|
|
|
|
llm_provider: str
|
|
|
|
|
tts_provider: str
|
|
|
|
|
language: str
|
|
|
|
|
|
2026-06-17 02:14:25 +02:00
|
|
|
|
|
|
|
|
class UserCreate(BaseModel):
|
|
|
|
|
display_name: str = Field(min_length=1)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class UserCreated(BaseModel):
|
|
|
|
|
user_id: str
|
|
|
|
|
display_name: str
|
|
|
|
|
token: str # nur bei Erstellung sichtbar
|
|
|
|
|
|
|
|
|
|
|
2026-06-18 17:55:05 +02:00
|
|
|
class UserUpdate(BaseModel):
|
|
|
|
|
display_name: str = Field(min_length=1)
|
|
|
|
|
|
|
|
|
|
|
2026-06-17 02:14:25 +02:00
|
|
|
class UserPrefs(BaseModel):
|
|
|
|
|
input_endpoint: str | None = None
|
|
|
|
|
output_endpoint: str | None = None
|
|
|
|
|
stt_provider: str | None = None
|
|
|
|
|
llm_provider: str | None = None
|
|
|
|
|
tts_provider: str | None = None
|
|
|
|
|
language: str | None = None
|
|
|
|
|
|
2026-06-17 04:26:55 +02:00
|
|
|
|
|
|
|
|
class MemoryCreate(BaseModel):
|
|
|
|
|
content: str = Field(min_length=1)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class MemoryOut(BaseModel):
|
|
|
|
|
id: int
|
|
|
|
|
content: str
|
|
|
|
|
created_at: str
|
|
|
|
|
|
2026-06-25 03:02:52 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
class EmergencyRequest(BaseModel):
|
|
|
|
|
"""Vom Nutzer ausgelöster Notruf (Knopf). language für den Hinweistext."""
|
|
|
|
|
language: str | None = None
|
2026-06-25 04:06:09 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
class AdminUserPrefsUpdate(BaseModel):
|
|
|
|
|
"""Admin setzt Nutzer-Einstellungen (z. B. erlaubte Sprachen, CSV: "de,en")."""
|
|
|
|
|
allowed_languages: str | None = None
|
2026-06-25 04:33:33 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
class UserAdminUpdate(BaseModel):
|
|
|
|
|
"""Admin schaltet Admin-Rechte für einen Nutzer ein/aus."""
|
|
|
|
|
is_admin: bool
|