From c2358b273be254d5d8ecef2d769c04c982b73e28 Mon Sep 17 00:00:00 2001 From: Mark Backman Date: Fri, 3 Apr 2026 10:36:36 -0400 Subject: [PATCH] Use Parameters instead of Attributes in docstrings to fix duplicate object warnings Napoleon's Attributes section creates class-level attribute docs that duplicate the __init__ parameter docs when napoleon_include_init_with_doc is enabled. Using Parameters avoids the duplication. --- .../turn-management/turn-management-user-assistant-turns.py | 2 +- src/pipecat/adapters/services/grok_realtime_adapter.py | 2 +- src/pipecat/pipeline/sync_parallel_pipeline.py | 2 +- src/pipecat/serializers/genesys.py | 4 ++-- src/pipecat/services/heygen/client.py | 2 +- src/pipecat/services/sarvam/stt.py | 2 +- src/pipecat/services/sarvam/tts.py | 4 ++-- src/pipecat/services/tts_service.py | 2 +- src/pipecat/transports/whatsapp/client.py | 2 +- src/pipecat/turns/types.py | 2 +- src/pipecat/turns/user_start/base_user_turn_start_strategy.py | 2 +- src/pipecat/turns/user_stop/base_user_turn_stop_strategy.py | 2 +- src/pipecat/turns/user_turn_completion_mixin.py | 2 +- src/pipecat/turns/user_turn_strategies.py | 2 +- 14 files changed, 16 insertions(+), 16 deletions(-) diff --git a/examples/turn-management/turn-management-user-assistant-turns.py b/examples/turn-management/turn-management-user-assistant-turns.py index ff8305087..afc45423b 100644 --- a/examples/turn-management/turn-management-user-assistant-turns.py +++ b/examples/turn-management/turn-management-user-assistant-turns.py @@ -40,7 +40,7 @@ class TranscriptHandler: Maintains a list of conversation messages and outputs them either to a log or to a file as they are received. Each message includes its timestamp and role. - Attributes: + Parameters: messages: List of all processed transcript messages output_file: Optional path to file where transcript is saved. If None, outputs to log only. """ diff --git a/src/pipecat/adapters/services/grok_realtime_adapter.py b/src/pipecat/adapters/services/grok_realtime_adapter.py index eadd4fdfb..2017013be 100644 --- a/src/pipecat/adapters/services/grok_realtime_adapter.py +++ b/src/pipecat/adapters/services/grok_realtime_adapter.py @@ -27,7 +27,7 @@ from pipecat.services.xai.realtime import events class GrokRealtimeLLMInvocationParams(TypedDict): """Context-based parameters for invoking Grok Realtime API. - Attributes: + Parameters: system_instruction: System prompt/instructions for the session. messages: List of conversation items formatted for Grok Realtime. tools: List of tool definitions (function, web_search, x_search, file_search). diff --git a/src/pipecat/pipeline/sync_parallel_pipeline.py b/src/pipecat/pipeline/sync_parallel_pipeline.py index 4463b8a22..74cfdfdb9 100644 --- a/src/pipecat/pipeline/sync_parallel_pipeline.py +++ b/src/pipecat/pipeline/sync_parallel_pipeline.py @@ -36,7 +36,7 @@ class FrameOrder(Enum): When multiple parallel pipelines produce output for the same input frame, this setting determines the order in which those output frames are pushed. - Attributes: + Parameters: ARRIVAL: Frames are pushed in the order they arrive from any pipeline. This is the default and matches the behavior of prior versions. PIPELINE: Frames are pushed in pipeline definition order — all frames diff --git a/src/pipecat/serializers/genesys.py b/src/pipecat/serializers/genesys.py index ceb7724be..0cfdba22b 100644 --- a/src/pipecat/serializers/genesys.py +++ b/src/pipecat/serializers/genesys.py @@ -123,7 +123,7 @@ class GenesysAudioHookSerializer(FrameSerializer): # Set output variables to return to Architect serializer.set_output_variables({"intent": "billing", "resolved": True}) - Attributes: + Parameters: PROTOCOL_VERSION: The AudioHook protocol version (currently "2"). """ @@ -132,7 +132,7 @@ class GenesysAudioHookSerializer(FrameSerializer): class InputParams(FrameSerializer.InputParams): """Configuration parameters for GenesysAudioHookSerializer. - Attributes: + Parameters: genesys_sample_rate: Sample rate used by Genesys (default: 8000 Hz). sample_rate: Optional override for pipeline input sample rate. channel: Which audio channels to process (external, internal, both). diff --git a/src/pipecat/services/heygen/client.py b/src/pipecat/services/heygen/client.py index 6d45d6114..7f99502b6 100644 --- a/src/pipecat/services/heygen/client.py +++ b/src/pipecat/services/heygen/client.py @@ -83,7 +83,7 @@ class HeyGenClient: 1. WebSocket connection for avatar control and audio streaming 2. LiveKit connection for receiving avatar video and audio - Attributes: + Parameters: HEY_GEN_SAMPLE_RATE (int): The required sample rate for HeyGen's audio processing (24000 Hz) """ diff --git a/src/pipecat/services/sarvam/stt.py b/src/pipecat/services/sarvam/stt.py index 8d0a38810..7271a3e5c 100644 --- a/src/pipecat/services/sarvam/stt.py +++ b/src/pipecat/services/sarvam/stt.py @@ -86,7 +86,7 @@ def language_to_sarvam_language(language: Language) -> str: class ModelConfig: """Immutable configuration for a Sarvam STT model. - Attributes: + Parameters: supports_prompt: Whether the model accepts prompt parameter. supports_mode: Whether the model accepts mode parameter. supports_language: Whether the model accepts language parameter. diff --git a/src/pipecat/services/sarvam/tts.py b/src/pipecat/services/sarvam/tts.py index 9f768d0a1..bdb032733 100644 --- a/src/pipecat/services/sarvam/tts.py +++ b/src/pipecat/services/sarvam/tts.py @@ -75,7 +75,7 @@ except ModuleNotFoundError as e: class SarvamTTSModel(str, Enum): """Available Sarvam TTS models. - Attributes: + Parameters: BULBUL_V2: Standard TTS model with pitch/loudness control. - Supports pitch, loudness, pace (0.3-3.0) - Default sample rate: 22050 Hz @@ -145,7 +145,7 @@ class SarvamTTSSpeakerV3(str, Enum): class TTSModelConfig: """Immutable configuration for a Sarvam TTS model. - Attributes: + Parameters: supports_pitch: Whether the model accepts pitch parameter. supports_loudness: Whether the model accepts loudness parameter. supports_temperature: Whether the model accepts temperature parameter. diff --git a/src/pipecat/services/tts_service.py b/src/pipecat/services/tts_service.py index 034e2fcd4..86a3b91a6 100644 --- a/src/pipecat/services/tts_service.py +++ b/src/pipecat/services/tts_service.py @@ -67,7 +67,7 @@ from pipecat.utils.time import seconds_to_nanoseconds class TTSContext: """Context information for a TTS request. - Attributes: + Parameters: append_to_context: Whether this TTS output should be appended to the conversation context after it is spoken. push_assistant_aggregation: Whether to push an diff --git a/src/pipecat/transports/whatsapp/client.py b/src/pipecat/transports/whatsapp/client.py index f22c29655..f2ed1f00d 100644 --- a/src/pipecat/transports/whatsapp/client.py +++ b/src/pipecat/transports/whatsapp/client.py @@ -37,7 +37,7 @@ class WhatsAppClient: events from WhatsApp, and maintains ongoing call state. It supports both incoming call handling and call termination through the WhatsApp Cloud API. - Attributes: + Parameters: _whatsapp_api: WhatsApp API instance for making API calls _ongoing_calls_map: Dictionary mapping call IDs to WebRTC connections _ice_servers: List of ICE servers for WebRTC connections diff --git a/src/pipecat/turns/types.py b/src/pipecat/turns/types.py index 5ebdf20a3..e73f2c486 100644 --- a/src/pipecat/turns/types.py +++ b/src/pipecat/turns/types.py @@ -15,7 +15,7 @@ class ProcessFrameResult(Enum): Controls whether the strategy loop in the controller continues to the next strategy or stops early. - Attributes: + Parameters: CONTINUE: Continue to the next strategy in the loop. STOP: Stop evaluating further strategies for this frame. """ diff --git a/src/pipecat/turns/user_start/base_user_turn_start_strategy.py b/src/pipecat/turns/user_start/base_user_turn_start_strategy.py index fd928a8a7..94b4f635d 100644 --- a/src/pipecat/turns/user_start/base_user_turn_start_strategy.py +++ b/src/pipecat/turns/user_start/base_user_turn_start_strategy.py @@ -24,7 +24,7 @@ class UserTurnStartedParams: contextual information about how the user turn should be handled by the user aggregator. - Attributes: + Parameters: enable_user_speaking_frames: Whether the user aggregator should emit frames indicating user speaking state (e.g., user started speaking) during the bot's turn. This is typically enabled by default, but may diff --git a/src/pipecat/turns/user_stop/base_user_turn_stop_strategy.py b/src/pipecat/turns/user_stop/base_user_turn_stop_strategy.py index 7c493475e..a6f89ae4b 100644 --- a/src/pipecat/turns/user_stop/base_user_turn_stop_strategy.py +++ b/src/pipecat/turns/user_stop/base_user_turn_stop_strategy.py @@ -24,7 +24,7 @@ class UserTurnStoppedParams: contextual information about how the end of user turn should be handled by the user aggregator. - Attributes: + Parameters: enable_user_speaking_frames: Whether the user aggregator should emit frames indicating user speaking state (e.g., user stopped speaking). This is typically enabled by default, but may be disabled when another diff --git a/src/pipecat/turns/user_turn_completion_mixin.py b/src/pipecat/turns/user_turn_completion_mixin.py index d527407b9..c99355de7 100644 --- a/src/pipecat/turns/user_turn_completion_mixin.py +++ b/src/pipecat/turns/user_turn_completion_mixin.py @@ -147,7 +147,7 @@ Remember: Focus on conversational completeness and how long the user might need. class UserTurnCompletionConfig: """Configuration for turn completion behavior. - Attributes: + Parameters: instructions: Custom instructions for turn completion. If not provided, uses default USER_TURN_COMPLETION_INSTRUCTIONS. incomplete_short_timeout: Seconds to wait after short incomplete (○) before prompting. diff --git a/src/pipecat/turns/user_turn_strategies.py b/src/pipecat/turns/user_turn_strategies.py index 5789c6328..d1abfeac5 100644 --- a/src/pipecat/turns/user_turn_strategies.py +++ b/src/pipecat/turns/user_turn_strategies.py @@ -57,7 +57,7 @@ class UserTurnStrategies: start: [VADUserTurnStartStrategy, TranscriptionUserTurnStartStrategy] stop: [TurnAnalyzerUserTurnStopStrategy(LocalSmartTurnAnalyzerV3)] - Attributes: + Parameters: start: A list of user turn start strategies used to detect when the user starts speaking. stop: A list of user turn stop strategies used to decide when