Update AIService.set_model_name to AIService._sync_model_name_to_metrics to:

- indicate clearly that it's not meant for public use
- make it clear the `self._settings` is the single source of truth for model information
- set the stage for an upcoming change where `AIService` subclasses won't have to ever worry about explicitly calling an `AIService` method to sync model name to metrics

Across all services, switch from accessing `self._model_name` or `self.model_name` in favor of `self._settings.model`.
This commit is contained in:
Paul Kompfner
2026-02-20 11:42:24 -05:00
parent f5b86d9cdc
commit 29e2a861dc
54 changed files with 173 additions and 177 deletions

View File

@@ -122,13 +122,13 @@ class LmntTTSService(InterruptibleTTSService):
)
self._api_key = api_key
self.set_model_name(model)
self._settings = LmntTTSSettings(
model=model,
voice=voice_id,
language=self.language_to_service_language(language),
format="raw",
)
self._sync_model_name_to_metrics()
self._receive_task = None
self._context_id: Optional[str] = None
@@ -238,7 +238,7 @@ class LmntTTSService(InterruptibleTTSService):
"format": self._settings.format,
"sample_rate": self.sample_rate,
"language": self._settings.language,
"model": self.model_name,
"model": self._settings.model,
}
# Connect to LMNT's websocket directly