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:
@@ -68,7 +68,7 @@ def language_to_gradium_language(language: Language) -> Optional[str]:
|
||||
|
||||
@dataclass
|
||||
class GradiumSTTSettings(STTSettings):
|
||||
"""Typed settings for the Gradium STT service.
|
||||
"""Settings for the Gradium STT service.
|
||||
|
||||
Parameters:
|
||||
delay_in_frames: Delay in audio frames (80ms each) before text is
|
||||
@@ -171,8 +171,8 @@ class GradiumSTTService(WebsocketSTTService):
|
||||
"""
|
||||
return True
|
||||
|
||||
async def _update_settings_from_typed(self, update: STTSettings) -> set[str]:
|
||||
"""Apply a typed settings update, sync params, and reconnect.
|
||||
async def _update_settings(self, update: STTSettings) -> set[str]:
|
||||
"""Apply a settings update, sync params, and reconnect.
|
||||
|
||||
Args:
|
||||
update: A :class:`STTSettings` (or ``GradiumSTTSettings``) delta.
|
||||
@@ -180,7 +180,7 @@ class GradiumSTTService(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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user