From c3794956efea708948b43bb9eb253f7fdef91c20 Mon Sep 17 00:00:00 2001 From: Mark Backman Date: Fri, 6 Mar 2026 12:47:26 -0500 Subject: [PATCH] Add deprecation version, fix foundational example double system message --- examples/foundational/07f-interruptible-azure-http.py | 2 +- examples/foundational/07f-interruptible-azure.py | 2 +- examples/foundational/07m-interruptible-aws.py | 4 ++-- .../07o-interruptible-assemblyai-turn-detection.py | 2 +- examples/foundational/14d-function-calling-aws-video.py | 4 ++-- examples/foundational/55zzn-update-settings-groq-stt.py | 2 +- src/pipecat/processors/aggregators/llm_context.py | 2 +- src/pipecat/processors/user_idle_processor.py | 2 +- src/pipecat/services/anthropic/llm.py | 6 +++--- src/pipecat/services/assemblyai/stt.py | 2 +- src/pipecat/services/aws/llm.py | 6 +++--- src/pipecat/services/aws/nova_sonic/llm.py | 4 ++-- src/pipecat/services/aws/stt.py | 4 ++-- src/pipecat/services/google/gemini_live/llm.py | 6 +++--- src/pipecat/services/google/gemini_live/llm_vertex.py | 4 ++-- src/pipecat/services/google/llm.py | 6 +++--- src/pipecat/services/google/llm_vertex.py | 4 ++-- src/pipecat/services/google/stt.py | 2 +- src/pipecat/services/openai_realtime_beta/openai.py | 2 +- src/pipecat/services/sarvam/stt.py | 2 +- 20 files changed, 34 insertions(+), 34 deletions(-) diff --git a/examples/foundational/07f-interruptible-azure-http.py b/examples/foundational/07f-interruptible-azure-http.py index 407022f75..ec5068b25 100644 --- a/examples/foundational/07f-interruptible-azure-http.py +++ b/examples/foundational/07f-interruptible-azure-http.py @@ -65,8 +65,8 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments): llm = AzureLLMService( api_key=os.getenv("AZURE_CHATGPT_API_KEY"), endpoint=os.getenv("AZURE_CHATGPT_ENDPOINT"), - model=os.getenv("AZURE_CHATGPT_MODEL"), settings=AzureLLMSettings( + model=os.getenv("AZURE_CHATGPT_MODEL"), system_instruction="You are a helpful LLM in a WebRTC call. Your goal is to demonstrate your capabilities in a succinct way. Your output will be spoken aloud, so avoid special characters that can't easily be spoken, such as emojis or bullet points. Respond to what the user said in a creative and helpful way.", ), ) diff --git a/examples/foundational/07f-interruptible-azure.py b/examples/foundational/07f-interruptible-azure.py index 7e47e1c3e..d905d59bb 100644 --- a/examples/foundational/07f-interruptible-azure.py +++ b/examples/foundational/07f-interruptible-azure.py @@ -65,8 +65,8 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments): llm = AzureLLMService( api_key=os.getenv("AZURE_CHATGPT_API_KEY"), endpoint=os.getenv("AZURE_CHATGPT_ENDPOINT"), - model=os.getenv("AZURE_CHATGPT_MODEL"), settings=AzureLLMSettings( + model=os.getenv("AZURE_CHATGPT_MODEL"), system_instruction="You are a helpful LLM in a WebRTC call. Your goal is to demonstrate your capabilities in a succinct way. Your output will be spoken aloud, so avoid special characters that can't easily be spoken, such as emojis or bullet points. Respond to what the user said in a creative and helpful way.", ), ) diff --git a/examples/foundational/07m-interruptible-aws.py b/examples/foundational/07m-interruptible-aws.py index 8b7c0c29e..9cea445c9 100644 --- a/examples/foundational/07m-interruptible-aws.py +++ b/examples/foundational/07m-interruptible-aws.py @@ -63,9 +63,9 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments): llm = AWSBedrockLLMService( aws_region="us-west-2", - model="us.anthropic.claude-haiku-4-5-20251001-v1:0", - params=AWSBedrockLLMService.InputParams(temperature=0.8), settings=AWSBedrockLLMSettings( + model="us.anthropic.claude-haiku-4-5-20251001-v1:0", + temperature=0.8, system_instruction="You are a helpful LLM in a WebRTC call. Your goal is to demonstrate your capabilities in a succinct way. Your output will be spoken aloud, so avoid special characters that can't easily be spoken, such as emojis or bullet points. Respond to what the user said in a creative and helpful way.", ), ) diff --git a/examples/foundational/07o-interruptible-assemblyai-turn-detection.py b/examples/foundational/07o-interruptible-assemblyai-turn-detection.py index 114c6f263..2c2ca5419 100644 --- a/examples/foundational/07o-interruptible-assemblyai-turn-detection.py +++ b/examples/foundational/07o-interruptible-assemblyai-turn-detection.py @@ -94,7 +94,7 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments): api_key=os.getenv("ASSEMBLYAI_API_KEY"), vad_force_turn_endpoint=False, # Use AssemblyAI's built-in turn detection settings=AssemblyAISTTSettings( - speech_model="u3-rt-pro", + model="u3-rt-pro", # Optional: Tune turn detection timing (defaults shown below) # min_turn_silence=100, # Default # max_turn_silence=1000, # Default diff --git a/examples/foundational/14d-function-calling-aws-video.py b/examples/foundational/14d-function-calling-aws-video.py index 358c6f7f0..75235bc01 100644 --- a/examples/foundational/14d-function-calling-aws-video.py +++ b/examples/foundational/14d-function-calling-aws-video.py @@ -99,7 +99,7 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments): llm = AWSBedrockLLMService( aws_region="us-west-2", settings=AWSBedrockLLMSettings( - model="us.anthropic.claude-3-7-sonnet-20250219-v1:0", + model="us.anthropic.claude-sonnet-4-6", # Note: usually, prefer providing latency="optimized" param. # Here we can't because AWS Bedrock doesn't support it for Claude 3.7, # which we need for image input. @@ -170,7 +170,7 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments): context.add_message( { "role": "user", - "content": f"Please introduce yourself to the user. Use '{client_id}' as the user ID during function calls.", + "content": f"Please introduce yourself to the user briefly; don't mention the camera. Use '{client_id}' as the user ID during function calls.", } ) await task.queue_frames([LLMRunFrame()]) diff --git a/examples/foundational/55zzn-update-settings-groq-stt.py b/examples/foundational/55zzn-update-settings-groq-stt.py index f3f3ffa01..dc7ba6d23 100644 --- a/examples/foundational/55zzn-update-settings-groq-stt.py +++ b/examples/foundational/55zzn-update-settings-groq-stt.py @@ -99,7 +99,7 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments): @transport.event_handler("on_client_connected") async def on_client_connected(transport, client): logger.info(f"Client connected") - context.add_message({"user": "system", "content": "Please introduce yourself to the user."}) + context.add_message({"role": "user", "content": "Please introduce yourself to the user."}) await task.queue_frames([LLMRunFrame()]) await asyncio.sleep(10) diff --git a/src/pipecat/processors/aggregators/llm_context.py b/src/pipecat/processors/aggregators/llm_context.py index 4b0e95aa7..1375b8297 100644 --- a/src/pipecat/processors/aggregators/llm_context.py +++ b/src/pipecat/processors/aggregators/llm_context.py @@ -255,7 +255,7 @@ class LLMContext: this method, which is part of the public API of OpenAILLMContext but doesn't need to be for LLMContext. - .. deprecated:: + .. deprecated:: 0.0.92 Use `get_messages()` instead. Returns: diff --git a/src/pipecat/processors/user_idle_processor.py b/src/pipecat/processors/user_idle_processor.py index 67c41ab13..f7ea48599 100644 --- a/src/pipecat/processors/user_idle_processor.py +++ b/src/pipecat/processors/user_idle_processor.py @@ -27,7 +27,7 @@ from pipecat.processors.frame_processor import FrameDirection, FrameProcessor class UserIdleProcessor(FrameProcessor): """Monitors user inactivity and triggers callbacks after timeout periods. - .. deprecated:: + .. deprecated:: 0.0.100 UserIdleProcessor is deprecated in 0.0.100 and will be removed in a future version. Use LLMUserAggregator with user_idle_timeout parameter instead. diff --git a/src/pipecat/services/anthropic/llm.py b/src/pipecat/services/anthropic/llm.py index 369c2a4ed..49f7f58b4 100644 --- a/src/pipecat/services/anthropic/llm.py +++ b/src/pipecat/services/anthropic/llm.py @@ -170,7 +170,7 @@ class AnthropicLLMService(LLMService): class InputParams(BaseModel): """Input parameters for Anthropic model inference. - .. deprecated:: + .. deprecated:: 0.0.105 Use ``AnthropicLLMSettings`` instead. Pass settings directly via the ``settings`` parameter of :class:`AnthropicLLMService`. @@ -231,12 +231,12 @@ class AnthropicLLMService(LLMService): api_key: Anthropic API key for authentication. model: Model name to use. - .. deprecated:: + .. deprecated:: 0.0.105 Use ``settings=AnthropicLLMSettings(model=...)`` instead. params: Optional model parameters for inference. - .. deprecated:: + .. deprecated:: 0.0.105 Use ``settings=AnthropicLLMSettings(...)`` instead. settings: Runtime-updatable settings for this service. When both diff --git a/src/pipecat/services/assemblyai/stt.py b/src/pipecat/services/assemblyai/stt.py index 3c4803708..a75327300 100644 --- a/src/pipecat/services/assemblyai/stt.py +++ b/src/pipecat/services/assemblyai/stt.py @@ -657,7 +657,7 @@ class AssemblyAISTTService(WebsocketSTTService): await self.start_processing_metrics() await self.broadcast_frame(UserStartedSpeakingFrame) if self._should_interrupt: - await self.push_interruption_task_frame_and_wait() + await self.broadcast_interruption() self._user_speaking = True async def _handle_termination(self, message: TerminationMessage): diff --git a/src/pipecat/services/aws/llm.py b/src/pipecat/services/aws/llm.py index 34a0dd780..5b8c80996 100644 --- a/src/pipecat/services/aws/llm.py +++ b/src/pipecat/services/aws/llm.py @@ -754,7 +754,7 @@ class AWSBedrockLLMService(LLMService): class InputParams(BaseModel): """Input parameters for AWS Bedrock LLM service. - .. deprecated:: + .. deprecated:: 0.0.105 Use ``AWSBedrockLLMSettings`` instead. Pass settings directly via the ``settings`` parameter of :class:`AWSBedrockLLMService`. @@ -795,7 +795,7 @@ class AWSBedrockLLMService(LLMService): Args: model: The AWS Bedrock model identifier to use. - .. deprecated:: + .. deprecated:: 0.0.105 Use ``settings=AWSBedrockLLMSettings(model=...)`` instead. aws_access_key: AWS access key ID. If None, uses default credentials. @@ -804,7 +804,7 @@ class AWSBedrockLLMService(LLMService): aws_region: AWS region for the Bedrock service. params: Model parameters and configuration. - .. deprecated:: + .. deprecated:: 0.0.105 Use ``settings=AWSBedrockLLMSettings(...)`` instead. settings: Runtime-updatable settings for this service. When both diff --git a/src/pipecat/services/aws/nova_sonic/llm.py b/src/pipecat/services/aws/nova_sonic/llm.py index 3948ae1eb..3acc1d0fc 100644 --- a/src/pipecat/services/aws/nova_sonic/llm.py +++ b/src/pipecat/services/aws/nova_sonic/llm.py @@ -280,7 +280,7 @@ class AWSNovaSonicLLMService(LLMService): - Nova Sonic (the older model): "us-east-1", "ap-northeast-1" model: Model identifier. Defaults to "amazon.nova-2-sonic-v1:0". - .. deprecated:: + .. deprecated:: 0.0.105 Use ``settings=AWSNovaSonicLLMSettings(model=...)`` instead. voice_id: Voice ID for speech synthesis. @@ -289,7 +289,7 @@ class AWSNovaSonicLLMService(LLMService): - Nova 2 Sonic (the default model): see https://docs.aws.amazon.com/nova/latest/nova2-userguide/sonic-language-support.html - Nova Sonic (the older model): see https://docs.aws.amazon.com/nova/latest/userguide/available-voices.html. - .. deprecated:: + .. deprecated:: 0.0.105 Use ``settings=AWSNovaSonicLLMSettings(voice=...)`` instead. params: Model parameters for audio configuration and inference. diff --git a/src/pipecat/services/aws/stt.py b/src/pipecat/services/aws/stt.py index f46f5259c..f2ce79c29 100644 --- a/src/pipecat/services/aws/stt.py +++ b/src/pipecat/services/aws/stt.py @@ -99,13 +99,13 @@ class AWSTranscribeSTTService(WebsocketSTTService): # 1. Initialize default_settings with hardcoded defaults default_settings = AWSTranscribeSTTSettings( model=None, - language=self.language_to_service_language(Language.EN) or "en-US", + language=self.language_to_service_language(Language.EN), ) # 2. Apply direct init arg overrides (deprecated) if language is not None: _warn_deprecated_param("language", AWSTranscribeSTTSettings, "language") - default_settings.language = self.language_to_service_language(language) or "en-US" + default_settings.language = self.language_to_service_language(language) # 3. No params to apply diff --git a/src/pipecat/services/google/gemini_live/llm.py b/src/pipecat/services/google/gemini_live/llm.py index 146a0fcc4..9f65f57a1 100644 --- a/src/pipecat/services/google/gemini_live/llm.py +++ b/src/pipecat/services/google/gemini_live/llm.py @@ -552,7 +552,7 @@ class ContextWindowCompressionParams(BaseModel): class InputParams(BaseModel): """Input parameters for Gemini Live generation. - .. deprecated:: + .. deprecated:: 0.0.105 Use ``GeminiLiveLLMSettings`` instead. Parameters: @@ -678,7 +678,7 @@ class GeminiLiveLLMService(LLMService): model: Model identifier to use. - .. deprecated:: + .. deprecated:: 0.0.105 Use ``settings=GeminiLiveLLMSettings(model=...)`` instead. voice_id: TTS voice identifier. Defaults to "Charon". @@ -691,7 +691,7 @@ class GeminiLiveLLMService(LLMService): tools: Tools/functions available to the model. Defaults to None. params: Configuration parameters for the model. - .. deprecated:: + .. deprecated:: 0.0.105 Use ``settings=GeminiLiveLLMSettings(...)`` instead. settings: Gemini Live LLM settings. If provided together with deprecated diff --git a/src/pipecat/services/google/gemini_live/llm_vertex.py b/src/pipecat/services/google/gemini_live/llm_vertex.py index 6264ea285..9edd73e61 100644 --- a/src/pipecat/services/google/gemini_live/llm_vertex.py +++ b/src/pipecat/services/google/gemini_live/llm_vertex.py @@ -88,7 +88,7 @@ class GeminiLiveVertexLLMService(GeminiLiveLLMService): project_id: Google Cloud project ID. model: Model identifier to use. - .. deprecated:: + .. deprecated:: 0.0.105 Use ``settings=GeminiLiveLLMSettings(model=...)`` instead. voice_id: TTS voice identifier. Defaults to "Charon". @@ -102,7 +102,7 @@ class GeminiLiveVertexLLMService(GeminiLiveLLMService): params: Configuration parameters for the model along with Vertex AI location and project ID. - .. deprecated:: + .. deprecated:: 0.0.105 Use ``settings=GeminiLiveLLMSettings(...)`` instead. settings: Gemini Live LLM settings. If provided together with deprecated diff --git a/src/pipecat/services/google/llm.py b/src/pipecat/services/google/llm.py index 980d2d576..d5f025bcd 100644 --- a/src/pipecat/services/google/llm.py +++ b/src/pipecat/services/google/llm.py @@ -754,7 +754,7 @@ class GoogleLLMService(LLMService): class InputParams(BaseModel): """Input parameters for Google AI models. - .. deprecated:: + .. deprecated:: 0.0.105 Use ``settings=GoogleLLMSettings(...)`` instead. Parameters: @@ -797,12 +797,12 @@ class GoogleLLMService(LLMService): api_key: Google AI API key for authentication. model: Model name to use. - .. deprecated:: + .. deprecated:: 0.0.105 Use ``settings=GoogleLLMSettings(model=...)`` instead. params: Optional model parameters for inference. - .. deprecated:: + .. deprecated:: 0.0.105 Use ``settings=GoogleLLMSettings(...)`` instead. settings: Runtime-updatable settings for this service. When both diff --git a/src/pipecat/services/google/llm_vertex.py b/src/pipecat/services/google/llm_vertex.py index 42d96333c..cbad30c48 100644 --- a/src/pipecat/services/google/llm_vertex.py +++ b/src/pipecat/services/google/llm_vertex.py @@ -128,14 +128,14 @@ class GoogleVertexLLMService(GoogleLLMService): credentials_path: Path to the service account JSON file. model: Model identifier (e.g., "gemini-2.5-flash"). - .. deprecated:: + .. deprecated:: 0.0.105 Use ``settings=GoogleLLMSettings(model=...)`` instead. location: GCP region for Vertex AI endpoint (e.g., "us-east4"). project_id: Google Cloud project ID. params: Input parameters for the model. - .. deprecated:: + .. deprecated:: 0.0.105 Use ``settings=GoogleLLMSettings(...)`` instead. settings: Runtime-updatable settings for this service. When both diff --git a/src/pipecat/services/google/stt.py b/src/pipecat/services/google/stt.py index 376e74a6d..6ac0d6440 100644 --- a/src/pipecat/services/google/stt.py +++ b/src/pipecat/services/google/stt.py @@ -653,7 +653,7 @@ class GoogleSTTService(STTService): async def set_languages(self, languages: List[Language]): """Update the service's recognition languages. - .. deprecated:: + .. deprecated:: 0.0.104 Use ``STTUpdateSettingsFrame`` with ``GoogleSTTSettings(languages=...)`` instead. diff --git a/src/pipecat/services/openai_realtime_beta/openai.py b/src/pipecat/services/openai_realtime_beta/openai.py index a3f8e47fc..bd9dc29b0 100644 --- a/src/pipecat/services/openai_realtime_beta/openai.py +++ b/src/pipecat/services/openai_realtime_beta/openai.py @@ -134,7 +134,7 @@ class OpenAIRealtimeBetaLLMService(LLMService): api_key: OpenAI API key for authentication. model: OpenAI model name. - .. deprecated:: + .. deprecated:: 0.0.105 Use ``settings=OpenAIRealtimeBetaLLMSettings(model=...)`` instead. base_url: WebSocket base URL for the realtime API. diff --git a/src/pipecat/services/sarvam/stt.py b/src/pipecat/services/sarvam/stt.py index d8659a6e7..8581a7463 100644 --- a/src/pipecat/services/sarvam/stt.py +++ b/src/pipecat/services/sarvam/stt.py @@ -414,7 +414,7 @@ class SarvamSTTService(STTService): async def set_prompt(self, prompt: Optional[str]): """Set the transcription/translation prompt and reconnect. - .. deprecated:: + .. deprecated:: 0.0.104 Use ``STTUpdateSettingsFrame(SarvamSTTSettings(prompt=...))`` instead. Args: