Fix Sphinx docstring RST formatting warnings

Replace Markdown code blocks with RST syntax in genesys.py, fix
deprecated directive transitions in nvidia and summarization modules,
remove stray bullet prefix in whisper arg docs, restructure code block
in turn completion mixin, and add deepgram mock to Sphinx conf.
This commit is contained in:
Mark Backman
2026-04-03 09:55:27 -04:00
parent 5490820338
commit f078b8b867
8 changed files with 24 additions and 19 deletions

View File

@@ -97,6 +97,8 @@ autodoc_mock_imports = [
"fastapi.middleware", "fastapi.middleware",
"fastapi.responses", "fastapi.responses",
"uvicorn", "uvicorn",
# Deepgram dependencies
"deepgram",
] ]
# HTML output settings # HTML output settings

View File

@@ -95,8 +95,8 @@ class GenesysAudioHookSerializer(FrameSerializer):
- Text WebSocket frames for JSON control messages - Text WebSocket frames for JSON control messages
- Binary WebSocket frames for audio data - Binary WebSocket frames for audio data
Example usage: Example usage::
```python
serializer = GenesysAudioHookSerializer( serializer = GenesysAudioHookSerializer(
params=GenesysAudioHookSerializer.InputParams( params=GenesysAudioHookSerializer.InputParams(
channel=AudioHookChannel.EXTERNAL, channel=AudioHookChannel.EXTERNAL,
@@ -122,7 +122,6 @@ class GenesysAudioHookSerializer(FrameSerializer):
# Set output variables to return to Architect # Set output variables to return to Architect
serializer.set_output_variables({"intent": "billing", "resolved": True}) serializer.set_output_variables({"intent": "billing", "resolved": True})
```
Attributes: Attributes:
PROTOCOL_VERSION: The AudioHook protocol version (currently "2"). PROTOCOL_VERSION: The AudioHook protocol version (currently "2").
@@ -246,8 +245,8 @@ class GenesysAudioHookSerializer(FrameSerializer):
Args: Args:
variables: Dictionary of custom variables to send to Genesys. variables: Dictionary of custom variables to send to Genesys.
Example: Example::
```python
# During the conversation, collect data and set it # During the conversation, collect data and set it
serializer.set_output_variables({ serializer.set_output_variables({
"intent": "billing_inquiry", "intent": "billing_inquiry",
@@ -255,7 +254,6 @@ class GenesysAudioHookSerializer(FrameSerializer):
"summary": "Customer asked about their bill", "summary": "Customer asked about their bill",
"transfer_to": "billing_queue" "transfer_to": "billing_queue"
}) })
```
""" """
self._output_variables = variables self._output_variables = variables
logger.debug(f"Output variables set: {variables}") logger.debug(f"Output variables set: {variables}")
@@ -413,8 +411,8 @@ class GenesysAudioHookSerializer(FrameSerializer):
Returns: Returns:
Dictionary of the closed response message. Dictionary of the closed response message.
Example: Example::
```python
# Pass custom data back to Genesys # Pass custom data back to Genesys
serializer.create_closed_response( serializer.create_closed_response(
output_variables={ output_variables={
@@ -423,7 +421,6 @@ class GenesysAudioHookSerializer(FrameSerializer):
"summary": "Customer asked about their bill" "summary": "Customer asked about their bill"
} }
) )
```
""" """
parameters: Optional[Dict[str, Any]] = None parameters: Optional[Dict[str, Any]] = None

View File

@@ -520,8 +520,7 @@ class GoogleTTSSettings(TTSSettings):
speaking_rate: float | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN) speaking_rate: float | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
#: .. deprecated:: 0.0.105 #: *Deprecated since 0.0.105:* Use ``GoogleTTSService.Settings`` instead.
#: Use ``GoogleTTSService.Settings`` instead.
GoogleStreamTTSSettings = GoogleTTSSettings GoogleStreamTTSSettings = GoogleTTSSettings

View File

@@ -269,7 +269,9 @@ class NvidiaSTTService(STTService):
.. deprecated:: 0.0.104 .. deprecated:: 0.0.104
Model cannot be changed after initialization for NVIDIA Riva streaming STT. Model cannot be changed after initialization for NVIDIA Riva streaming STT.
Set model and function id in the constructor instead, e.g.:: Set model and function id in the constructor instead.
Example::
NvidiaSTTService( NvidiaSTTService(
api_key=..., api_key=...,

View File

@@ -163,7 +163,9 @@ class NvidiaTTSService(TTSService):
.. deprecated:: 0.0.104 .. deprecated:: 0.0.104
Model cannot be changed after initialization for NVIDIA Riva TTS. Model cannot be changed after initialization for NVIDIA Riva TTS.
Set model and function id in the constructor instead, e.g.:: Set model and function id in the constructor instead.
Example::
NvidiaTTSService( NvidiaTTSService(
api_key=..., api_key=...,

View File

@@ -168,7 +168,7 @@ class BaseWhisperSTTService(SegmentedSTTService):
include_prob_metrics: If True, enables probability metrics in API response. include_prob_metrics: If True, enables probability metrics in API response.
Each service implements this differently (see child classes). Each service implements this differently (see child classes).
Defaults to False. Defaults to False.
push_empty_transcripts: - If true, allow empty `TranscriptionFrame` frames to be push_empty_transcripts: If true, allow empty `TranscriptionFrame` frames to be
pushed downstream instead of discarding them. This is intended for situations pushed downstream instead of discarding them. This is intended for situations
where VAD fires even though the user did not speak. In these cases, it is where VAD fires even though the user did not speak. In these cases, it is
useful to know that nothing was transcribed so that the agent can resume useful to know that nothing was transcribed so that the agent can resume

View File

@@ -191,9 +191,7 @@ class UserTurnCompletionLLMServiceMixin:
When incomplete timeouts expire, the mixin automatically prompts the LLM When incomplete timeouts expire, the mixin automatically prompts the LLM
with a contextual follow-up message to re-engage the user. with a contextual follow-up message to re-engage the user.
Usage: Usage example::
The LLM service controls when to use turn completion by calling
_push_turn_text instead of push_frame:
# With turn completion: # With turn completion:
if self._filter_incomplete_user_turns: if self._filter_incomplete_user_turns:
@@ -201,7 +199,10 @@ class UserTurnCompletionLLMServiceMixin:
else: else:
await self.push_frame(LLMTextFrame(chunk.text)) await self.push_frame(LLMTextFrame(chunk.text))
The mixin requires that the base class has a `push_frame` method compatible The LLM service controls when to use turn completion by calling
``_push_turn_text`` instead of ``push_frame``.
The mixin requires that the base class has a ``push_frame`` method compatible
with FrameProcessor's signature. with FrameProcessor's signature.
""" """

View File

@@ -168,7 +168,9 @@ class LLMContextSummarizationConfig:
.. deprecated:: 0.0.104 .. deprecated:: 0.0.104
Use :class:`LLMAutoContextSummarizationConfig` with a nested Use :class:`LLMAutoContextSummarizationConfig` with a nested
:class:`LLMContextSummaryConfig` instead:: :class:`LLMContextSummaryConfig` instead.
Example::
LLMAutoContextSummarizationConfig( LLMAutoContextSummarizationConfig(
max_context_tokens=8000, max_context_tokens=8000,