Fixing ruff format.
This commit is contained in:
@@ -2,7 +2,6 @@ import array
|
|||||||
import asyncio
|
import asyncio
|
||||||
import os
|
import os
|
||||||
import signal
|
import signal
|
||||||
import time
|
|
||||||
|
|
||||||
from daily import (
|
from daily import (
|
||||||
AudioData,
|
AudioData,
|
||||||
@@ -53,7 +52,6 @@ class DailyProxyApp(EventHandler):
|
|||||||
# Raw PCM buffer — filled at DECLARED_SAMPLE_RATE speed, drained at TRUE_SAMPLE_RATE speed.
|
# Raw PCM buffer — filled at DECLARED_SAMPLE_RATE speed, drained at TRUE_SAMPLE_RATE speed.
|
||||||
self._buffer = bytearray()
|
self._buffer = bytearray()
|
||||||
self._audio_task: asyncio.Task | None = None
|
self._audio_task: asyncio.Task | None = None
|
||||||
self._receive_start_time: float | None = None
|
|
||||||
|
|
||||||
self._client: CallClient = CallClient(event_handler=self)
|
self._client: CallClient = CallClient(event_handler=self)
|
||||||
self._client.update_subscription_profiles(
|
self._client.update_subscription_profiles(
|
||||||
@@ -173,9 +171,6 @@ class DailyProxyApp(EventHandler):
|
|||||||
if self._is_silence(new_bytes):
|
if self._is_silence(new_bytes):
|
||||||
return
|
return
|
||||||
|
|
||||||
if self._receive_start_time is None:
|
|
||||||
self._receive_start_time = time.monotonic()
|
|
||||||
|
|
||||||
self._buffer.extend(new_bytes)
|
self._buffer.extend(new_bytes)
|
||||||
|
|
||||||
def _audio_data_received(self, participant_id: str, audio_data: AudioData, audio_source: str):
|
def _audio_data_received(self, participant_id: str, audio_data: AudioData, audio_source: str):
|
||||||
|
|||||||
@@ -75,9 +75,7 @@ class TavusApi:
|
|||||||
# Only for development
|
# Only for development
|
||||||
self._dev_room_url = os.getenv("TAVUS_SAMPLE_ROOM_URL")
|
self._dev_room_url = os.getenv("TAVUS_SAMPLE_ROOM_URL")
|
||||||
|
|
||||||
async def create_conversation(
|
async def create_conversation(self, replica_id: str, persona_id: str, sample_rate: int) -> dict:
|
||||||
self, replica_id: str, persona_id: str, sample_rate: int
|
|
||||||
) -> dict:
|
|
||||||
"""Create a new conversation with the specified replica and persona.
|
"""Create a new conversation with the specified replica and persona.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
@@ -251,15 +249,11 @@ class TavusTransportClient:
|
|||||||
on_participant_joined=self._callbacks.on_participant_joined,
|
on_participant_joined=self._callbacks.on_participant_joined,
|
||||||
on_participant_left=self._callbacks.on_participant_left,
|
on_participant_left=self._callbacks.on_participant_left,
|
||||||
on_participant_updated=partial(self._on_handle_callback, "on_participant_updated"),
|
on_participant_updated=partial(self._on_handle_callback, "on_participant_updated"),
|
||||||
on_transcription_message=partial(
|
on_transcription_message=partial(self._on_handle_callback, "on_transcription_message"),
|
||||||
self._on_handle_callback, "on_transcription_message"
|
|
||||||
),
|
|
||||||
on_recording_started=partial(self._on_handle_callback, "on_recording_started"),
|
on_recording_started=partial(self._on_handle_callback, "on_recording_started"),
|
||||||
on_recording_stopped=partial(self._on_handle_callback, "on_recording_stopped"),
|
on_recording_stopped=partial(self._on_handle_callback, "on_recording_stopped"),
|
||||||
on_recording_error=partial(self._on_handle_callback, "on_recording_error"),
|
on_recording_error=partial(self._on_handle_callback, "on_recording_error"),
|
||||||
on_transcription_stopped=partial(
|
on_transcription_stopped=partial(self._on_handle_callback, "on_transcription_stopped"),
|
||||||
self._on_handle_callback, "on_transcription_stopped"
|
|
||||||
),
|
|
||||||
on_transcription_error=partial(self._on_handle_callback, "on_transcription_error"),
|
on_transcription_error=partial(self._on_handle_callback, "on_transcription_error"),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user