diff --git a/src/pipecat/pipeline/task.py b/src/pipecat/pipeline/task.py index 185341b11..9ce3baf7f 100644 --- a/src/pipecat/pipeline/task.py +++ b/src/pipecat/pipeline/task.py @@ -130,9 +130,11 @@ class PipelineTask(BasePipelineTask): - on_pipeline_finished: Called after the pipeline has reached any terminal state. This includes: + - StopFrame: pipeline was stopped (processors keep connections open) - EndFrame: pipeline ended normally - CancelFrame: pipeline was cancelled + Use this event for cleanup, logging, or post-processing tasks. Users can inspect the frame if they need to handle specific cases. diff --git a/src/pipecat/runner/utils.py b/src/pipecat/runner/utils.py index 3466e9a6d..18fba79f5 100644 --- a/src/pipecat/runner/utils.py +++ b/src/pipecat/runner/utils.py @@ -99,29 +99,41 @@ async def parse_telephony_websocket(websocket: WebSocket): tuple: (transport_type: str, call_data: dict) call_data contains provider-specific fields: - - Twilio: { - "stream_id": str, - "call_id": str, - "body": dict - } - - Telnyx: { - "stream_id": str, - "call_control_id": str, - "outbound_encoding": str, - "from": str, - "to": str, - } - - Plivo: { - "stream_id": str, - "call_id": str, - } - - Exotel: { - "stream_id": str, - "call_id": str, - "account_sid": str, - "from": str, - "to": str, - } + + - Twilio:: + + { + "stream_id": str, + "call_id": str, + "body": dict + } + + - Telnyx:: + + { + "stream_id": str, + "call_control_id": str, + "outbound_encoding": str, + "from": str, + "to": str, + } + + - Plivo:: + + { + "stream_id": str, + "call_id": str, + } + + - Exotel:: + + { + "stream_id": str, + "call_id": str, + "account_sid": str, + "from": str, + "to": str, + } Example usage:: diff --git a/src/pipecat/services/deepgram/flux/stt.py b/src/pipecat/services/deepgram/flux/stt.py index e8d61261f..493bece80 100644 --- a/src/pipecat/services/deepgram/flux/stt.py +++ b/src/pipecat/services/deepgram/flux/stt.py @@ -79,7 +79,7 @@ class DeepgramFluxSTTService(WebsocketSTTService): This class defines all available connection parameters for the Deepgram Flux API based on the official documentation. - Attributes: + Parameters: eager_eot_threshold: Optional. EagerEndOfTurn/TurnResumed are off by default. You can turn them on by setting eager_eot_threshold to a valid value. Lower values = more aggressive EagerEndOfTurning (faster response, more LLM calls). @@ -126,24 +126,24 @@ class DeepgramFluxSTTService(WebsocketSTTService): If None, default parameters will be used. **kwargs: Additional arguments passed to the parent WebsocketSTTService class. - Example: - ```python - # Basic usage with default parameters - stt = DeepgramFluxSTTService(api_key="your-api-key") + Examples: + Basic usage with default parameters:: - # Advanced usage with custom parameters - params = DeepgramFluxSTTService.InputParams( - eager_eot_threshold=0.5, - eot_threshold=0.8, - keyterm=["AI", "machine learning", "neural network"], - tag=["production", "voice-agent"] - ) - stt = DeepgramFluxSTTService( - api_key="your-api-key", - model="flux-general-en", - params=params - ) - ``` + stt = DeepgramFluxSTTService(api_key="your-api-key") + + Advanced usage with custom parameters:: + + params = DeepgramFluxSTTService.InputParams( + eager_eot_threshold=0.5, + eot_threshold=0.8, + keyterm=["AI", "machine learning", "neural network"], + tag=["production", "voice-agent"] + ) + stt = DeepgramFluxSTTService( + api_key="your-api-key", + model="flux-general-en", + params=params + ) """ super().__init__(sample_rate=sample_rate, **kwargs) diff --git a/src/pipecat/transports/livekit/transport.py b/src/pipecat/transports/livekit/transport.py index f1b8d9088..62f74418f 100644 --- a/src/pipecat/transports/livekit/transport.py +++ b/src/pipecat/transports/livekit/transport.py @@ -354,10 +354,10 @@ class LiveKitTransportClient: logger.error(f"Error sending data: {e}") async def send_dtmf(self, digit: str): - """Send DTMF tone to the room. + r"""Send DTMF tone to the room. Args: - digit: The DTMF digit to send (0-9, *, #). + digit: The DTMF digit to send (0-9, \*, #). """ if not self._connected: return diff --git a/src/pipecat/utils/base_object.py b/src/pipecat/utils/base_object.py index f0744f3b8..4a62e5e4d 100644 --- a/src/pipecat/utils/base_object.py +++ b/src/pipecat/utils/base_object.py @@ -29,7 +29,7 @@ class EventHandler: This data class stores the event name, a list of handlers to run for this event, and whether these handlers will be executed in a task. - Attributes: + Parameters: name (str): The name of the event handler. handlers (List[Any]): A list of functions to be called when this event is triggered. is_sync (bool): Indicates whether the functions are executed in a task.