From 533c09741c614384cde94e7e5bb9e11fc3aa9a20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleix=20Conchillo=20Flaqu=C3=A9?= Date: Thu, 30 May 2024 14:38:13 -0700 Subject: [PATCH] examples: use gpt-4o model by default --- 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/06a-image-sync.py | 2 +- examples/foundational/07-interruptible.py | 2 +- examples/foundational/07c-interruptible-deepgram.py | 2 +- examples/foundational/11-sound-effects.py | 2 +- examples/foundational/14-function-calling.py | 2 +- examples/foundational/websocket-server/index.html | 4 ++-- examples/foundational/websocket-server/server.py | 4 ++-- examples/moondream-chatbot/bot.py | 2 +- examples/simple-chatbot/bot.py | 2 +- examples/storytelling-chatbot/src/bot.py | 2 +- examples/translation-chatbot/bot.py | 3 ++- src/pipecat/services/openai.py | 2 +- 15 files changed, 18 insertions(+), 17 deletions(-) diff --git a/examples/foundational/02-llm-say-one-thing.py b/examples/foundational/02-llm-say-one-thing.py index 7e12263dc..20756dcb6 100644 --- a/examples/foundational/02-llm-say-one-thing.py +++ b/examples/foundational/02-llm-say-one-thing.py @@ -44,7 +44,7 @@ async def main(room_url): llm = OpenAILLMService( api_key=os.getenv("OPENAI_API_KEY"), - model="gpt-4-turbo-preview") + model="gpt-4o") messages = [ { diff --git a/examples/foundational/05-sync-speech-and-image.py b/examples/foundational/05-sync-speech-and-image.py index 60dd50d07..f057c847c 100644 --- a/examples/foundational/05-sync-speech-and-image.py +++ b/examples/foundational/05-sync-speech-and-image.py @@ -93,7 +93,7 @@ async def main(room_url): llm = OpenAILLMService( api_key=os.getenv("OPENAI_API_KEY"), - model="gpt-4-turbo-preview") + model="gpt-4o") imagegen = FalImageGenService( params=FalImageGenService.InputParams( diff --git a/examples/foundational/05a-local-sync-speech-and-image.py b/examples/foundational/05a-local-sync-speech-and-image.py index bfbd453e2..d476754fb 100644 --- a/examples/foundational/05a-local-sync-speech-and-image.py +++ b/examples/foundational/05a-local-sync-speech-and-image.py @@ -76,7 +76,7 @@ async def main(): llm = OpenAILLMService( api_key=os.getenv("OPENAI_API_KEY"), - model="gpt-4-turbo-preview") + model="gpt-4o") tts = ElevenLabsTTSService( aiohttp_session=session, diff --git a/examples/foundational/06a-image-sync.py b/examples/foundational/06a-image-sync.py index 3ec2752b4..2f5528ee4 100644 --- a/examples/foundational/06a-image-sync.py +++ b/examples/foundational/06a-image-sync.py @@ -81,7 +81,7 @@ async def main(room_url: str, token): llm = OpenAILLMService( api_key=os.getenv("OPENAI_API_KEY"), - model="gpt-4-turbo-preview") + model="gpt-4o") messages = [ { diff --git a/examples/foundational/07-interruptible.py b/examples/foundational/07-interruptible.py index ce37344f0..9ed146774 100644 --- a/examples/foundational/07-interruptible.py +++ b/examples/foundational/07-interruptible.py @@ -53,7 +53,7 @@ async def main(room_url: str, token): llm = OpenAILLMService( api_key=os.getenv("OPENAI_API_KEY"), - model="gpt-4-turbo-preview") + model="gpt-4o") messages = [ { diff --git a/examples/foundational/07c-interruptible-deepgram.py b/examples/foundational/07c-interruptible-deepgram.py index 27245b02b..818c8bc93 100644 --- a/examples/foundational/07c-interruptible-deepgram.py +++ b/examples/foundational/07c-interruptible-deepgram.py @@ -53,7 +53,7 @@ async def main(room_url: str, token): llm = OpenAILLMService( api_key=os.getenv("OPENAI_API_KEY"), - model="gpt-4-turbo-preview") + model="gpt-4o") messages = [ { diff --git a/examples/foundational/11-sound-effects.py b/examples/foundational/11-sound-effects.py index 1ca568bf0..2a3e8effc 100644 --- a/examples/foundational/11-sound-effects.py +++ b/examples/foundational/11-sound-effects.py @@ -95,7 +95,7 @@ async def main(room_url: str, token): llm = OpenAILLMService( api_key=os.getenv("OPENAI_API_KEY"), - model="gpt-4-turbo-preview") + model="gpt-4o") tts = ElevenLabsTTSService( aiohttp_session=session, diff --git a/examples/foundational/14-function-calling.py b/examples/foundational/14-function-calling.py index aab799ae9..17b85e0aa 100644 --- a/examples/foundational/14-function-calling.py +++ b/examples/foundational/14-function-calling.py @@ -71,7 +71,7 @@ async def main(room_url: str, token): llm = OpenAILLMService( api_key=os.getenv("OPENAI_API_KEY"), - model="gpt-4-turbo-preview") + model="gpt-4o") llm.register_function( "get_current_weather", fetch_weather_from_api, diff --git a/examples/foundational/websocket-server/index.html b/examples/foundational/websocket-server/index.html index 0b51e05e3..c97ce5b41 100644 --- a/examples/foundational/websocket-server/index.html +++ b/examples/foundational/websocket-server/index.html @@ -92,8 +92,8 @@ const audioArray = new Uint8Array(audioVector); audioContext.decodeAudioData(audioArray.buffer, function(buffer) { - const source = new AudioBufferSourceNode(audioContext); - source.buffer = buffer; + const source = new AudioBufferSourceNode(audioContext); + source.buffer = buffer; source.start(playTime); source.connect(audioContext.destination); playTime = playTime + buffer.duration; diff --git a/examples/foundational/websocket-server/server.py b/examples/foundational/websocket-server/server.py index 45ac1352d..fa9fdc057 100644 --- a/examples/foundational/websocket-server/server.py +++ b/examples/foundational/websocket-server/server.py @@ -26,7 +26,7 @@ from dotenv import load_dotenv load_dotenv(override=True) logger.remove(0) -logger.add(sys.stderr, level="TRACE") +logger.add(sys.stderr, level="DEBUG") async def main(): @@ -37,7 +37,7 @@ async def main(): llm = OpenAILLMService( api_key=os.getenv("OPENAI_API_KEY"), - model="gpt-4-turbo-preview") + model="gpt-4o") stt = WhisperSTTService() diff --git a/examples/moondream-chatbot/bot.py b/examples/moondream-chatbot/bot.py index 7830cf46a..3e9ced259 100644 --- a/examples/moondream-chatbot/bot.py +++ b/examples/moondream-chatbot/bot.py @@ -145,7 +145,7 @@ async def main(room_url: str, token): llm = OpenAILLMService( api_key=os.getenv("OPENAI_API_KEY"), - model="gpt-4-turbo-preview") + model="gpt-4o") ta = TalkingAnimation() diff --git a/examples/simple-chatbot/bot.py b/examples/simple-chatbot/bot.py index a63b215ab..80b60833f 100644 --- a/examples/simple-chatbot/bot.py +++ b/examples/simple-chatbot/bot.py @@ -117,7 +117,7 @@ async def main(room_url: str, token): llm = OpenAILLMService( api_key=os.getenv("OPENAI_API_KEY"), - model="gpt-4-turbo-preview") + model="gpt-4o") messages = [ { diff --git a/examples/storytelling-chatbot/src/bot.py b/examples/storytelling-chatbot/src/bot.py index c5a75e949..96bb7626a 100644 --- a/examples/storytelling-chatbot/src/bot.py +++ b/examples/storytelling-chatbot/src/bot.py @@ -56,7 +56,7 @@ async def main(room_url, token=None): llm_service = OpenAILLMService( api_key=os.getenv("OPENAI_API_KEY"), - model="gpt-4-turbo" + model="gpt-4o" ) tts_service = ElevenLabsTTSService( diff --git a/examples/translation-chatbot/bot.py b/examples/translation-chatbot/bot.py index 89ca461b1..38667d897 100644 --- a/examples/translation-chatbot/bot.py +++ b/examples/translation-chatbot/bot.py @@ -97,7 +97,8 @@ async def main(room_url: str, token): ) llm = OpenAILLMService( - api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4-turbo-preview" + api_key=os.getenv("OPENAI_API_KEY"), + model="gpt-4o" ) sa = SentenceAggregator() diff --git a/src/pipecat/services/openai.py b/src/pipecat/services/openai.py index 5c9298d69..7e3685eeb 100644 --- a/src/pipecat/services/openai.py +++ b/src/pipecat/services/openai.py @@ -249,7 +249,7 @@ class BaseOpenAILLMService(LLMService): class OpenAILLMService(BaseOpenAILLMService): - def __init__(self, model="gpt-4", **kwargs): + def __init__(self, model="gpt-4o", **kwargs): super().__init__(model, **kwargs)