Skip to content

Commit

Permalink
fix ruff formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
aconchillo committed Jan 15, 2025
1 parent 4de192f commit 9dacbbb
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
4 changes: 1 addition & 3 deletions examples/foundational/06-listen-and-respond.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@ async def process_frame(self, frame: Frame, direction: FrameDirection):
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}")
Expand Down
2 changes: 1 addition & 1 deletion src/pipecat/services/cartesia.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ async def _receive_messages(self):
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}")

Expand Down
4 changes: 2 additions & 2 deletions src/pipecat/services/lmnt.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,10 @@ async def _receive_messages(self):
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}")
Expand Down
2 changes: 1 addition & 1 deletion src/pipecat/services/playht.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ async def _receive_messages(self):
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}")

Expand Down

0 comments on commit 9dacbbb

Please sign in to comment.