Fixing ruff format.

This commit is contained in:
Filipi Fuchter
2025-11-19 15:56:39 -03:00
parent c1a1d40f9a
commit 4b11bcb4a4
4 changed files with 13 additions and 4 deletions

View File

@@ -801,7 +801,10 @@ class FrameProcessor(BaseObject):
await self.__cancel_process_task() await self.__cancel_process_task()
self.__create_process_task() self.__create_process_task()
except Exception as e: except Exception as e:
await self.push_error(error_msg=f"Uncaught exception in {self} when handling _start_interruption: {e}", exception=e) await self.push_error(
error_msg=f"Uncaught exception in {self} when handling _start_interruption: {e}",
exception=e,
)
async def __internal_push_frame(self, frame: Frame, direction: FrameDirection): async def __internal_push_frame(self, frame: Frame, direction: FrameDirection):
"""Internal method to push frames to adjacent processors. """Internal method to push frames to adjacent processors.

View File

@@ -151,7 +151,9 @@ class AzureSTTService(STTService):
self._speech_recognizer.recognized.connect(self._on_handle_recognized) self._speech_recognizer.recognized.connect(self._on_handle_recognized)
self._speech_recognizer.start_continuous_recognition_async() self._speech_recognizer.start_continuous_recognition_async()
except Exception as e: except Exception as e:
await self.push_error(error_msg=f"{self} exception during initialization: {e}", exception=e) await self.push_error(
error_msg=f"{self} exception during initialization: {e}", exception=e
)
async def stop(self, frame: EndFrame): async def stop(self, frame: EndFrame):
"""Stop the speech recognition service. """Stop the speech recognition service.

View File

@@ -645,7 +645,9 @@ class ElevenLabsRealtimeSTTService(WebsocketSTTService):
await self._call_event_handler("on_connected") await self._call_event_handler("on_connected")
logger.debug("Connected to ElevenLabs Realtime STT") logger.debug("Connected to ElevenLabs Realtime STT")
except Exception as e: except Exception as e:
await self.push_error(error_msg=f"{self}: unable to connect to ElevenLabs Realtime STT: {e}", exception=e) await self.push_error(
error_msg=f"{self}: unable to connect to ElevenLabs Realtime STT: {e}", exception=e
)
async def _disconnect_websocket(self): async def _disconnect_websocket(self):
"""Disconnect from ElevenLabs Realtime STT WebSocket.""" """Disconnect from ElevenLabs Realtime STT WebSocket."""

View File

@@ -403,7 +403,9 @@ class SonioxSTTService(STTService):
if error_code or error_message: if error_code or error_message:
# In case of error, still send the final transcript (if any remaining in the buffer). # In case of error, still send the final transcript (if any remaining in the buffer).
await send_endpoint_transcript() await send_endpoint_transcript()
await self.push_error(error_msg=f"{self} error: {error_code} (_receive_task_handler) - {error_message}") await self.push_error(
error_msg=f"{self} error: {error_code} (_receive_task_handler) - {error_message}"
)
finished = content.get("finished") finished = content.get("finished")
if finished: if finished: