Fix docstrings for 0.0.93 release, fix classmethod placement in RequestHandler

This commit is contained in:
Mark Backman
2025-11-05 15:27:16 -05:00
parent 11b101e8a6
commit e2f6ce1078
7 changed files with 59 additions and 61 deletions

View File

@@ -11,11 +11,11 @@ including conversation history management and role-specific message processing.
.. deprecated:: 0.0.91 .. deprecated:: 0.0.91
AWS Nova Sonic no longer uses types from this module under the hood. AWS Nova Sonic no longer uses types from this module under the hood.
It now uses `LLMContext` and `LLMContextAggregatorPair`. It now uses ``LLMContext`` and ``LLMContextAggregatorPair``.
Using the new patterns should allow you to not need types from this module. Using the new patterns should allow you to not need types from this module.
BEFORE: BEFORE::
```
# Setup # Setup
context = OpenAILLMContext(messages, tools) context = OpenAILLMContext(messages, tools)
context_aggregator = llm.create_context_aggregator(context) context_aggregator = llm.create_context_aggregator(context)
@@ -27,10 +27,9 @@ including conversation history management and role-specific message processing.
context: AWSNovaSonicLLMContext context: AWSNovaSonicLLMContext
# or # or
context: OpenAILLMContext context: OpenAILLMContext
```
AFTER: AFTER::
```
# Setup # Setup
context = LLMContext(messages, tools) context = LLMContext(messages, tools)
context_aggregator = LLMContextAggregatorPair(context) context_aggregator = LLMContextAggregatorPair(context)
@@ -40,7 +39,6 @@ including conversation history management and role-specific message processing.
# Context type # Context type
context: LLMContext context: LLMContext
```
""" """
import warnings import warnings

View File

@@ -1163,7 +1163,8 @@ class AWSNovaSonicLLMService(LLMService):
"""Create context aggregator pair for managing conversation context. """Create context aggregator pair for managing conversation context.
NOTE: this method exists only for backward compatibility. New code NOTE: this method exists only for backward compatibility. New code
should instead do: should instead do::
context = LLMContext(...) context = LLMContext(...)
context_aggregator = LLMContextAggregatorPair(context) context_aggregator = LLMContextAggregatorPair(context)

View File

@@ -1742,7 +1742,8 @@ class GeminiLiveLLMService(LLMService):
Constructor keyword arguments for both the user and assistant aggregators can be provided. Constructor keyword arguments for both the user and assistant aggregators can be provided.
NOTE: this method exists only for backward compatibility. New code NOTE: this method exists only for backward compatibility. New code
should instead do: should instead do::
context = LLMContext(...) context = LLMContext(...)
context_aggregator = LLMContextAggregatorPair(context) context_aggregator = LLMContextAggregatorPair(context)

View File

@@ -8,11 +8,11 @@
.. deprecated:: 0.0.92 .. deprecated:: 0.0.92
OpenAI Realtime no longer uses types from this module under the hood. OpenAI Realtime no longer uses types from this module under the hood.
It now uses `LLMContext` and `LLMContextAggregatorPair`. It now uses ``LLMContext`` and ``LLMContextAggregatorPair``.
Using the new patterns should allow you to not need types from this module. Using the new patterns should allow you to not need types from this module.
BEFORE: BEFORE::
```
# Setup # Setup
context = OpenAILLMContext(messages, tools) context = OpenAILLMContext(messages, tools)
context_aggregator = llm.create_context_aggregator(context) context_aggregator = llm.create_context_aggregator(context)
@@ -27,10 +27,9 @@
context: OpenAIRealtimeLLMContext context: OpenAIRealtimeLLMContext
# or # or
context: OpenAILLMContext context: OpenAILLMContext
```
AFTER: AFTER::
```
# Setup # Setup
context = LLMContext(messages, tools) context = LLMContext(messages, tools)
context_aggregator = LLMContextAggregatorPair(context) context_aggregator = LLMContextAggregatorPair(context)
@@ -43,7 +42,6 @@
# Context type # Context type
context: LLMContext context: LLMContext
```
""" """
import warnings import warnings

View File

@@ -12,7 +12,7 @@
It now works more like most LLM services in Pipecat, relying on updates to It now works more like most LLM services in Pipecat, relying on updates to
its context, pushed by context aggregators, to update its internal state. its context, pushed by context aggregators, to update its internal state.
Listen for `LLMContextFrame`s for context updates. Listen for ``LLMContextFrame`` s for context updates.
""" """
import warnings import warnings

View File

@@ -845,7 +845,8 @@ class OpenAIRealtimeLLMService(LLMService):
"""Create an instance of OpenAIContextAggregatorPair from an OpenAILLMContext. """Create an instance of OpenAIContextAggregatorPair from an OpenAILLMContext.
NOTE: this method exists only for backward compatibility. New code NOTE: this method exists only for backward compatibility. New code
should instead do: should instead do::
context = LLMContext(...) context = LLMContext(...)
context_aggregator = LLMContextAggregatorPair(context) context_aggregator = LLMContextAggregatorPair(context)

View File

@@ -39,7 +39,6 @@ class SmallWebRTCRequest:
restart_pc: Optional[bool] = None restart_pc: Optional[bool] = None
request_data: Optional[Any] = None request_data: Optional[Any] = None
@classmethod @classmethod
def from_dict(cls, data: dict): def from_dict(cls, data: dict):
"""Accept both snake_case and camelCase for the request_data field.""" """Accept both snake_case and camelCase for the request_data field."""