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:
@@ -92,6 +92,8 @@ class LmntTTSService(InterruptibleTTSService):
|
||||
language settings.
|
||||
"""
|
||||
|
||||
_settings: LmntTTSSettings
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
@@ -122,7 +124,7 @@ class LmntTTSService(InterruptibleTTSService):
|
||||
self._api_key = api_key
|
||||
self._voice_id = voice_id
|
||||
self.set_model_name(model)
|
||||
self._settings: LmntTTSSettings = LmntTTSSettings(
|
||||
self._settings = LmntTTSSettings(
|
||||
model=model,
|
||||
voice=voice_id,
|
||||
language=self.language_to_service_language(language),
|
||||
|
||||
Reference in New Issue
Block a user