# Datenmodelle **Revision:** r2 **Source:** CLAUDE.md, Code-Analyse **Last updated:** 2026-04-10 14:00 --- ## Konfigurationsstrukturen ### ServerConfig ```python @dataclass class ServerConfig: network: NetworkConfig security: SecurityConfig audio: AudioConfig wakeword: WakewordConfig voice_recognition: VoiceRecognitionConfig conversation: ConversationConfig plugins: PluginConfig logging: LoggingConfig satellites_directory: str = "satellites" assets_directory: str = "assets" models_directory: str = "models" profile: str = "default" ``` ### NetworkConfig ```python @dataclass class NetworkConfig: command_port: int = 2101 audio_input_port: int = 2102 audio_output_port: int = 2103 music_port: int = 2104 bind_address: str = "0.0.0.0" max_connections: int = 100 ``` ### ClientConfig (Auszug aus client_config.json) ```python @dataclass class ClientConfig: server: ServerConnectionConfig # host, port, timeouts audio: ClientAudioConfig # sample_rate, channels, bit_depth, volume, mute, devices wakeword: ClientWakewordConfig # models, threshold, directory identity: SatelliteIdentityConfig # room, alias, MAC logging: ClientLoggingConfig assets_directory: str = "assets" profile: str = "default" ``` **Audio-relevante Felder in client_config.json:** - `output_volume`: 80, `output_muted`: false - `input_volume`: 80, `input_muted`: false - `output_combine_sink_name`: "trixy_combined" - `input_mix_sink_name`: "trixy_mics_combined" - `config_listener_enabled`: false ### InstallerConfig (make_installer) ```python @dataclass class InstallerConfig: # Modus mode: str = "server" # server, client, standalone version: str = "1.0.0" source_archive: str = "" # System (F1) hostname: str = "trixyone" username: str = "pi" install_path: str = "/home/pi/trixy" autostart: bool = True install_service: bool = True auto_regist: bool = True # Server WiFi-Hotspot (F2) wifi_enabled: bool = True wifi_ssid: str = "trixyone_srv" wifi_password: str = "trixy2026!" wifi_channel: int = 6 ap_ip: str = "10.10.10.1" dhcp_range_start: str = "10.10.10.10" dhcp_range_end: str = "10.10.10.50" # Client/Standalone WLAN (F2) wifi_connect: bool = False wifi_connect_ssid: str = "" wifi_connect_password: str = "" wifi_fallback_enabled: bool = False wifi_fallback_ssid: str = "" wifi_fallback_password: str = "" wifi_auto_switchback: bool = True wifi_switchback_interval: int = 30 # Client Server-Verbindung (F2) server_host: str = "10.10.10.1" server_port: int = 2101 room: str = "" alias: str = "" # Plugins (F3) selected_plugins: list[str] nlp_backend: str = "llama_cpp" ollama_host: str = "http://localhost:11434" download_models: bool = False # Vereinbarung (F5) agreement_accepted: bool = False ``` ### TrainerConfig ```python @dataclass class TrainerConfig: wakeword: WakewordTrainerConfig voice_recognition: VoiceRecognitionTrainerConfig audio_processing: AudioProcessingConfig data: DataConfig output: OutputConfig device: str = "auto" # auto, cpu, cuda, mps num_workers: int = 4 seed: int = 42 ``` ## Trainer Datenmodelle ### TrainerInfo ```python @dataclass class TrainerInfo: trainer_id: str name: str description: str version: str author: str model_type: str # z.B. "wakeword", "intent" trainer_type: str # z.B. "core", "plugin" ``` ### TrainingProgress ```python @dataclass class TrainingProgress: state: str # idle, training, paused, completed, failed epoch: int total_epochs: int loss: float accuracy: float vram_usage: float eta_seconds: float history: list[dict] # Loss/Accuracy pro Epoch ``` ## Event-Daten ### EventData (Basis) ```python @dataclass class EventData: event_id: str # UUID timestamp: datetime source: str # Quelle (z.B. Service-Name) cancelled: bool metadata: dict[str, Any] def cancel() -> None def is_cancelled() -> bool @classmethod def event_name() -> str # Klassenname in snake_case ``` ### Wichtige Event-Daten | Klasse | Felder | |--------|--------| | WakewordReceived | satellite_id, wakeword_model, confidence, audio_level | | SpeechRecognized | satellite_id, text, confidence, language, alternatives | | IntentReceived | satellite_id, intent, confidence, slots, original_text | | RawAudioInputReceived | satellite_id, audio_data, sample_rate, duration_seconds | ## Satellite-Daten ```python class Satellite: id: str room_id: str mac_address: str alias: str ip_address: str state: ConnectionState # DISCONNECTED, CONNECTING, CONNECTED, AUTHENTICATED conversation_id: str | None connected_at: datetime | None last_heartbeat: datetime | None version: str ``` --- **See also:** [apis.md](apis.md), [integrations.md](integrations.md)