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.
This commit is contained in:
@@ -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.
|
||||
"""
|
||||
|
||||
@@ -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).
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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).
|
||||
|
||||
@@ -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)
|
||||
"""
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.
|
||||
"""
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user