Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the ability to send_prebuilt_chat_message when using the DailyTra… #903

Merged
merged 1 commit into from
Dec 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading