fix ruff formatting

This commit is contained in:
Aleix Conchillo Flaqué
2025-01-15 13:02:13 -08:00
parent 4de192fbb0
commit 9dacbbbbf4
4 changed files with 5 additions and 7 deletions

View File

@@ -47,9 +47,7 @@ class MetricsLogger(FrameProcessor):
elif isinstance(d, LLMUsageMetricsData):
tokens = d.value
print(
f"!!! MetricsFrame: {frame}, tokens: {
tokens.prompt_tokens}, characters: {
tokens.completion_tokens}"
f"!!! MetricsFrame: {frame}, tokens: {tokens.prompt_tokens}, characters: {tokens.completion_tokens}"
)
elif isinstance(d, TTSUsageMetricsData):
print(f"!!! MetricsFrame: {frame}, characters: {d.value}")

View File

@@ -273,7 +273,7 @@ class CartesiaTTSService(WordTTSService, WebsocketService):
logger.error(f"{self} error: {msg}")
await self.push_frame(TTSStoppedFrame())
await self.stop_all_metrics()
await self.push_error(ErrorFrame(f'{self} error: {msg["error"]}'))
await self.push_error(ErrorFrame(f"{self} error: {msg['error']}"))
else:
logger.error(f"{self} error, unknown message type: {msg}")

View File

@@ -186,10 +186,10 @@ class LmntTTSService(TTSService, WebsocketService):
try:
msg = json.loads(message)
if "error" in msg:
logger.error(f'{self} error: {msg["error"]}')
logger.error(f"{self} error: {msg['error']}")
await self.push_frame(TTSStoppedFrame())
await self.stop_all_metrics()
await self.push_error(ErrorFrame(f'{self} error: {msg["error"]}'))
await self.push_error(ErrorFrame(f"{self} error: {msg['error']}"))
return
except json.JSONDecodeError:
logger.error(f"Invalid JSON message: {message}")

View File

@@ -269,7 +269,7 @@ class PlayHTTTSService(TTSService, WebsocketService):
self._request_id = None
elif "error" in msg:
logger.error(f"{self} error: {msg}")
await self.push_error(ErrorFrame(f'{self} error: {msg["error"]}'))
await self.push_error(ErrorFrame(f"{self} error: {msg['error']}"))
except json.JSONDecodeError:
logger.error(f"Invalid JSON message: {message}")