Add class-level _settings type annotations to all service classes for better editor support.
Standardize all STT, TTS, and LLM service classes to declare `_settings` with the narrowed Settings type as a class-level annotation. This gives editors and type checkers the specific type when hovering or autocompleting on `self._settings` in each service and its subclasses. Inline `self._settings: Type = ...` assignments are replaced with plain `self._settings = ...`.
This commit is contained in:
@@ -169,6 +169,8 @@ class OpenAIRealtimeSTTService(WebsocketSTTService):
|
||||
)
|
||||
"""
|
||||
|
||||
_settings: OpenAIRealtimeSTTSettings
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
@@ -231,7 +233,7 @@ class OpenAIRealtimeSTTService(WebsocketSTTService):
|
||||
self._noise_reduction = noise_reduction
|
||||
self._should_interrupt = should_interrupt
|
||||
|
||||
self._settings: OpenAIRealtimeSTTSettings = OpenAIRealtimeSTTSettings(
|
||||
self._settings = OpenAIRealtimeSTTSettings(
|
||||
model=model,
|
||||
language=language,
|
||||
prompt=prompt,
|
||||
|
||||
Reference in New Issue
Block a user