Skip to content

Commit

Permalink
Merge pull request #903 from pipecat-ai/mb/send-prebuilt-chat
Browse files Browse the repository at this point in the history
Add the ability to send_prebuilt_chat_message when using the DailyTra…
  • Loading branch information
markbackman authored Dec 22, 2024
2 parents 46871ae + 6c11753 commit 469c13c
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/pipecat/transports/services/daily.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,16 @@ async def stop_recording(self, stream_id):
self._client.stop_recording(stream_id, completion=completion_callback(future))
await future

async def send_prebuilt_chat_message(self, message: str, user_name: str | None = None):
if not self._joined:
return

future = self._loop.create_future()
self._client.send_prebuilt_chat_message(
message, user_name=user_name, completion=completion_callback(future)
)
await future

async def capture_participant_transcription(self, participant_id: str):
if not self._params.transcription_enabled:
return
Expand Down Expand Up @@ -985,6 +995,15 @@ async def start_recording(self, streaming_settings=None, stream_id=None, force_n
async def stop_recording(self, stream_id=None):
await self._client.stop_recording(stream_id)

async def send_prebuilt_chat_message(self, message: str, user_name: str | None = None):
"""Sends a chat message to Daily's Prebuilt main room.
Args:
message: The chat message to send
user_name: Optional user name that will appear as sender of the message
"""
await self._client.send_prebuilt_chat_message(message, user_name)

async def capture_participant_transcription(self, participant_id: str):
await self._client.capture_participant_transcription(participant_id)

Expand Down

0 comments on commit 469c13c

Please sign in to comment.