From 9dacbbbbf4fdf22be4d8a0b626ac5458fed440d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleix=20Conchillo=20Flaqu=C3=A9?= Date: Wed, 15 Jan 2025 13:02:13 -0800 Subject: [PATCH] fix ruff formatting --- examples/foundational/06-listen-and-respond.py | 4 +--- src/pipecat/services/cartesia.py | 2 +- src/pipecat/services/lmnt.py | 4 ++-- src/pipecat/services/playht.py | 2 +- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/examples/foundational/06-listen-and-respond.py b/examples/foundational/06-listen-and-respond.py index 67e76d143..58a763c09 100644 --- a/examples/foundational/06-listen-and-respond.py +++ b/examples/foundational/06-listen-and-respond.py @@ -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}") diff --git a/src/pipecat/services/cartesia.py b/src/pipecat/services/cartesia.py index 9712ce600..67a10b1cf 100644 --- a/src/pipecat/services/cartesia.py +++ b/src/pipecat/services/cartesia.py @@ -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}") diff --git a/src/pipecat/services/lmnt.py b/src/pipecat/services/lmnt.py index 633c24265..6f654293a 100644 --- a/src/pipecat/services/lmnt.py +++ b/src/pipecat/services/lmnt.py @@ -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}") diff --git a/src/pipecat/services/playht.py b/src/pipecat/services/playht.py index a511e2456..46b724a4d 100644 --- a/src/pipecat/services/playht.py +++ b/src/pipecat/services/playht.py @@ -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}")