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(
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.",
),
)

View File

@@ -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.",
),
)

View File

@@ -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.",
),
)

View File

@@ -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

View File

@@ -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()])

View File

@@ -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)

View File

@@ -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:

View File

@@ -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.

View File

@@ -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

View File

@@ -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):

View File

@@ -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

View File

@@ -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.

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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.

View File

@@ -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.

View File

@@ -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: