Add deprecation version, fix foundational example double system message

This commit is contained in:
Mark Backman
2026-03-06 12:47:26 -05:00
parent 940da9eeeb
commit c3794956ef
20 changed files with 34 additions and 34 deletions

View File

@@ -65,8 +65,8 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments):
llm = AzureLLMService( llm = AzureLLMService(
api_key=os.getenv("AZURE_CHATGPT_API_KEY"), api_key=os.getenv("AZURE_CHATGPT_API_KEY"),
endpoint=os.getenv("AZURE_CHATGPT_ENDPOINT"), endpoint=os.getenv("AZURE_CHATGPT_ENDPOINT"),
model=os.getenv("AZURE_CHATGPT_MODEL"),
settings=AzureLLMSettings( 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.", 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.",
), ),
) )

View File

@@ -65,8 +65,8 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments):
llm = AzureLLMService( llm = AzureLLMService(
api_key=os.getenv("AZURE_CHATGPT_API_KEY"), api_key=os.getenv("AZURE_CHATGPT_API_KEY"),
endpoint=os.getenv("AZURE_CHATGPT_ENDPOINT"), endpoint=os.getenv("AZURE_CHATGPT_ENDPOINT"),
model=os.getenv("AZURE_CHATGPT_MODEL"),
settings=AzureLLMSettings( 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.", 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.",
), ),
) )

View File

@@ -63,9 +63,9 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments):
llm = AWSBedrockLLMService( llm = AWSBedrockLLMService(
aws_region="us-west-2", aws_region="us-west-2",
model="us.anthropic.claude-haiku-4-5-20251001-v1:0",
params=AWSBedrockLLMService.InputParams(temperature=0.8),
settings=AWSBedrockLLMSettings( 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.", 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.",
), ),
) )

View File

@@ -94,7 +94,7 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments):
api_key=os.getenv("ASSEMBLYAI_API_KEY"), api_key=os.getenv("ASSEMBLYAI_API_KEY"),
vad_force_turn_endpoint=False, # Use AssemblyAI's built-in turn detection vad_force_turn_endpoint=False, # Use AssemblyAI's built-in turn detection
settings=AssemblyAISTTSettings( settings=AssemblyAISTTSettings(
speech_model="u3-rt-pro", model="u3-rt-pro",
# Optional: Tune turn detection timing (defaults shown below) # Optional: Tune turn detection timing (defaults shown below)
# min_turn_silence=100, # Default # min_turn_silence=100, # Default
# max_turn_silence=1000, # Default # max_turn_silence=1000, # Default

View File

@@ -99,7 +99,7 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments):
llm = AWSBedrockLLMService( llm = AWSBedrockLLMService(
aws_region="us-west-2", aws_region="us-west-2",
settings=AWSBedrockLLMSettings( 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. # Note: usually, prefer providing latency="optimized" param.
# Here we can't because AWS Bedrock doesn't support it for Claude 3.7, # Here we can't because AWS Bedrock doesn't support it for Claude 3.7,
# which we need for image input. # which we need for image input.
@@ -170,7 +170,7 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments):
context.add_message( context.add_message(
{ {
"role": "user", "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()]) await task.queue_frames([LLMRunFrame()])

View File

@@ -99,7 +99,7 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments):
@transport.event_handler("on_client_connected") @transport.event_handler("on_client_connected")
async def on_client_connected(transport, client): async def on_client_connected(transport, client):
logger.info(f"Client connected") 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 task.queue_frames([LLMRunFrame()])
await asyncio.sleep(10) await asyncio.sleep(10)

View File

@@ -255,7 +255,7 @@ class LLMContext:
this method, which is part of the public API of OpenAILLMContext but this method, which is part of the public API of OpenAILLMContext but
doesn't need to be for LLMContext. doesn't need to be for LLMContext.
.. deprecated:: .. deprecated:: 0.0.92
Use `get_messages()` instead. Use `get_messages()` instead.
Returns: Returns:

View File

@@ -27,7 +27,7 @@ from pipecat.processors.frame_processor import FrameDirection, FrameProcessor
class UserIdleProcessor(FrameProcessor): class UserIdleProcessor(FrameProcessor):
"""Monitors user inactivity and triggers callbacks after timeout periods. """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. UserIdleProcessor is deprecated in 0.0.100 and will be removed in a future version.
Use LLMUserAggregator with user_idle_timeout parameter instead. Use LLMUserAggregator with user_idle_timeout parameter instead.

View File

@@ -170,7 +170,7 @@ class AnthropicLLMService(LLMService):
class InputParams(BaseModel): class InputParams(BaseModel):
"""Input parameters for Anthropic model inference. """Input parameters for Anthropic model inference.
.. deprecated:: .. deprecated:: 0.0.105
Use ``AnthropicLLMSettings`` instead. Pass settings directly via the Use ``AnthropicLLMSettings`` instead. Pass settings directly via the
``settings`` parameter of :class:`AnthropicLLMService`. ``settings`` parameter of :class:`AnthropicLLMService`.
@@ -231,12 +231,12 @@ class AnthropicLLMService(LLMService):
api_key: Anthropic API key for authentication. api_key: Anthropic API key for authentication.
model: Model name to use. model: Model name to use.
.. deprecated:: .. deprecated:: 0.0.105
Use ``settings=AnthropicLLMSettings(model=...)`` instead. Use ``settings=AnthropicLLMSettings(model=...)`` instead.
params: Optional model parameters for inference. params: Optional model parameters for inference.
.. deprecated:: .. deprecated:: 0.0.105
Use ``settings=AnthropicLLMSettings(...)`` instead. Use ``settings=AnthropicLLMSettings(...)`` instead.
settings: Runtime-updatable settings for this service. When both settings: Runtime-updatable settings for this service. When both

View File

@@ -657,7 +657,7 @@ class AssemblyAISTTService(WebsocketSTTService):
await self.start_processing_metrics() await self.start_processing_metrics()
await self.broadcast_frame(UserStartedSpeakingFrame) await self.broadcast_frame(UserStartedSpeakingFrame)
if self._should_interrupt: if self._should_interrupt:
await self.push_interruption_task_frame_and_wait() await self.broadcast_interruption()
self._user_speaking = True self._user_speaking = True
async def _handle_termination(self, message: TerminationMessage): async def _handle_termination(self, message: TerminationMessage):

View File

@@ -754,7 +754,7 @@ class AWSBedrockLLMService(LLMService):
class InputParams(BaseModel): class InputParams(BaseModel):
"""Input parameters for AWS Bedrock LLM service. """Input parameters for AWS Bedrock LLM service.
.. deprecated:: .. deprecated:: 0.0.105
Use ``AWSBedrockLLMSettings`` instead. Pass settings directly via the Use ``AWSBedrockLLMSettings`` instead. Pass settings directly via the
``settings`` parameter of :class:`AWSBedrockLLMService`. ``settings`` parameter of :class:`AWSBedrockLLMService`.
@@ -795,7 +795,7 @@ class AWSBedrockLLMService(LLMService):
Args: Args:
model: The AWS Bedrock model identifier to use. model: The AWS Bedrock model identifier to use.
.. deprecated:: .. deprecated:: 0.0.105
Use ``settings=AWSBedrockLLMSettings(model=...)`` instead. Use ``settings=AWSBedrockLLMSettings(model=...)`` instead.
aws_access_key: AWS access key ID. If None, uses default credentials. 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. aws_region: AWS region for the Bedrock service.
params: Model parameters and configuration. params: Model parameters and configuration.
.. deprecated:: .. deprecated:: 0.0.105
Use ``settings=AWSBedrockLLMSettings(...)`` instead. Use ``settings=AWSBedrockLLMSettings(...)`` instead.
settings: Runtime-updatable settings for this service. When both settings: Runtime-updatable settings for this service. When both

View File

@@ -280,7 +280,7 @@ class AWSNovaSonicLLMService(LLMService):
- Nova Sonic (the older model): "us-east-1", "ap-northeast-1" - Nova Sonic (the older model): "us-east-1", "ap-northeast-1"
model: Model identifier. Defaults to "amazon.nova-2-sonic-v1:0". model: Model identifier. Defaults to "amazon.nova-2-sonic-v1:0".
.. deprecated:: .. deprecated:: 0.0.105
Use ``settings=AWSNovaSonicLLMSettings(model=...)`` instead. Use ``settings=AWSNovaSonicLLMSettings(model=...)`` instead.
voice_id: Voice ID for speech synthesis. 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 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. - 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. Use ``settings=AWSNovaSonicLLMSettings(voice=...)`` instead.
params: Model parameters for audio configuration and inference. params: Model parameters for audio configuration and inference.

View File

@@ -99,13 +99,13 @@ class AWSTranscribeSTTService(WebsocketSTTService):
# 1. Initialize default_settings with hardcoded defaults # 1. Initialize default_settings with hardcoded defaults
default_settings = AWSTranscribeSTTSettings( default_settings = AWSTranscribeSTTSettings(
model=None, 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) # 2. Apply direct init arg overrides (deprecated)
if language is not None: if language is not None:
_warn_deprecated_param("language", AWSTranscribeSTTSettings, "language") _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 # 3. No params to apply

View File

@@ -552,7 +552,7 @@ class ContextWindowCompressionParams(BaseModel):
class InputParams(BaseModel): class InputParams(BaseModel):
"""Input parameters for Gemini Live generation. """Input parameters for Gemini Live generation.
.. deprecated:: .. deprecated:: 0.0.105
Use ``GeminiLiveLLMSettings`` instead. Use ``GeminiLiveLLMSettings`` instead.
Parameters: Parameters:
@@ -678,7 +678,7 @@ class GeminiLiveLLMService(LLMService):
model: Model identifier to use. model: Model identifier to use.
.. deprecated:: .. deprecated:: 0.0.105
Use ``settings=GeminiLiveLLMSettings(model=...)`` instead. Use ``settings=GeminiLiveLLMSettings(model=...)`` instead.
voice_id: TTS voice identifier. Defaults to "Charon". 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. tools: Tools/functions available to the model. Defaults to None.
params: Configuration parameters for the model. params: Configuration parameters for the model.
.. deprecated:: .. deprecated:: 0.0.105
Use ``settings=GeminiLiveLLMSettings(...)`` instead. Use ``settings=GeminiLiveLLMSettings(...)`` instead.
settings: Gemini Live LLM settings. If provided together with deprecated settings: Gemini Live LLM settings. If provided together with deprecated

View File

@@ -88,7 +88,7 @@ class GeminiLiveVertexLLMService(GeminiLiveLLMService):
project_id: Google Cloud project ID. project_id: Google Cloud project ID.
model: Model identifier to use. model: Model identifier to use.
.. deprecated:: .. deprecated:: 0.0.105
Use ``settings=GeminiLiveLLMSettings(model=...)`` instead. Use ``settings=GeminiLiveLLMSettings(model=...)`` instead.
voice_id: TTS voice identifier. Defaults to "Charon". 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 params: Configuration parameters for the model along with Vertex AI
location and project ID. location and project ID.
.. deprecated:: .. deprecated:: 0.0.105
Use ``settings=GeminiLiveLLMSettings(...)`` instead. Use ``settings=GeminiLiveLLMSettings(...)`` instead.
settings: Gemini Live LLM settings. If provided together with deprecated settings: Gemini Live LLM settings. If provided together with deprecated

View File

@@ -754,7 +754,7 @@ class GoogleLLMService(LLMService):
class InputParams(BaseModel): class InputParams(BaseModel):
"""Input parameters for Google AI models. """Input parameters for Google AI models.
.. deprecated:: .. deprecated:: 0.0.105
Use ``settings=GoogleLLMSettings(...)`` instead. Use ``settings=GoogleLLMSettings(...)`` instead.
Parameters: Parameters:
@@ -797,12 +797,12 @@ class GoogleLLMService(LLMService):
api_key: Google AI API key for authentication. api_key: Google AI API key for authentication.
model: Model name to use. model: Model name to use.
.. deprecated:: .. deprecated:: 0.0.105
Use ``settings=GoogleLLMSettings(model=...)`` instead. Use ``settings=GoogleLLMSettings(model=...)`` instead.
params: Optional model parameters for inference. params: Optional model parameters for inference.
.. deprecated:: .. deprecated:: 0.0.105
Use ``settings=GoogleLLMSettings(...)`` instead. Use ``settings=GoogleLLMSettings(...)`` instead.
settings: Runtime-updatable settings for this service. When both settings: Runtime-updatable settings for this service. When both

View File

@@ -128,14 +128,14 @@ class GoogleVertexLLMService(GoogleLLMService):
credentials_path: Path to the service account JSON file. credentials_path: Path to the service account JSON file.
model: Model identifier (e.g., "gemini-2.5-flash"). model: Model identifier (e.g., "gemini-2.5-flash").
.. deprecated:: .. deprecated:: 0.0.105
Use ``settings=GoogleLLMSettings(model=...)`` instead. Use ``settings=GoogleLLMSettings(model=...)`` instead.
location: GCP region for Vertex AI endpoint (e.g., "us-east4"). location: GCP region for Vertex AI endpoint (e.g., "us-east4").
project_id: Google Cloud project ID. project_id: Google Cloud project ID.
params: Input parameters for the model. params: Input parameters for the model.
.. deprecated:: .. deprecated:: 0.0.105
Use ``settings=GoogleLLMSettings(...)`` instead. Use ``settings=GoogleLLMSettings(...)`` instead.
settings: Runtime-updatable settings for this service. When both settings: Runtime-updatable settings for this service. When both

View File

@@ -653,7 +653,7 @@ class GoogleSTTService(STTService):
async def set_languages(self, languages: List[Language]): async def set_languages(self, languages: List[Language]):
"""Update the service's recognition languages. """Update the service's recognition languages.
.. deprecated:: .. deprecated:: 0.0.104
Use ``STTUpdateSettingsFrame`` with ``GoogleSTTSettings(languages=...)`` Use ``STTUpdateSettingsFrame`` with ``GoogleSTTSettings(languages=...)``
instead. instead.

View File

@@ -134,7 +134,7 @@ class OpenAIRealtimeBetaLLMService(LLMService):
api_key: OpenAI API key for authentication. api_key: OpenAI API key for authentication.
model: OpenAI model name. model: OpenAI model name.
.. deprecated:: .. deprecated:: 0.0.105
Use ``settings=OpenAIRealtimeBetaLLMSettings(model=...)`` instead. Use ``settings=OpenAIRealtimeBetaLLMSettings(model=...)`` instead.
base_url: WebSocket base URL for the realtime API. base_url: WebSocket base URL for the realtime API.

View File

@@ -414,7 +414,7 @@ class SarvamSTTService(STTService):
async def set_prompt(self, prompt: Optional[str]): async def set_prompt(self, prompt: Optional[str]):
"""Set the transcription/translation prompt and reconnect. """Set the transcription/translation prompt and reconnect.
.. deprecated:: .. deprecated:: 0.0.104
Use ``STTUpdateSettingsFrame(SarvamSTTSettings(prompt=...))`` instead. Use ``STTUpdateSettingsFrame(SarvamSTTSettings(prompt=...))`` instead.
Args: Args: