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:
@@ -86,6 +86,8 @@ class GradiumSTTService(WebsocketSTTService):
|
||||
for audio processing and connection management.
|
||||
"""
|
||||
|
||||
_settings: GradiumSTTSettings
|
||||
|
||||
class InputParams(BaseModel):
|
||||
"""Configuration parameters for Gradium STT API.
|
||||
|
||||
@@ -145,7 +147,7 @@ class GradiumSTTService(WebsocketSTTService):
|
||||
|
||||
params = params or GradiumSTTService.InputParams()
|
||||
|
||||
self._settings: GradiumSTTSettings = GradiumSTTSettings(
|
||||
self._settings = GradiumSTTSettings(
|
||||
language=params.language,
|
||||
delay_in_frames=params.delay_in_frames if params.delay_in_frames else NOT_GIVEN,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user