From 6d10732889bd6281b4c53b20897699326c1374df Mon Sep 17 00:00:00 2001 From: Mark Backman Date: Tue, 15 Apr 2025 14:59:55 -0400 Subject: [PATCH 1/3] Update OpenAILLMService examples to use gpt-4.1 --- CHANGELOG.md | 1 - examples/canonical-metrics/bot.py | 2 +- examples/chatbot-audio-recording/bot.py | 2 +- examples/deployment/flyio-example/bot.py | 2 +- examples/deployment/modal-example/bot.py | 2 +- examples/deployment/pipecat-cloud-example/bot.py | 2 +- examples/foundational/02-llm-say-one-thing.py | 2 +- examples/foundational/05-sync-speech-and-image.py | 2 +- examples/foundational/05a-local-sync-speech-and-image.py | 2 +- examples/foundational/06-listen-and-respond.py | 2 +- examples/foundational/06a-image-sync.py | 2 +- examples/foundational/07-interruptible.py | 2 +- examples/foundational/07a-interruptible-vad.py | 2 +- examples/foundational/07b-interruptible-langchain.py | 2 +- examples/foundational/07c-interruptible-deepgram-vad.py | 2 +- examples/foundational/07c-interruptible-deepgram.py | 2 +- examples/foundational/07d-interruptible-elevenlabs-http.py | 2 +- examples/foundational/07d-interruptible-elevenlabs.py | 2 +- examples/foundational/07e-interruptible-playht-http.py | 2 +- examples/foundational/07e-interruptible-playht.py | 2 +- examples/foundational/07g-interruptible-openai.py | 2 +- examples/foundational/07h-interruptible-openpipe.py | 2 +- examples/foundational/07i-interruptible-xtts.py | 2 +- examples/foundational/07j-interruptible-gladia.py | 2 +- examples/foundational/07k-interruptible-lmnt.py | 2 +- examples/foundational/07m-interruptible-polly.py | 2 +- examples/foundational/07o-interruptible-assemblyai.py | 2 +- examples/foundational/07p-interruptible-krisp.py | 2 +- examples/foundational/07q-interruptible-rime-http.py | 2 +- examples/foundational/07q-interruptible-rime.py | 2 +- examples/foundational/07t-interruptible-fish.py | 2 +- examples/foundational/07v-interruptible-neuphonic-http.py | 2 +- examples/foundational/07v-interruptible-neuphonic.py | 2 +- examples/foundational/07w-interruptible-fal.py | 2 +- examples/foundational/07x-interruptible-local.py | 2 +- examples/foundational/10-wake-phrase.py | 2 +- examples/foundational/11-sound-effects.py | 2 +- examples/foundational/12b-describe-video-gpt-4o.py | 2 +- examples/foundational/14-function-calling.py | 2 +- examples/foundational/14d-function-calling-video.py | 2 +- examples/foundational/15-switch-voices.py | 2 +- examples/foundational/15a-switch-languages.py | 2 +- examples/foundational/16-gpu-container-local-bot.py | 2 +- examples/foundational/17-detect-user-idle.py | 2 +- examples/foundational/20a-persistent-context-openai.py | 2 +- examples/foundational/22-natural-conversation.py | 4 ++-- examples/foundational/22b-natural-conversation-proposal.py | 4 ++-- .../foundational/22c-natural-conversation-mixed-llms.py | 2 +- examples/foundational/23-bot-background-sound-daily.py | 2 +- examples/foundational/23-bot-background-sound-p2p.py | 6 ++---- examples/foundational/24-stt-mute-filter.py | 2 +- examples/foundational/28-transcription-processor.py | 2 +- examples/foundational/29-livekit-audio-chat.py | 2 +- examples/foundational/30-observer.py | 2 +- examples/foundational/35-pattern-pair-voice-switching.py | 2 +- examples/foundational/36-user-email-gathering.py | 2 +- examples/moondream-chatbot/bot.py | 2 +- examples/patient-intake/bot.py | 2 +- examples/phone-chatbot/bot_twilio.py | 2 +- examples/phone-chatbot/call_transfer.py | 2 +- examples/phone-chatbot/simple_dialin.py | 2 +- examples/phone-chatbot/simple_dialout.py | 2 +- examples/sentry-metrics/bot.py | 2 +- examples/simple-chatbot/server/bot-openai.py | 2 +- examples/telnyx-chatbot/bot.py | 2 +- examples/translation-chatbot/bot.py | 2 +- examples/twilio-chatbot/bot.py | 2 +- examples/twilio-chatbot/client.py | 2 +- examples/websocket-server/bot.py | 2 +- .../test_integration_unified_function_calling.py | 2 +- 70 files changed, 72 insertions(+), 75 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 919bde5ef..5255835f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,6 @@ All notable changes to **Pipecat** will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - ## [Unreleased] ### Added diff --git a/examples/canonical-metrics/bot.py b/examples/canonical-metrics/bot.py index 513de9b14..0d31f1df5 100644 --- a/examples/canonical-metrics/bot.py +++ b/examples/canonical-metrics/bot.py @@ -72,7 +72,7 @@ async def main(): # voice_id="gD1IexrzCvsXPHUuT0s3", ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") messages = [ { diff --git a/examples/chatbot-audio-recording/bot.py b/examples/chatbot-audio-recording/bot.py index 92644301e..5fa6f5aaa 100644 --- a/examples/chatbot-audio-recording/bot.py +++ b/examples/chatbot-audio-recording/bot.py @@ -95,7 +95,7 @@ async def main(): # voice_id="gD1IexrzCvsXPHUuT0s3", ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") messages = [ { diff --git a/examples/deployment/flyio-example/bot.py b/examples/deployment/flyio-example/bot.py index 2e610cb23..83e058434 100644 --- a/examples/deployment/flyio-example/bot.py +++ b/examples/deployment/flyio-example/bot.py @@ -53,7 +53,7 @@ async def main(room_url: str, token: str): voice_id=os.getenv("ELEVENLABS_VOICE_ID", ""), ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") messages = [ { diff --git a/examples/deployment/modal-example/bot.py b/examples/deployment/modal-example/bot.py index 49e1acc0a..1c4423c10 100644 --- a/examples/deployment/modal-example/bot.py +++ b/examples/deployment/modal-example/bot.py @@ -43,7 +43,7 @@ async def main(room_url: str, token: str): api_key=os.getenv("CARTESIA_API_KEY", ""), voice_id="71a7ad14-091c-4e8e-a314-022ece01c121" ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") messages = [ { diff --git a/examples/deployment/pipecat-cloud-example/bot.py b/examples/deployment/pipecat-cloud-example/bot.py index a0e3f5cfe..4e2ddfbd4 100644 --- a/examples/deployment/pipecat-cloud-example/bot.py +++ b/examples/deployment/pipecat-cloud-example/bot.py @@ -61,7 +61,7 @@ async def main(room_url: str, token: str): api_key=os.getenv("CARTESIA_API_KEY"), voice_id="79a125e8-cd45-4c13-8a67-188112f4dd22" ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") messages = [ { diff --git a/examples/foundational/02-llm-say-one-thing.py b/examples/foundational/02-llm-say-one-thing.py index 510e9291d..84651499b 100644 --- a/examples/foundational/02-llm-say-one-thing.py +++ b/examples/foundational/02-llm-say-one-thing.py @@ -38,7 +38,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): voice_id="71a7ad14-091c-4e8e-a314-022ece01c121", # British Reading Lady ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") messages = [ { diff --git a/examples/foundational/05-sync-speech-and-image.py b/examples/foundational/05-sync-speech-and-image.py index 6778b6946..2213089c8 100644 --- a/examples/foundational/05-sync-speech-and-image.py +++ b/examples/foundational/05-sync-speech-and-image.py @@ -85,7 +85,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): # Create an HTTP session for API calls async with aiohttp.ClientSession() as session: - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") tts = CartesiaHttpTTSService( api_key=os.getenv("CARTESIA_API_KEY"), diff --git a/examples/foundational/05a-local-sync-speech-and-image.py b/examples/foundational/05a-local-sync-speech-and-image.py index dee4c3c6d..4a7b32ba7 100644 --- a/examples/foundational/05a-local-sync-speech-and-image.py +++ b/examples/foundational/05a-local-sync-speech-and-image.py @@ -93,7 +93,7 @@ async def main(): self.frame = frame await self.push_frame(frame, direction) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") tts = CartesiaHttpTTSService( api_key=os.getenv("CARTESIA_API_KEY"), diff --git a/examples/foundational/06-listen-and-respond.py b/examples/foundational/06-listen-and-respond.py index 6df1b82b8..9d197d3e3 100644 --- a/examples/foundational/06-listen-and-respond.py +++ b/examples/foundational/06-listen-and-respond.py @@ -73,7 +73,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): voice_id="71a7ad14-091c-4e8e-a314-022ece01c121", # British Reading Lady ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") ml = MetricsLogger() diff --git a/examples/foundational/06a-image-sync.py b/examples/foundational/06a-image-sync.py index 1117ae940..17f42578e 100644 --- a/examples/foundational/06a-image-sync.py +++ b/examples/foundational/06a-image-sync.py @@ -91,7 +91,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): voice_id="71a7ad14-091c-4e8e-a314-022ece01c121", # British Reading Lady ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") messages = [ { diff --git a/examples/foundational/07-interruptible.py b/examples/foundational/07-interruptible.py index 9ec3b0215..34b24a748 100644 --- a/examples/foundational/07-interruptible.py +++ b/examples/foundational/07-interruptible.py @@ -45,7 +45,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): voice_id="71a7ad14-091c-4e8e-a314-022ece01c121", # British Reading Lady ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") messages = [ { diff --git a/examples/foundational/07a-interruptible-vad.py b/examples/foundational/07a-interruptible-vad.py index ab70e5013..af1e64916 100644 --- a/examples/foundational/07a-interruptible-vad.py +++ b/examples/foundational/07a-interruptible-vad.py @@ -44,7 +44,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): voice_id="71a7ad14-091c-4e8e-a314-022ece01c121", # British Reading Lady ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") messages = [ { diff --git a/examples/foundational/07b-interruptible-langchain.py b/examples/foundational/07b-interruptible-langchain.py index 8f72375c7..6a4c67b82 100644 --- a/examples/foundational/07b-interruptible-langchain.py +++ b/examples/foundational/07b-interruptible-langchain.py @@ -74,7 +74,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): ("human", "{input}"), ] ) - chain = prompt | ChatOpenAI(model="gpt-4o", temperature=0.7) + chain = prompt | ChatOpenAI(model="gpt-4.1", temperature=0.7) history_chain = RunnableWithMessageHistory( chain, get_session_history, diff --git a/examples/foundational/07c-interruptible-deepgram-vad.py b/examples/foundational/07c-interruptible-deepgram-vad.py index 224002752..118b46ec3 100644 --- a/examples/foundational/07c-interruptible-deepgram-vad.py +++ b/examples/foundational/07c-interruptible-deepgram-vad.py @@ -48,7 +48,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): tts = DeepgramTTSService(api_key=os.getenv("DEEPGRAM_API_KEY"), voice="aura-helios-en") - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") messages = [ { diff --git a/examples/foundational/07c-interruptible-deepgram.py b/examples/foundational/07c-interruptible-deepgram.py index 7cd1ea140..6b5cdcce0 100644 --- a/examples/foundational/07c-interruptible-deepgram.py +++ b/examples/foundational/07c-interruptible-deepgram.py @@ -42,7 +42,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): tts = DeepgramTTSService(api_key=os.getenv("DEEPGRAM_API_KEY"), voice="aura-helios-en") - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") messages = [ { diff --git a/examples/foundational/07d-interruptible-elevenlabs-http.py b/examples/foundational/07d-interruptible-elevenlabs-http.py index c28361e8b..42590254d 100644 --- a/examples/foundational/07d-interruptible-elevenlabs-http.py +++ b/examples/foundational/07d-interruptible-elevenlabs-http.py @@ -49,7 +49,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): aiohttp_session=session, ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") messages = [ { diff --git a/examples/foundational/07d-interruptible-elevenlabs.py b/examples/foundational/07d-interruptible-elevenlabs.py index 1d51e287b..27dd5cd72 100644 --- a/examples/foundational/07d-interruptible-elevenlabs.py +++ b/examples/foundational/07d-interruptible-elevenlabs.py @@ -45,7 +45,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): voice_id=os.getenv("ELEVENLABS_VOICE_ID", ""), ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") messages = [ { diff --git a/examples/foundational/07e-interruptible-playht-http.py b/examples/foundational/07e-interruptible-playht-http.py index cc4f581ef..c7d18083a 100644 --- a/examples/foundational/07e-interruptible-playht-http.py +++ b/examples/foundational/07e-interruptible-playht-http.py @@ -46,7 +46,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): voice_url="s3://voice-cloning-zero-shot/d9ff78ba-d016-47f6-b0ef-dd630f59414e/female-cs/manifest.json", ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") messages = [ { diff --git a/examples/foundational/07e-interruptible-playht.py b/examples/foundational/07e-interruptible-playht.py index cd8d70051..952ff0a76 100644 --- a/examples/foundational/07e-interruptible-playht.py +++ b/examples/foundational/07e-interruptible-playht.py @@ -48,7 +48,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): params=PlayHTTTSService.InputParams(language=Language.EN), ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") messages = [ { diff --git a/examples/foundational/07g-interruptible-openai.py b/examples/foundational/07g-interruptible-openai.py index a55f249f0..931b5fc5e 100644 --- a/examples/foundational/07g-interruptible-openai.py +++ b/examples/foundational/07g-interruptible-openai.py @@ -46,7 +46,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): tts = OpenAITTSService(api_key=os.getenv("OPENAI_API_KEY"), voice="ballad") - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") messages = [ { diff --git a/examples/foundational/07h-interruptible-openpipe.py b/examples/foundational/07h-interruptible-openpipe.py index 9335b4a20..4574198aa 100644 --- a/examples/foundational/07h-interruptible-openpipe.py +++ b/examples/foundational/07h-interruptible-openpipe.py @@ -50,7 +50,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): llm = OpenPipeLLMService( api_key=os.getenv("OPENAI_API_KEY"), openpipe_api_key=os.getenv("OPENPIPE_API_KEY"), - model="gpt-4o", + model="gpt-4.1", tags={"conversation_id": f"pipecat-{timestamp}"}, ) diff --git a/examples/foundational/07i-interruptible-xtts.py b/examples/foundational/07i-interruptible-xtts.py index f6aaf80cb..a4ae4f2be 100644 --- a/examples/foundational/07i-interruptible-xtts.py +++ b/examples/foundational/07i-interruptible-xtts.py @@ -49,7 +49,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): base_url="http://localhost:8000", ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") messages = [ { diff --git a/examples/foundational/07j-interruptible-gladia.py b/examples/foundational/07j-interruptible-gladia.py index 3174c4bee..1d526db48 100644 --- a/examples/foundational/07j-interruptible-gladia.py +++ b/examples/foundational/07j-interruptible-gladia.py @@ -54,7 +54,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): voice_id="71a7ad14-091c-4e8e-a314-022ece01c121", # British Reading Lady ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY", ""), model="gpt-4o") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY", ""), model="gpt-4.1") messages = [ { diff --git a/examples/foundational/07k-interruptible-lmnt.py b/examples/foundational/07k-interruptible-lmnt.py index 0c9bec12e..65129e7ce 100644 --- a/examples/foundational/07k-interruptible-lmnt.py +++ b/examples/foundational/07k-interruptible-lmnt.py @@ -42,7 +42,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): tts = LmntTTSService(api_key=os.getenv("LMNT_API_KEY"), voice_id="morgan") - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") messages = [ { diff --git a/examples/foundational/07m-interruptible-polly.py b/examples/foundational/07m-interruptible-polly.py index d832a7a06..83b13fbaa 100644 --- a/examples/foundational/07m-interruptible-polly.py +++ b/examples/foundational/07m-interruptible-polly.py @@ -48,7 +48,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): params=PollyTTSService.InputParams(engine="neural", language="en-GB", rate="1.05"), ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") messages = [ { diff --git a/examples/foundational/07o-interruptible-assemblyai.py b/examples/foundational/07o-interruptible-assemblyai.py index bc132860e..2302aa97c 100644 --- a/examples/foundational/07o-interruptible-assemblyai.py +++ b/examples/foundational/07o-interruptible-assemblyai.py @@ -47,7 +47,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): voice_id="71a7ad14-091c-4e8e-a314-022ece01c121", # British Reading Lady ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") messages = [ { diff --git a/examples/foundational/07p-interruptible-krisp.py b/examples/foundational/07p-interruptible-krisp.py index ab8e4617d..399f52f3b 100644 --- a/examples/foundational/07p-interruptible-krisp.py +++ b/examples/foundational/07p-interruptible-krisp.py @@ -44,7 +44,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): tts = DeepgramTTSService(api_key=os.getenv("DEEPGRAM_API_KEY"), voice="aura-helios-en") - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") messages = [ { diff --git a/examples/foundational/07q-interruptible-rime-http.py b/examples/foundational/07q-interruptible-rime-http.py index b6ee068c0..df2166d69 100644 --- a/examples/foundational/07q-interruptible-rime-http.py +++ b/examples/foundational/07q-interruptible-rime-http.py @@ -49,7 +49,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): aiohttp_session=session, ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") messages = [ { diff --git a/examples/foundational/07q-interruptible-rime.py b/examples/foundational/07q-interruptible-rime.py index b297177f3..8d836ba01 100644 --- a/examples/foundational/07q-interruptible-rime.py +++ b/examples/foundational/07q-interruptible-rime.py @@ -45,7 +45,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): voice_id="rex", ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") messages = [ { diff --git a/examples/foundational/07t-interruptible-fish.py b/examples/foundational/07t-interruptible-fish.py index db00b1095..a5827a704 100644 --- a/examples/foundational/07t-interruptible-fish.py +++ b/examples/foundational/07t-interruptible-fish.py @@ -45,7 +45,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): model="4ce7e917cedd4bc2bb2e6ff3a46acaa1", # Barack Obama ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") messages = [ { diff --git a/examples/foundational/07v-interruptible-neuphonic-http.py b/examples/foundational/07v-interruptible-neuphonic-http.py index 66170bcf9..a1f57d5f4 100644 --- a/examples/foundational/07v-interruptible-neuphonic-http.py +++ b/examples/foundational/07v-interruptible-neuphonic-http.py @@ -45,7 +45,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): voice_id="fc854436-2dac-4d21-aa69-ae17b54e98eb", # Emily ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") messages = [ { diff --git a/examples/foundational/07v-interruptible-neuphonic.py b/examples/foundational/07v-interruptible-neuphonic.py index d72b9327d..f566c285c 100644 --- a/examples/foundational/07v-interruptible-neuphonic.py +++ b/examples/foundational/07v-interruptible-neuphonic.py @@ -45,7 +45,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): voice_id="fc854436-2dac-4d21-aa69-ae17b54e98eb", # Emily ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") messages = [ { diff --git a/examples/foundational/07w-interruptible-fal.py b/examples/foundational/07w-interruptible-fal.py index 2b8df2aaf..26e22f2bf 100644 --- a/examples/foundational/07w-interruptible-fal.py +++ b/examples/foundational/07w-interruptible-fal.py @@ -47,7 +47,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): voice_id="71a7ad14-091c-4e8e-a314-022ece01c121", # British Reading Lady ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") messages = [ { diff --git a/examples/foundational/07x-interruptible-local.py b/examples/foundational/07x-interruptible-local.py index 989af1883..bc9620cec 100644 --- a/examples/foundational/07x-interruptible-local.py +++ b/examples/foundational/07x-interruptible-local.py @@ -45,7 +45,7 @@ async def main(): voice_id="71a7ad14-091c-4e8e-a314-022ece01c121", # British Reading Lady ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") messages = [ { diff --git a/examples/foundational/10-wake-phrase.py b/examples/foundational/10-wake-phrase.py index 24397bfa5..8b0b746e7 100644 --- a/examples/foundational/10-wake-phrase.py +++ b/examples/foundational/10-wake-phrase.py @@ -47,7 +47,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): voice_id="71a7ad14-091c-4e8e-a314-022ece01c121", # British Reading Lady ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") messages = [ { diff --git a/examples/foundational/11-sound-effects.py b/examples/foundational/11-sound-effects.py index f9d179867..5a900f78a 100644 --- a/examples/foundational/11-sound-effects.py +++ b/examples/foundational/11-sound-effects.py @@ -93,7 +93,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): stt = DeepgramSTTService(api_key=os.getenv("DEEPGRAM_API_KEY")) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") tts = CartesiaTTSService( api_key=os.getenv("CARTESIA_API_KEY"), diff --git a/examples/foundational/12b-describe-video-gpt-4o.py b/examples/foundational/12b-describe-video-gpt-4o.py index 8e1dc99dc..7958edabc 100644 --- a/examples/foundational/12b-describe-video-gpt-4o.py +++ b/examples/foundational/12b-describe-video-gpt-4o.py @@ -74,7 +74,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): stt = DeepgramSTTService(api_key=os.getenv("DEEPGRAM_API_KEY")) # OpenAI GPT-4o for vision analysis - openai = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o") + openai = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") tts = CartesiaTTSService( api_key=os.getenv("CARTESIA_API_KEY"), diff --git a/examples/foundational/14-function-calling.py b/examples/foundational/14-function-calling.py index 70d3c1667..fbc2e11e8 100644 --- a/examples/foundational/14-function-calling.py +++ b/examples/foundational/14-function-calling.py @@ -53,7 +53,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): voice_id="71a7ad14-091c-4e8e-a314-022ece01c121", # British Reading Lady ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") # You can also register a function_name of None to get all functions # sent to the same callback with an additional function_name parameter. diff --git a/examples/foundational/14d-function-calling-video.py b/examples/foundational/14d-function-calling-video.py index f8c86b8e7..a3840ca2d 100644 --- a/examples/foundational/14d-function-calling-video.py +++ b/examples/foundational/14d-function-calling-video.py @@ -82,7 +82,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): voice_id="71a7ad14-091c-4e8e-a314-022ece01c121", # British Reading Lady ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") llm.register_function("get_weather", get_weather) llm.register_function("get_image", get_image) diff --git a/examples/foundational/15-switch-voices.py b/examples/foundational/15-switch-voices.py index 85e063f21..cf93d8858 100644 --- a/examples/foundational/15-switch-voices.py +++ b/examples/foundational/15-switch-voices.py @@ -83,7 +83,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): voice_id="a0e99841-438c-4a64-b679-ae501e7d6091", # Barbershop Man ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") llm.register_function("switch_voice", switch_voice) tools = [ diff --git a/examples/foundational/15a-switch-languages.py b/examples/foundational/15a-switch-languages.py index 0e7cb7c3c..2b9449242 100644 --- a/examples/foundational/15a-switch-languages.py +++ b/examples/foundational/15a-switch-languages.py @@ -73,7 +73,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): voice_id="d4db5fb9-f44b-4bd1-85fa-192e0f0d75f9", # Spanish-speaking Lady ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") llm.register_function("switch_language", switch_language) tools = [ diff --git a/examples/foundational/16-gpu-container-local-bot.py b/examples/foundational/16-gpu-container-local-bot.py index d23b29271..16ea36cf1 100644 --- a/examples/foundational/16-gpu-container-local-bot.py +++ b/examples/foundational/16-gpu-container-local-bot.py @@ -54,7 +54,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): llm = OpenAILLMService( # To use OpenAI # api_key=os.getenv("OPENAI_API_KEY"), - # model="gpt-4o" + # model="gpt-4.1" # Or, to use a local vLLM (or similar) api server model="meta-llama/Meta-Llama-3-8B-Instruct", base_url="http://0.0.0.0:8000/v1", diff --git a/examples/foundational/17-detect-user-idle.py b/examples/foundational/17-detect-user-idle.py index d7630c798..1bed5361a 100644 --- a/examples/foundational/17-detect-user-idle.py +++ b/examples/foundational/17-detect-user-idle.py @@ -47,7 +47,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): voice_id="71a7ad14-091c-4e8e-a314-022ece01c121", # British Reading Lady ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") messages = [ { diff --git a/examples/foundational/20a-persistent-context-openai.py b/examples/foundational/20a-persistent-context-openai.py index 22950e0fa..07a94a944 100644 --- a/examples/foundational/20a-persistent-context-openai.py +++ b/examples/foundational/20a-persistent-context-openai.py @@ -185,7 +185,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): voice_id="71a7ad14-091c-4e8e-a314-022ece01c121", # British Reading Lady ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") # you can either register a single function for all function calls, or specific functions # llm.register_function(None, fetch_weather_from_api) diff --git a/examples/foundational/22-natural-conversation.py b/examples/foundational/22-natural-conversation.py index e2047c7aa..f53ea551c 100644 --- a/examples/foundational/22-natural-conversation.py +++ b/examples/foundational/22-natural-conversation.py @@ -56,7 +56,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): # statement. This doesn't really need to be an LLM, we could use NLP # libraries for that, but it was easier as an example because we # leverage the context aggregators. - statement_llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o") + statement_llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") statement_messages = [ { @@ -69,7 +69,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): statement_context_aggregator = statement_llm.create_context_aggregator(statement_context) # This is the regular LLM. - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") messages = [ { diff --git a/examples/foundational/22b-natural-conversation-proposal.py b/examples/foundational/22b-natural-conversation-proposal.py index 05538bec0..feae4c922 100644 --- a/examples/foundational/22b-natural-conversation-proposal.py +++ b/examples/foundational/22b-natural-conversation-proposal.py @@ -224,10 +224,10 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): # This is the LLM that will be used to detect if the user has finished a # statement. This doesn't really need to be an LLM, we could use NLP # libraries for that, but we have the machinery to use an LLM, so we might as well! - statement_llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o") + statement_llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") # This is the regular LLM. - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") # You can also register a function_name of None to get all functions # sent to the same callback with an additional function_name parameter. llm.register_function("get_current_weather", fetch_weather_from_api) diff --git a/examples/foundational/22c-natural-conversation-mixed-llms.py b/examples/foundational/22c-natural-conversation-mixed-llms.py index 7d0d0a16b..dc24565d6 100644 --- a/examples/foundational/22c-natural-conversation-mixed-llms.py +++ b/examples/foundational/22c-natural-conversation-mixed-llms.py @@ -436,7 +436,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): # This is the regular LLM. llm = OpenAILLMService( api_key=os.getenv("OPENAI_API_KEY"), - model="gpt-4o", + model="gpt-4.1", ) # Register a function_name of None to get all functions # sent to the same callback with an additional function_name parameter. diff --git a/examples/foundational/23-bot-background-sound-daily.py b/examples/foundational/23-bot-background-sound-daily.py index 0379b0a11..f0a298bcc 100644 --- a/examples/foundational/23-bot-background-sound-daily.py +++ b/examples/foundational/23-bot-background-sound-daily.py @@ -62,7 +62,7 @@ async def main(): voice_id="71a7ad14-091c-4e8e-a314-022ece01c121", # British Reading Lady ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") messages = [ { diff --git a/examples/foundational/23-bot-background-sound-p2p.py b/examples/foundational/23-bot-background-sound-p2p.py index d854770c7..b046f2e83 100644 --- a/examples/foundational/23-bot-background-sound-p2p.py +++ b/examples/foundational/23-bot-background-sound-p2p.py @@ -4,15 +4,13 @@ # SPDX-License-Identifier: BSD 2-Clause License # -""" -Usage +"""Usage ----- Set the path to your background audio file using the `INPUT_AUDIO_PATH` environment variable, then run the bot using: INPUT_AUDIO_PATH=path/to/your_audio.mp3 python 23-bot-background-sound.py Example: - INPUT_AUDIO_PATH=my_audio.mp3 python 23-bot-background-sound.py """ @@ -71,7 +69,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): voice_id="71a7ad14-091c-4e8e-a314-022ece01c121", # British Reading Lady ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") messages = [ { diff --git a/examples/foundational/24-stt-mute-filter.py b/examples/foundational/24-stt-mute-filter.py index fb00c3114..66dbb1267 100644 --- a/examples/foundational/24-stt-mute-filter.py +++ b/examples/foundational/24-stt-mute-filter.py @@ -64,7 +64,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): tts = DeepgramTTSService(api_key=os.getenv("DEEPGRAM_API_KEY"), voice="aura-helios-en") - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") llm.register_function("get_current_weather", fetch_weather_from_api) weather_function = FunctionSchema( diff --git a/examples/foundational/28-transcription-processor.py b/examples/foundational/28-transcription-processor.py index 069235a4e..ee49e35f9 100644 --- a/examples/foundational/28-transcription-processor.py +++ b/examples/foundational/28-transcription-processor.py @@ -111,7 +111,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): llm = OpenAILLMService( api_key=os.getenv("OPENAI_API_KEY"), - model="gpt-4o", + model="gpt-4.1", ) messages = [ diff --git a/examples/foundational/29-livekit-audio-chat.py b/examples/foundational/29-livekit-audio-chat.py index d761e5418..bf22db4c7 100644 --- a/examples/foundational/29-livekit-audio-chat.py +++ b/examples/foundational/29-livekit-audio-chat.py @@ -127,7 +127,7 @@ async def main(): ), ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") tts = CartesiaTTSService( api_key=os.getenv("CARTESIA_API_KEY"), diff --git a/examples/foundational/30-observer.py b/examples/foundational/30-observer.py index b53a0a026..98a794c3a 100644 --- a/examples/foundational/30-observer.py +++ b/examples/foundational/30-observer.py @@ -88,7 +88,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): voice_id="71a7ad14-091c-4e8e-a314-022ece01c121", # British Reading Lady ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") messages = [ { diff --git a/examples/foundational/35-pattern-pair-voice-switching.py b/examples/foundational/35-pattern-pair-voice-switching.py index c12dfea72..63ca604e1 100644 --- a/examples/foundational/35-pattern-pair-voice-switching.py +++ b/examples/foundational/35-pattern-pair-voice-switching.py @@ -120,7 +120,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): ) # Initialize LLM - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") # System prompt for storytelling with voice switching system_prompt = """You are an engaging storyteller that uses different voices to bring stories to life. diff --git a/examples/foundational/36-user-email-gathering.py b/examples/foundational/36-user-email-gathering.py index 8cbb826c8..767584740 100644 --- a/examples/foundational/36-user-email-gathering.py +++ b/examples/foundational/36-user-email-gathering.py @@ -63,7 +63,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): # aiohttp_session=session, # ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") # You can aslo register a function_name of None to get all functions # sent to the same callback with an additional function_name parameter. llm.register_function("store_user_emails", store_user_emails) diff --git a/examples/moondream-chatbot/bot.py b/examples/moondream-chatbot/bot.py index 4b2303959..ec19f3de4 100644 --- a/examples/moondream-chatbot/bot.py +++ b/examples/moondream-chatbot/bot.py @@ -156,7 +156,7 @@ async def main(): voice_id="71a7ad14-091c-4e8e-a314-022ece01c121", # British Reading Lady ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") ta = TalkingAnimation() diff --git a/examples/patient-intake/bot.py b/examples/patient-intake/bot.py index cf2d5ed92..fba48531e 100644 --- a/examples/patient-intake/bot.py +++ b/examples/patient-intake/bot.py @@ -324,7 +324,7 @@ async def main(): # voice_id="846d6cb0-2301-48b6-9683-48f5618ea2f6", # Spanish-speaking Lady # ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") messages = [] context = OpenAILLMContext(messages=messages) diff --git a/examples/phone-chatbot/bot_twilio.py b/examples/phone-chatbot/bot_twilio.py index 0ffbdb122..2022bd8f0 100644 --- a/examples/phone-chatbot/bot_twilio.py +++ b/examples/phone-chatbot/bot_twilio.py @@ -60,7 +60,7 @@ async def main(room_url: str, token: str, callId: str, sipUri: str): voice_id=os.getenv("ELEVENLABS_VOICE_ID", ""), ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") messages = [ { diff --git a/examples/phone-chatbot/call_transfer.py b/examples/phone-chatbot/call_transfer.py index aae460ec4..ccb762efa 100644 --- a/examples/phone-chatbot/call_transfer.py +++ b/examples/phone-chatbot/call_transfer.py @@ -305,7 +305,7 @@ async def main( tools = ToolsSchema(standard_tools=[terminate_call_function, dial_operator_function]) # Initialize LLM - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") # Register functions with the LLM llm.register_function( diff --git a/examples/phone-chatbot/simple_dialin.py b/examples/phone-chatbot/simple_dialin.py index cc06837dd..faa6a9d4f 100644 --- a/examples/phone-chatbot/simple_dialin.py +++ b/examples/phone-chatbot/simple_dialin.py @@ -129,7 +129,7 @@ async def main( system_instruction = """You are Chatbot, a friendly, helpful robot. Your goal is to demonstrate your capabilities in a succinct way. Your output will be converted to audio so don't include special characters in your answers. Respond to what the user said in a creative and helpful way, but keep your responses brief. Start by introducing yourself. If the user ends the conversation, **IMMEDIATELY** call the `terminate_call` function. """ # Initialize LLM - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") # Register functions with the LLM llm.register_function("terminate_call", terminate_call) diff --git a/examples/phone-chatbot/simple_dialout.py b/examples/phone-chatbot/simple_dialout.py index 9686d935a..08610c760 100644 --- a/examples/phone-chatbot/simple_dialout.py +++ b/examples/phone-chatbot/simple_dialout.py @@ -101,7 +101,7 @@ async def main( system_instruction = """You are Chatbot, a friendly, helpful robot. Your goal is to demonstrate your capabilities in a succinct way. Your output will be converted to audio so don't include special characters in your answers. Respond to what the user said in a creative and helpful way, but keep your responses brief. Start by introducing yourself. If the user ends the conversation, **IMMEDIATELY** call the `terminate_call` function. """ # Initialize LLM - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") # Register functions with the LLM llm.register_function("terminate_call", terminate_call) diff --git a/examples/sentry-metrics/bot.py b/examples/sentry-metrics/bot.py index 28e470955..452d47c6e 100644 --- a/examples/sentry-metrics/bot.py +++ b/examples/sentry-metrics/bot.py @@ -63,7 +63,7 @@ async def main(): llm = OpenAILLMService( api_key=os.getenv("OPENAI_API_KEY"), - model="gpt-4o", + model="gpt-4.1", metrics=SentryMetrics(), ) diff --git a/examples/simple-chatbot/server/bot-openai.py b/examples/simple-chatbot/server/bot-openai.py index 3ad29a28d..23aee786d 100644 --- a/examples/simple-chatbot/server/bot-openai.py +++ b/examples/simple-chatbot/server/bot-openai.py @@ -155,7 +155,7 @@ async def main(): ) # Initialize LLM service - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") messages = [ { diff --git a/examples/telnyx-chatbot/bot.py b/examples/telnyx-chatbot/bot.py index 4d8584bfb..a568ca150 100644 --- a/examples/telnyx-chatbot/bot.py +++ b/examples/telnyx-chatbot/bot.py @@ -48,7 +48,7 @@ async def run_bot( ), ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") stt = DeepgramSTTService(api_key=os.getenv("DEEPGRAM_API_KEY")) diff --git a/examples/translation-chatbot/bot.py b/examples/translation-chatbot/bot.py index 88c9c66b7..93e1c93c8 100644 --- a/examples/translation-chatbot/bot.py +++ b/examples/translation-chatbot/bot.py @@ -150,7 +150,7 @@ async def main(): in_language = "English" out_language = "Spanish" - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") context = OpenAILLMContext() context_aggregator = llm.create_context_aggregator(context) diff --git a/examples/twilio-chatbot/bot.py b/examples/twilio-chatbot/bot.py index 6821d8139..f2cf02e8e 100644 --- a/examples/twilio-chatbot/bot.py +++ b/examples/twilio-chatbot/bot.py @@ -68,7 +68,7 @@ async def run_bot(websocket_client: WebSocket, stream_sid: str, testing: bool): ), ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") stt = DeepgramSTTService(api_key=os.getenv("DEEPGRAM_API_KEY"), audio_passthrough=True) diff --git a/examples/twilio-chatbot/client.py b/examples/twilio-chatbot/client.py index e5826fb19..6142e25b1 100644 --- a/examples/twilio-chatbot/client.py +++ b/examples/twilio-chatbot/client.py @@ -98,7 +98,7 @@ async def run_client(client_name: str, server_url: str, duration_secs: int): ), ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") # We let the audio passthrough so we can record the conversation. stt = DeepgramSTTService( diff --git a/examples/websocket-server/bot.py b/examples/websocket-server/bot.py index 0e2f1d4b0..ebd72a336 100644 --- a/examples/websocket-server/bot.py +++ b/examples/websocket-server/bot.py @@ -91,7 +91,7 @@ async def main(): ) ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") stt = DeepgramSTTService(api_key=os.getenv("DEEPGRAM_API_KEY")) diff --git a/tests/integration/test_integration_unified_function_calling.py b/tests/integration/test_integration_unified_function_calling.py index 26dcb0d73..a8155e957 100644 --- a/tests/integration/test_integration_unified_function_calling.py +++ b/tests/integration/test_integration_unified_function_calling.py @@ -80,7 +80,7 @@ async def _test_llm_function_calling(llm: LLMService): @pytest.mark.skipif(os.getenv("OPENAI_API_KEY") is None, reason="OPENAI_API_KEY is not set") @pytest.mark.asyncio async def test_unified_function_calling_openai(): - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") # This will fail if an exception is raised await _test_llm_function_calling(llm) From ad40a0f0767baa9c5a41c674d76cb0819864f212 Mon Sep 17 00:00:00 2001 From: Mark Backman Date: Tue, 15 Apr 2025 15:11:05 -0400 Subject: [PATCH 2/3] Update OpenAILLMService and OpenPipeLLMService to use gpt-4.1 by default --- CHANGELOG.md | 3 +++ src/pipecat/services/openai/llm.py | 2 +- src/pipecat/services/openpipe/llm.py | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5255835f4..13577e342 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- `OpenAILLMService` and `OpenPipeLLMService` now use `gpt-4.1` as their + default model. + - `SoundfileMixer` constructor arguments need to be keywords. ### Fixed diff --git a/src/pipecat/services/openai/llm.py b/src/pipecat/services/openai/llm.py index 5ca51a479..0b634c01b 100644 --- a/src/pipecat/services/openai/llm.py +++ b/src/pipecat/services/openai/llm.py @@ -38,7 +38,7 @@ class OpenAILLMService(BaseOpenAILLMService): def __init__( self, *, - model: str = "gpt-4o", + model: str = "gpt-4.1", params: BaseOpenAILLMService.InputParams = BaseOpenAILLMService.InputParams(), **kwargs, ): diff --git a/src/pipecat/services/openpipe/llm.py b/src/pipecat/services/openpipe/llm.py index 63e499714..2a2dd1d26 100644 --- a/src/pipecat/services/openpipe/llm.py +++ b/src/pipecat/services/openpipe/llm.py @@ -25,7 +25,7 @@ class OpenPipeLLMService(OpenAILLMService): def __init__( self, *, - model: str = "gpt-4o", + model: str = "gpt-4.1", api_key: Optional[str] = None, base_url: Optional[str] = None, openpipe_api_key: Optional[str] = None, From 5f3bbf9828b4ece517c49afef765499d7a015ba9 Mon Sep 17 00:00:00 2001 From: Mark Backman Date: Wed, 16 Apr 2025 08:27:10 -0400 Subject: [PATCH 3/3] Rely on default OpenAI model for examples and tests --- examples/canonical-metrics/bot.py | 2 +- examples/chatbot-audio-recording/bot.py | 2 +- examples/deployment/flyio-example/bot.py | 2 +- examples/deployment/modal-example/bot.py | 2 +- examples/deployment/pipecat-cloud-example/bot.py | 2 +- examples/foundational/02-llm-say-one-thing.py | 2 +- examples/foundational/05-sync-speech-and-image.py | 2 +- .../foundational/05a-local-sync-speech-and-image.py | 2 +- examples/foundational/06-listen-and-respond.py | 2 +- examples/foundational/06a-image-sync.py | 2 +- examples/foundational/07-interruptible.py | 2 +- examples/foundational/07a-interruptible-vad.py | 2 +- .../foundational/07c-interruptible-deepgram-vad.py | 2 +- examples/foundational/07c-interruptible-deepgram.py | 2 +- .../foundational/07d-interruptible-elevenlabs-http.py | 2 +- examples/foundational/07d-interruptible-elevenlabs.py | 2 +- examples/foundational/07e-interruptible-playht-http.py | 2 +- examples/foundational/07e-interruptible-playht.py | 2 +- examples/foundational/07g-interruptible-openai.py | 2 +- examples/foundational/07h-interruptible-openpipe.py | 1 - examples/foundational/07i-interruptible-xtts.py | 2 +- examples/foundational/07j-interruptible-gladia.py | 2 +- examples/foundational/07k-interruptible-lmnt.py | 2 +- examples/foundational/07m-interruptible-polly.py | 2 +- examples/foundational/07o-interruptible-assemblyai.py | 2 +- examples/foundational/07p-interruptible-krisp.py | 2 +- examples/foundational/07q-interruptible-rime-http.py | 2 +- examples/foundational/07q-interruptible-rime.py | 2 +- examples/foundational/07t-interruptible-fish.py | 2 +- .../foundational/07v-interruptible-neuphonic-http.py | 2 +- examples/foundational/07v-interruptible-neuphonic.py | 2 +- examples/foundational/07w-interruptible-fal.py | 2 +- examples/foundational/07x-interruptible-local.py | 2 +- examples/foundational/10-wake-phrase.py | 2 +- examples/foundational/11-sound-effects.py | 2 +- examples/foundational/12b-describe-video-gpt-4o.py | 2 +- examples/foundational/14-function-calling.py | 2 +- examples/foundational/14d-function-calling-video.py | 2 +- examples/foundational/15-switch-voices.py | 2 +- examples/foundational/15a-switch-languages.py | 2 +- examples/foundational/16-gpu-container-local-bot.py | 1 - examples/foundational/17-detect-user-idle.py | 2 +- examples/foundational/20a-persistent-context-openai.py | 2 +- examples/foundational/22-natural-conversation.py | 4 ++-- .../foundational/22b-natural-conversation-proposal.py | 4 ++-- .../22c-natural-conversation-mixed-llms.py | 10 ++-------- examples/foundational/23-bot-background-sound-daily.py | 2 +- examples/foundational/23-bot-background-sound-p2p.py | 2 +- examples/foundational/24-stt-mute-filter.py | 2 +- examples/foundational/28-transcription-processor.py | 5 +---- examples/foundational/29-livekit-audio-chat.py | 2 +- examples/foundational/30-observer.py | 2 +- .../foundational/35-pattern-pair-voice-switching.py | 2 +- examples/foundational/36-user-email-gathering.py | 2 +- examples/moondream-chatbot/bot.py | 2 +- examples/patient-intake/bot.py | 2 +- examples/phone-chatbot/bot_twilio.py | 2 +- examples/phone-chatbot/call_transfer.py | 2 +- examples/phone-chatbot/simple_dialin.py | 2 +- examples/phone-chatbot/simple_dialout.py | 2 +- examples/sentry-metrics/bot.py | 1 - examples/simple-chatbot/server/bot-openai.py | 2 +- examples/telnyx-chatbot/bot.py | 2 +- examples/translation-chatbot/bot.py | 2 +- examples/twilio-chatbot/bot.py | 2 +- examples/twilio-chatbot/client.py | 2 +- examples/websocket-server/bot.py | 2 +- .../test_integration_unified_function_calling.py | 2 +- 68 files changed, 68 insertions(+), 80 deletions(-) diff --git a/examples/canonical-metrics/bot.py b/examples/canonical-metrics/bot.py index 0d31f1df5..d14f4149e 100644 --- a/examples/canonical-metrics/bot.py +++ b/examples/canonical-metrics/bot.py @@ -72,7 +72,7 @@ async def main(): # voice_id="gD1IexrzCvsXPHUuT0s3", ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY")) messages = [ { diff --git a/examples/chatbot-audio-recording/bot.py b/examples/chatbot-audio-recording/bot.py index 5fa6f5aaa..c3e20ecfe 100644 --- a/examples/chatbot-audio-recording/bot.py +++ b/examples/chatbot-audio-recording/bot.py @@ -95,7 +95,7 @@ async def main(): # voice_id="gD1IexrzCvsXPHUuT0s3", ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY")) messages = [ { diff --git a/examples/deployment/flyio-example/bot.py b/examples/deployment/flyio-example/bot.py index 83e058434..7e5bef3ee 100644 --- a/examples/deployment/flyio-example/bot.py +++ b/examples/deployment/flyio-example/bot.py @@ -53,7 +53,7 @@ async def main(room_url: str, token: str): voice_id=os.getenv("ELEVENLABS_VOICE_ID", ""), ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY")) messages = [ { diff --git a/examples/deployment/modal-example/bot.py b/examples/deployment/modal-example/bot.py index 1c4423c10..327c6a5e4 100644 --- a/examples/deployment/modal-example/bot.py +++ b/examples/deployment/modal-example/bot.py @@ -43,7 +43,7 @@ async def main(room_url: str, token: str): api_key=os.getenv("CARTESIA_API_KEY", ""), voice_id="71a7ad14-091c-4e8e-a314-022ece01c121" ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY")) messages = [ { diff --git a/examples/deployment/pipecat-cloud-example/bot.py b/examples/deployment/pipecat-cloud-example/bot.py index 4e2ddfbd4..d86c7f575 100644 --- a/examples/deployment/pipecat-cloud-example/bot.py +++ b/examples/deployment/pipecat-cloud-example/bot.py @@ -61,7 +61,7 @@ async def main(room_url: str, token: str): api_key=os.getenv("CARTESIA_API_KEY"), voice_id="79a125e8-cd45-4c13-8a67-188112f4dd22" ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY")) messages = [ { diff --git a/examples/foundational/02-llm-say-one-thing.py b/examples/foundational/02-llm-say-one-thing.py index 84651499b..94d2b27f7 100644 --- a/examples/foundational/02-llm-say-one-thing.py +++ b/examples/foundational/02-llm-say-one-thing.py @@ -38,7 +38,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): voice_id="71a7ad14-091c-4e8e-a314-022ece01c121", # British Reading Lady ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY")) messages = [ { diff --git a/examples/foundational/05-sync-speech-and-image.py b/examples/foundational/05-sync-speech-and-image.py index 2213089c8..9021dbf54 100644 --- a/examples/foundational/05-sync-speech-and-image.py +++ b/examples/foundational/05-sync-speech-and-image.py @@ -85,7 +85,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): # Create an HTTP session for API calls async with aiohttp.ClientSession() as session: - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY")) tts = CartesiaHttpTTSService( api_key=os.getenv("CARTESIA_API_KEY"), diff --git a/examples/foundational/05a-local-sync-speech-and-image.py b/examples/foundational/05a-local-sync-speech-and-image.py index 4a7b32ba7..77486d247 100644 --- a/examples/foundational/05a-local-sync-speech-and-image.py +++ b/examples/foundational/05a-local-sync-speech-and-image.py @@ -93,7 +93,7 @@ async def main(): self.frame = frame await self.push_frame(frame, direction) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY")) tts = CartesiaHttpTTSService( api_key=os.getenv("CARTESIA_API_KEY"), diff --git a/examples/foundational/06-listen-and-respond.py b/examples/foundational/06-listen-and-respond.py index 9d197d3e3..c41c39748 100644 --- a/examples/foundational/06-listen-and-respond.py +++ b/examples/foundational/06-listen-and-respond.py @@ -73,7 +73,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): voice_id="71a7ad14-091c-4e8e-a314-022ece01c121", # British Reading Lady ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY")) ml = MetricsLogger() diff --git a/examples/foundational/06a-image-sync.py b/examples/foundational/06a-image-sync.py index 17f42578e..8ebe5400c 100644 --- a/examples/foundational/06a-image-sync.py +++ b/examples/foundational/06a-image-sync.py @@ -91,7 +91,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): voice_id="71a7ad14-091c-4e8e-a314-022ece01c121", # British Reading Lady ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY")) messages = [ { diff --git a/examples/foundational/07-interruptible.py b/examples/foundational/07-interruptible.py index 34b24a748..a94dfad4b 100644 --- a/examples/foundational/07-interruptible.py +++ b/examples/foundational/07-interruptible.py @@ -45,7 +45,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): voice_id="71a7ad14-091c-4e8e-a314-022ece01c121", # British Reading Lady ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY")) messages = [ { diff --git a/examples/foundational/07a-interruptible-vad.py b/examples/foundational/07a-interruptible-vad.py index af1e64916..a146ad636 100644 --- a/examples/foundational/07a-interruptible-vad.py +++ b/examples/foundational/07a-interruptible-vad.py @@ -44,7 +44,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): voice_id="71a7ad14-091c-4e8e-a314-022ece01c121", # British Reading Lady ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY")) messages = [ { diff --git a/examples/foundational/07c-interruptible-deepgram-vad.py b/examples/foundational/07c-interruptible-deepgram-vad.py index 118b46ec3..366644be6 100644 --- a/examples/foundational/07c-interruptible-deepgram-vad.py +++ b/examples/foundational/07c-interruptible-deepgram-vad.py @@ -48,7 +48,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): tts = DeepgramTTSService(api_key=os.getenv("DEEPGRAM_API_KEY"), voice="aura-helios-en") - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY")) messages = [ { diff --git a/examples/foundational/07c-interruptible-deepgram.py b/examples/foundational/07c-interruptible-deepgram.py index 6b5cdcce0..12081480d 100644 --- a/examples/foundational/07c-interruptible-deepgram.py +++ b/examples/foundational/07c-interruptible-deepgram.py @@ -42,7 +42,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): tts = DeepgramTTSService(api_key=os.getenv("DEEPGRAM_API_KEY"), voice="aura-helios-en") - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY")) messages = [ { diff --git a/examples/foundational/07d-interruptible-elevenlabs-http.py b/examples/foundational/07d-interruptible-elevenlabs-http.py index 42590254d..4984897bc 100644 --- a/examples/foundational/07d-interruptible-elevenlabs-http.py +++ b/examples/foundational/07d-interruptible-elevenlabs-http.py @@ -49,7 +49,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): aiohttp_session=session, ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY")) messages = [ { diff --git a/examples/foundational/07d-interruptible-elevenlabs.py b/examples/foundational/07d-interruptible-elevenlabs.py index 27dd5cd72..fe31c12b7 100644 --- a/examples/foundational/07d-interruptible-elevenlabs.py +++ b/examples/foundational/07d-interruptible-elevenlabs.py @@ -45,7 +45,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): voice_id=os.getenv("ELEVENLABS_VOICE_ID", ""), ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY")) messages = [ { diff --git a/examples/foundational/07e-interruptible-playht-http.py b/examples/foundational/07e-interruptible-playht-http.py index c7d18083a..394fff2ce 100644 --- a/examples/foundational/07e-interruptible-playht-http.py +++ b/examples/foundational/07e-interruptible-playht-http.py @@ -46,7 +46,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): voice_url="s3://voice-cloning-zero-shot/d9ff78ba-d016-47f6-b0ef-dd630f59414e/female-cs/manifest.json", ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY")) messages = [ { diff --git a/examples/foundational/07e-interruptible-playht.py b/examples/foundational/07e-interruptible-playht.py index 952ff0a76..a1b5dddf9 100644 --- a/examples/foundational/07e-interruptible-playht.py +++ b/examples/foundational/07e-interruptible-playht.py @@ -48,7 +48,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): params=PlayHTTTSService.InputParams(language=Language.EN), ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY")) messages = [ { diff --git a/examples/foundational/07g-interruptible-openai.py b/examples/foundational/07g-interruptible-openai.py index 931b5fc5e..3bc019ad1 100644 --- a/examples/foundational/07g-interruptible-openai.py +++ b/examples/foundational/07g-interruptible-openai.py @@ -46,7 +46,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): tts = OpenAITTSService(api_key=os.getenv("OPENAI_API_KEY"), voice="ballad") - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY")) messages = [ { diff --git a/examples/foundational/07h-interruptible-openpipe.py b/examples/foundational/07h-interruptible-openpipe.py index 4574198aa..633e0cf15 100644 --- a/examples/foundational/07h-interruptible-openpipe.py +++ b/examples/foundational/07h-interruptible-openpipe.py @@ -50,7 +50,6 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): llm = OpenPipeLLMService( api_key=os.getenv("OPENAI_API_KEY"), openpipe_api_key=os.getenv("OPENPIPE_API_KEY"), - model="gpt-4.1", tags={"conversation_id": f"pipecat-{timestamp}"}, ) diff --git a/examples/foundational/07i-interruptible-xtts.py b/examples/foundational/07i-interruptible-xtts.py index a4ae4f2be..aa64425fd 100644 --- a/examples/foundational/07i-interruptible-xtts.py +++ b/examples/foundational/07i-interruptible-xtts.py @@ -49,7 +49,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): base_url="http://localhost:8000", ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY")) messages = [ { diff --git a/examples/foundational/07j-interruptible-gladia.py b/examples/foundational/07j-interruptible-gladia.py index 1d526db48..4ed903ea6 100644 --- a/examples/foundational/07j-interruptible-gladia.py +++ b/examples/foundational/07j-interruptible-gladia.py @@ -54,7 +54,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): voice_id="71a7ad14-091c-4e8e-a314-022ece01c121", # British Reading Lady ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY", ""), model="gpt-4.1") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY", "")) messages = [ { diff --git a/examples/foundational/07k-interruptible-lmnt.py b/examples/foundational/07k-interruptible-lmnt.py index 65129e7ce..092e4758f 100644 --- a/examples/foundational/07k-interruptible-lmnt.py +++ b/examples/foundational/07k-interruptible-lmnt.py @@ -42,7 +42,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): tts = LmntTTSService(api_key=os.getenv("LMNT_API_KEY"), voice_id="morgan") - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY")) messages = [ { diff --git a/examples/foundational/07m-interruptible-polly.py b/examples/foundational/07m-interruptible-polly.py index 83b13fbaa..6fe09619d 100644 --- a/examples/foundational/07m-interruptible-polly.py +++ b/examples/foundational/07m-interruptible-polly.py @@ -48,7 +48,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): params=PollyTTSService.InputParams(engine="neural", language="en-GB", rate="1.05"), ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY")) messages = [ { diff --git a/examples/foundational/07o-interruptible-assemblyai.py b/examples/foundational/07o-interruptible-assemblyai.py index 2302aa97c..137060651 100644 --- a/examples/foundational/07o-interruptible-assemblyai.py +++ b/examples/foundational/07o-interruptible-assemblyai.py @@ -47,7 +47,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): voice_id="71a7ad14-091c-4e8e-a314-022ece01c121", # British Reading Lady ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY")) messages = [ { diff --git a/examples/foundational/07p-interruptible-krisp.py b/examples/foundational/07p-interruptible-krisp.py index 399f52f3b..1f650363e 100644 --- a/examples/foundational/07p-interruptible-krisp.py +++ b/examples/foundational/07p-interruptible-krisp.py @@ -44,7 +44,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): tts = DeepgramTTSService(api_key=os.getenv("DEEPGRAM_API_KEY"), voice="aura-helios-en") - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY")) messages = [ { diff --git a/examples/foundational/07q-interruptible-rime-http.py b/examples/foundational/07q-interruptible-rime-http.py index df2166d69..c5dedf63a 100644 --- a/examples/foundational/07q-interruptible-rime-http.py +++ b/examples/foundational/07q-interruptible-rime-http.py @@ -49,7 +49,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): aiohttp_session=session, ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY")) messages = [ { diff --git a/examples/foundational/07q-interruptible-rime.py b/examples/foundational/07q-interruptible-rime.py index 8d836ba01..3df39ef6c 100644 --- a/examples/foundational/07q-interruptible-rime.py +++ b/examples/foundational/07q-interruptible-rime.py @@ -45,7 +45,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): voice_id="rex", ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY")) messages = [ { diff --git a/examples/foundational/07t-interruptible-fish.py b/examples/foundational/07t-interruptible-fish.py index a5827a704..160bbddaf 100644 --- a/examples/foundational/07t-interruptible-fish.py +++ b/examples/foundational/07t-interruptible-fish.py @@ -45,7 +45,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): model="4ce7e917cedd4bc2bb2e6ff3a46acaa1", # Barack Obama ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY")) messages = [ { diff --git a/examples/foundational/07v-interruptible-neuphonic-http.py b/examples/foundational/07v-interruptible-neuphonic-http.py index a1f57d5f4..f1db00454 100644 --- a/examples/foundational/07v-interruptible-neuphonic-http.py +++ b/examples/foundational/07v-interruptible-neuphonic-http.py @@ -45,7 +45,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): voice_id="fc854436-2dac-4d21-aa69-ae17b54e98eb", # Emily ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY")) messages = [ { diff --git a/examples/foundational/07v-interruptible-neuphonic.py b/examples/foundational/07v-interruptible-neuphonic.py index f566c285c..25df4e2e6 100644 --- a/examples/foundational/07v-interruptible-neuphonic.py +++ b/examples/foundational/07v-interruptible-neuphonic.py @@ -45,7 +45,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): voice_id="fc854436-2dac-4d21-aa69-ae17b54e98eb", # Emily ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY")) messages = [ { diff --git a/examples/foundational/07w-interruptible-fal.py b/examples/foundational/07w-interruptible-fal.py index 26e22f2bf..6c1b71937 100644 --- a/examples/foundational/07w-interruptible-fal.py +++ b/examples/foundational/07w-interruptible-fal.py @@ -47,7 +47,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): voice_id="71a7ad14-091c-4e8e-a314-022ece01c121", # British Reading Lady ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY")) messages = [ { diff --git a/examples/foundational/07x-interruptible-local.py b/examples/foundational/07x-interruptible-local.py index bc9620cec..5027e8bcb 100644 --- a/examples/foundational/07x-interruptible-local.py +++ b/examples/foundational/07x-interruptible-local.py @@ -45,7 +45,7 @@ async def main(): voice_id="71a7ad14-091c-4e8e-a314-022ece01c121", # British Reading Lady ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY")) messages = [ { diff --git a/examples/foundational/10-wake-phrase.py b/examples/foundational/10-wake-phrase.py index 8b0b746e7..4fb19343d 100644 --- a/examples/foundational/10-wake-phrase.py +++ b/examples/foundational/10-wake-phrase.py @@ -47,7 +47,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): voice_id="71a7ad14-091c-4e8e-a314-022ece01c121", # British Reading Lady ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY")) messages = [ { diff --git a/examples/foundational/11-sound-effects.py b/examples/foundational/11-sound-effects.py index 5a900f78a..4a70d15d1 100644 --- a/examples/foundational/11-sound-effects.py +++ b/examples/foundational/11-sound-effects.py @@ -93,7 +93,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): stt = DeepgramSTTService(api_key=os.getenv("DEEPGRAM_API_KEY")) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY")) tts = CartesiaTTSService( api_key=os.getenv("CARTESIA_API_KEY"), diff --git a/examples/foundational/12b-describe-video-gpt-4o.py b/examples/foundational/12b-describe-video-gpt-4o.py index 7958edabc..c676390cc 100644 --- a/examples/foundational/12b-describe-video-gpt-4o.py +++ b/examples/foundational/12b-describe-video-gpt-4o.py @@ -74,7 +74,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): stt = DeepgramSTTService(api_key=os.getenv("DEEPGRAM_API_KEY")) # OpenAI GPT-4o for vision analysis - openai = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") + openai = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY")) tts = CartesiaTTSService( api_key=os.getenv("CARTESIA_API_KEY"), diff --git a/examples/foundational/14-function-calling.py b/examples/foundational/14-function-calling.py index fbc2e11e8..31a6417f4 100644 --- a/examples/foundational/14-function-calling.py +++ b/examples/foundational/14-function-calling.py @@ -53,7 +53,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): voice_id="71a7ad14-091c-4e8e-a314-022ece01c121", # British Reading Lady ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY")) # You can also register a function_name of None to get all functions # sent to the same callback with an additional function_name parameter. diff --git a/examples/foundational/14d-function-calling-video.py b/examples/foundational/14d-function-calling-video.py index a3840ca2d..e51dc96dd 100644 --- a/examples/foundational/14d-function-calling-video.py +++ b/examples/foundational/14d-function-calling-video.py @@ -82,7 +82,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): voice_id="71a7ad14-091c-4e8e-a314-022ece01c121", # British Reading Lady ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY")) llm.register_function("get_weather", get_weather) llm.register_function("get_image", get_image) diff --git a/examples/foundational/15-switch-voices.py b/examples/foundational/15-switch-voices.py index cf93d8858..14aeab76a 100644 --- a/examples/foundational/15-switch-voices.py +++ b/examples/foundational/15-switch-voices.py @@ -83,7 +83,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): voice_id="a0e99841-438c-4a64-b679-ae501e7d6091", # Barbershop Man ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY")) llm.register_function("switch_voice", switch_voice) tools = [ diff --git a/examples/foundational/15a-switch-languages.py b/examples/foundational/15a-switch-languages.py index 2b9449242..de89721db 100644 --- a/examples/foundational/15a-switch-languages.py +++ b/examples/foundational/15a-switch-languages.py @@ -73,7 +73,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): voice_id="d4db5fb9-f44b-4bd1-85fa-192e0f0d75f9", # Spanish-speaking Lady ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY")) llm.register_function("switch_language", switch_language) tools = [ diff --git a/examples/foundational/16-gpu-container-local-bot.py b/examples/foundational/16-gpu-container-local-bot.py index 16ea36cf1..4853764fc 100644 --- a/examples/foundational/16-gpu-container-local-bot.py +++ b/examples/foundational/16-gpu-container-local-bot.py @@ -54,7 +54,6 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): llm = OpenAILLMService( # To use OpenAI # api_key=os.getenv("OPENAI_API_KEY"), - # model="gpt-4.1" # Or, to use a local vLLM (or similar) api server model="meta-llama/Meta-Llama-3-8B-Instruct", base_url="http://0.0.0.0:8000/v1", diff --git a/examples/foundational/17-detect-user-idle.py b/examples/foundational/17-detect-user-idle.py index 1bed5361a..2f1652a0f 100644 --- a/examples/foundational/17-detect-user-idle.py +++ b/examples/foundational/17-detect-user-idle.py @@ -47,7 +47,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): voice_id="71a7ad14-091c-4e8e-a314-022ece01c121", # British Reading Lady ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY")) messages = [ { diff --git a/examples/foundational/20a-persistent-context-openai.py b/examples/foundational/20a-persistent-context-openai.py index 07a94a944..bba3fc00e 100644 --- a/examples/foundational/20a-persistent-context-openai.py +++ b/examples/foundational/20a-persistent-context-openai.py @@ -185,7 +185,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): voice_id="71a7ad14-091c-4e8e-a314-022ece01c121", # British Reading Lady ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY")) # you can either register a single function for all function calls, or specific functions # llm.register_function(None, fetch_weather_from_api) diff --git a/examples/foundational/22-natural-conversation.py b/examples/foundational/22-natural-conversation.py index f53ea551c..0878d4831 100644 --- a/examples/foundational/22-natural-conversation.py +++ b/examples/foundational/22-natural-conversation.py @@ -56,7 +56,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): # statement. This doesn't really need to be an LLM, we could use NLP # libraries for that, but it was easier as an example because we # leverage the context aggregators. - statement_llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") + statement_llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY")) statement_messages = [ { @@ -69,7 +69,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): statement_context_aggregator = statement_llm.create_context_aggregator(statement_context) # This is the regular LLM. - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY")) messages = [ { diff --git a/examples/foundational/22b-natural-conversation-proposal.py b/examples/foundational/22b-natural-conversation-proposal.py index feae4c922..b6e89556f 100644 --- a/examples/foundational/22b-natural-conversation-proposal.py +++ b/examples/foundational/22b-natural-conversation-proposal.py @@ -224,10 +224,10 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): # This is the LLM that will be used to detect if the user has finished a # statement. This doesn't really need to be an LLM, we could use NLP # libraries for that, but we have the machinery to use an LLM, so we might as well! - statement_llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") + statement_llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY")) # This is the regular LLM. - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY")) # You can also register a function_name of None to get all functions # sent to the same callback with an additional function_name parameter. llm.register_function("get_current_weather", fetch_weather_from_api) diff --git a/examples/foundational/22c-natural-conversation-mixed-llms.py b/examples/foundational/22c-natural-conversation-mixed-llms.py index dc24565d6..e6b0d0df7 100644 --- a/examples/foundational/22c-natural-conversation-mixed-llms.py +++ b/examples/foundational/22c-natural-conversation-mixed-llms.py @@ -428,16 +428,10 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): # This is the LLM that will be used to detect if the user has finished a # statement. This doesn't really need to be an LLM, we could use NLP # libraries for that, but we have the machinery to use an LLM, so we might as well! - statement_llm = AnthropicLLMService( - api_key=os.getenv("ANTHROPIC_API_KEY"), - model="claude-3-5-sonnet-20241022", - ) + statement_llm = AnthropicLLMService(api_key=os.getenv("ANTHROPIC_API_KEY")) # This is the regular LLM. - llm = OpenAILLMService( - api_key=os.getenv("OPENAI_API_KEY"), - model="gpt-4.1", - ) + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY")) # Register a function_name of None to get all functions # sent to the same callback with an additional function_name parameter. llm.register_function("get_current_weather", fetch_weather_from_api) diff --git a/examples/foundational/23-bot-background-sound-daily.py b/examples/foundational/23-bot-background-sound-daily.py index f0a298bcc..97947d768 100644 --- a/examples/foundational/23-bot-background-sound-daily.py +++ b/examples/foundational/23-bot-background-sound-daily.py @@ -62,7 +62,7 @@ async def main(): voice_id="71a7ad14-091c-4e8e-a314-022ece01c121", # British Reading Lady ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY")) messages = [ { diff --git a/examples/foundational/23-bot-background-sound-p2p.py b/examples/foundational/23-bot-background-sound-p2p.py index b046f2e83..f18c58971 100644 --- a/examples/foundational/23-bot-background-sound-p2p.py +++ b/examples/foundational/23-bot-background-sound-p2p.py @@ -69,7 +69,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): voice_id="71a7ad14-091c-4e8e-a314-022ece01c121", # British Reading Lady ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY")) messages = [ { diff --git a/examples/foundational/24-stt-mute-filter.py b/examples/foundational/24-stt-mute-filter.py index 66dbb1267..98f054143 100644 --- a/examples/foundational/24-stt-mute-filter.py +++ b/examples/foundational/24-stt-mute-filter.py @@ -64,7 +64,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): tts = DeepgramTTSService(api_key=os.getenv("DEEPGRAM_API_KEY"), voice="aura-helios-en") - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY")) llm.register_function("get_current_weather", fetch_weather_from_api) weather_function = FunctionSchema( diff --git a/examples/foundational/28-transcription-processor.py b/examples/foundational/28-transcription-processor.py index ee49e35f9..42e31d5f6 100644 --- a/examples/foundational/28-transcription-processor.py +++ b/examples/foundational/28-transcription-processor.py @@ -109,10 +109,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): voice_id="71a7ad14-091c-4e8e-a314-022ece01c121", # British Reading Lady ) - llm = OpenAILLMService( - api_key=os.getenv("OPENAI_API_KEY"), - model="gpt-4.1", - ) + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY")) messages = [ { diff --git a/examples/foundational/29-livekit-audio-chat.py b/examples/foundational/29-livekit-audio-chat.py index bf22db4c7..b8d44deb7 100644 --- a/examples/foundational/29-livekit-audio-chat.py +++ b/examples/foundational/29-livekit-audio-chat.py @@ -127,7 +127,7 @@ async def main(): ), ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY")) tts = CartesiaTTSService( api_key=os.getenv("CARTESIA_API_KEY"), diff --git a/examples/foundational/30-observer.py b/examples/foundational/30-observer.py index 98a794c3a..ad11f2267 100644 --- a/examples/foundational/30-observer.py +++ b/examples/foundational/30-observer.py @@ -88,7 +88,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): voice_id="71a7ad14-091c-4e8e-a314-022ece01c121", # British Reading Lady ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY")) messages = [ { diff --git a/examples/foundational/35-pattern-pair-voice-switching.py b/examples/foundational/35-pattern-pair-voice-switching.py index 63ca604e1..aadbe0cc3 100644 --- a/examples/foundational/35-pattern-pair-voice-switching.py +++ b/examples/foundational/35-pattern-pair-voice-switching.py @@ -120,7 +120,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): ) # Initialize LLM - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY")) # System prompt for storytelling with voice switching system_prompt = """You are an engaging storyteller that uses different voices to bring stories to life. diff --git a/examples/foundational/36-user-email-gathering.py b/examples/foundational/36-user-email-gathering.py index 767584740..39958ce79 100644 --- a/examples/foundational/36-user-email-gathering.py +++ b/examples/foundational/36-user-email-gathering.py @@ -63,7 +63,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): # aiohttp_session=session, # ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY")) # You can aslo register a function_name of None to get all functions # sent to the same callback with an additional function_name parameter. llm.register_function("store_user_emails", store_user_emails) diff --git a/examples/moondream-chatbot/bot.py b/examples/moondream-chatbot/bot.py index ec19f3de4..87bc7e5fc 100644 --- a/examples/moondream-chatbot/bot.py +++ b/examples/moondream-chatbot/bot.py @@ -156,7 +156,7 @@ async def main(): voice_id="71a7ad14-091c-4e8e-a314-022ece01c121", # British Reading Lady ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY")) ta = TalkingAnimation() diff --git a/examples/patient-intake/bot.py b/examples/patient-intake/bot.py index fba48531e..64bb11743 100644 --- a/examples/patient-intake/bot.py +++ b/examples/patient-intake/bot.py @@ -324,7 +324,7 @@ async def main(): # voice_id="846d6cb0-2301-48b6-9683-48f5618ea2f6", # Spanish-speaking Lady # ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY")) messages = [] context = OpenAILLMContext(messages=messages) diff --git a/examples/phone-chatbot/bot_twilio.py b/examples/phone-chatbot/bot_twilio.py index 2022bd8f0..9f7740320 100644 --- a/examples/phone-chatbot/bot_twilio.py +++ b/examples/phone-chatbot/bot_twilio.py @@ -60,7 +60,7 @@ async def main(room_url: str, token: str, callId: str, sipUri: str): voice_id=os.getenv("ELEVENLABS_VOICE_ID", ""), ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY")) messages = [ { diff --git a/examples/phone-chatbot/call_transfer.py b/examples/phone-chatbot/call_transfer.py index ccb762efa..487391c67 100644 --- a/examples/phone-chatbot/call_transfer.py +++ b/examples/phone-chatbot/call_transfer.py @@ -305,7 +305,7 @@ async def main( tools = ToolsSchema(standard_tools=[terminate_call_function, dial_operator_function]) # Initialize LLM - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY")) # Register functions with the LLM llm.register_function( diff --git a/examples/phone-chatbot/simple_dialin.py b/examples/phone-chatbot/simple_dialin.py index faa6a9d4f..dee51f865 100644 --- a/examples/phone-chatbot/simple_dialin.py +++ b/examples/phone-chatbot/simple_dialin.py @@ -129,7 +129,7 @@ async def main( system_instruction = """You are Chatbot, a friendly, helpful robot. Your goal is to demonstrate your capabilities in a succinct way. Your output will be converted to audio so don't include special characters in your answers. Respond to what the user said in a creative and helpful way, but keep your responses brief. Start by introducing yourself. If the user ends the conversation, **IMMEDIATELY** call the `terminate_call` function. """ # Initialize LLM - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY")) # Register functions with the LLM llm.register_function("terminate_call", terminate_call) diff --git a/examples/phone-chatbot/simple_dialout.py b/examples/phone-chatbot/simple_dialout.py index 08610c760..6b15d3af8 100644 --- a/examples/phone-chatbot/simple_dialout.py +++ b/examples/phone-chatbot/simple_dialout.py @@ -101,7 +101,7 @@ async def main( system_instruction = """You are Chatbot, a friendly, helpful robot. Your goal is to demonstrate your capabilities in a succinct way. Your output will be converted to audio so don't include special characters in your answers. Respond to what the user said in a creative and helpful way, but keep your responses brief. Start by introducing yourself. If the user ends the conversation, **IMMEDIATELY** call the `terminate_call` function. """ # Initialize LLM - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY")) # Register functions with the LLM llm.register_function("terminate_call", terminate_call) diff --git a/examples/sentry-metrics/bot.py b/examples/sentry-metrics/bot.py index 452d47c6e..853911f2b 100644 --- a/examples/sentry-metrics/bot.py +++ b/examples/sentry-metrics/bot.py @@ -63,7 +63,6 @@ async def main(): llm = OpenAILLMService( api_key=os.getenv("OPENAI_API_KEY"), - model="gpt-4.1", metrics=SentryMetrics(), ) diff --git a/examples/simple-chatbot/server/bot-openai.py b/examples/simple-chatbot/server/bot-openai.py index 23aee786d..70f813f52 100644 --- a/examples/simple-chatbot/server/bot-openai.py +++ b/examples/simple-chatbot/server/bot-openai.py @@ -155,7 +155,7 @@ async def main(): ) # Initialize LLM service - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY")) messages = [ { diff --git a/examples/telnyx-chatbot/bot.py b/examples/telnyx-chatbot/bot.py index a568ca150..861aa1c7a 100644 --- a/examples/telnyx-chatbot/bot.py +++ b/examples/telnyx-chatbot/bot.py @@ -48,7 +48,7 @@ async def run_bot( ), ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY")) stt = DeepgramSTTService(api_key=os.getenv("DEEPGRAM_API_KEY")) diff --git a/examples/translation-chatbot/bot.py b/examples/translation-chatbot/bot.py index 93e1c93c8..b7611e3a3 100644 --- a/examples/translation-chatbot/bot.py +++ b/examples/translation-chatbot/bot.py @@ -150,7 +150,7 @@ async def main(): in_language = "English" out_language = "Spanish" - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY")) context = OpenAILLMContext() context_aggregator = llm.create_context_aggregator(context) diff --git a/examples/twilio-chatbot/bot.py b/examples/twilio-chatbot/bot.py index f2cf02e8e..9b1501aaf 100644 --- a/examples/twilio-chatbot/bot.py +++ b/examples/twilio-chatbot/bot.py @@ -68,7 +68,7 @@ async def run_bot(websocket_client: WebSocket, stream_sid: str, testing: bool): ), ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY")) stt = DeepgramSTTService(api_key=os.getenv("DEEPGRAM_API_KEY"), audio_passthrough=True) diff --git a/examples/twilio-chatbot/client.py b/examples/twilio-chatbot/client.py index 6142e25b1..97cca0cd0 100644 --- a/examples/twilio-chatbot/client.py +++ b/examples/twilio-chatbot/client.py @@ -98,7 +98,7 @@ async def run_client(client_name: str, server_url: str, duration_secs: int): ), ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY")) # We let the audio passthrough so we can record the conversation. stt = DeepgramSTTService( diff --git a/examples/websocket-server/bot.py b/examples/websocket-server/bot.py index ebd72a336..2f08f8b43 100644 --- a/examples/websocket-server/bot.py +++ b/examples/websocket-server/bot.py @@ -91,7 +91,7 @@ async def main(): ) ) - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY")) stt = DeepgramSTTService(api_key=os.getenv("DEEPGRAM_API_KEY")) diff --git a/tests/integration/test_integration_unified_function_calling.py b/tests/integration/test_integration_unified_function_calling.py index a8155e957..09611fd3a 100644 --- a/tests/integration/test_integration_unified_function_calling.py +++ b/tests/integration/test_integration_unified_function_calling.py @@ -80,7 +80,7 @@ async def _test_llm_function_calling(llm: LLMService): @pytest.mark.skipif(os.getenv("OPENAI_API_KEY") is None, reason="OPENAI_API_KEY is not set") @pytest.mark.asyncio async def test_unified_function_calling_openai(): - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4.1") + llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY")) # This will fail if an exception is raised await _test_llm_function_calling(llm)