Skip to content

Commit

Permalink
Format emitter.py
Browse files Browse the repository at this point in the history
Trying to commit this locally fails because the pre-commit trigger changes to imports that then fail I001.
  • Loading branch information
jfperusse-bhvr authored Nov 12, 2024
1 parent d69ea3e commit 2d6a189
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions backend/chainlit/emitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ async def resume_thread(self, thread_dict: ThreadDict):
async def send_element(self, element_dict: ElementDict):
"""Stub method to send an element to the UI."""
pass

async def update_audio_connection(self, state: Literal["on", "off"]):
"""Audio connection signaling."""
pass

async def send_audio_chunk(self, chunk: OutputAudioChunk):
"""Stub method to send an audio chunk to the UI."""
pass

async def send_audio_interrupt(self):
"""Stub method to interrupt the current audio response."""
pass
Expand Down Expand Up @@ -138,6 +138,7 @@ async def send_window_message(self, data: Any):
"""Stub method to send custom data to the host window."""
pass


class ChainlitEmitter(BaseChainlitEmitter):
"""
Chainlit Emitter class. The Emitter is not directly exposed to the developer.
Expand Down Expand Up @@ -181,7 +182,7 @@ async def update_audio_connection(self, state: Literal["on", "off"]):
async def send_audio_chunk(self, chunk: OutputAudioChunk):
"""Send an audio chunk to the UI."""
await self.emit("audio_chunk", chunk)

async def send_audio_interrupt(self):
"""Method to interrupt the current audio response."""
await self.emit("audio_interrupt", {})
Expand Down

0 comments on commit 2d6a189

Please sign in to comment.