Remove typed-settings migration scaffolding and rename _update_settings_from_typed to _update_settings.

Now that all services use typed `ServiceSettings` objects, this removes the interim scaffolding that supported both dict-based and typed settings paths in parallel. Specifically: removes old dict-based `_update_settings(settings: Mapping)` methods from base classes, removes `isinstance(self._settings, ServiceSettings)` guards, simplifies `process_frame` branching, and renames `_update_settings_from_typed` to `_update_settings` across all ~30 service implementations. Also renames the no-arg `_update_settings()` helper on realtime services to `_send_session_update()` to avoid collision, adds `from_mapping` overrides on `GoogleLLMSettings` and `AnthropicLLMSettings` for ThinkingConfig dict-to-object conversion, and replaces a broken no-arg `_update_settings()` call in Gemini Live with a TODO.
This commit is contained in:
Paul Kompfner
2026-02-13 14:30:49 -05:00
parent ab92a0e1d7
commit b08548af9d
57 changed files with 291 additions and 407 deletions

View File

@@ -127,7 +127,7 @@ _OPENAI_SAMPLE_RATE = 24000
@dataclass
class OpenAIRealtimeSTTSettings(STTSettings):
"""Typed settings for the OpenAI Realtime STT service.
"""Settings for the OpenAI Realtime STT service.
Parameters:
prompt: Optional prompt text to guide transcription style.
@@ -268,10 +268,10 @@ class OpenAIRealtimeSTTService(WebsocketSTTService):
"""
return True
async def _update_settings_from_typed(self, update: STTSettings) -> set[str]:
"""Apply a typed settings update and send session update if needed.
async def _update_settings(self, update: STTSettings) -> set[str]:
"""Apply a settings update and send session update if needed.
Keeps ``_language_code`` and ``_prompt`` in sync with typed settings
Keeps ``_language_code`` and ``_prompt`` in sync with settings
and sends a ``session.update`` to the server when the session is active.
Args:
@@ -280,7 +280,7 @@ class OpenAIRealtimeSTTService(WebsocketSTTService):
Returns:
Set of field names whose values actually changed.
"""
changed = await super()._update_settings_from_typed(update)
changed = await super()._update_settings(update)
if not changed:
return changed