From 6cc01bc5b0a11a310054890d474e92c874e589cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleix=20Conchillo=20Flaqu=C3=A9?= Date: Sun, 26 Jan 2025 15:40:15 -0800 Subject: [PATCH] examples: update 14 series with TTSSpeakFrame --- examples/foundational/14-function-calling.py | 4 ++-- examples/foundational/14c-function-calling-together.py | 4 ++-- examples/foundational/14f-function-calling-groq.py | 4 ++-- examples/foundational/14g-function-calling-grok.py | 4 ++-- examples/foundational/14h-function-calling-azure.py | 4 ++-- examples/foundational/14i-function-calling-fireworks.py | 4 ++-- examples/foundational/14j-function-calling-nim.py | 4 ++-- examples/foundational/14k-function-calling-cerebras.py | 6 +++--- examples/foundational/14l-function-calling-deepseek.py | 6 +++--- examples/foundational/14m-function-calling-openrouter.py | 4 ++-- 10 files changed, 22 insertions(+), 22 deletions(-) diff --git a/examples/foundational/14-function-calling.py b/examples/foundational/14-function-calling.py index 013164c67..5ce8693cc 100644 --- a/examples/foundational/14-function-calling.py +++ b/examples/foundational/14-function-calling.py @@ -15,7 +15,7 @@ from openai.types.chat import ChatCompletionToolParam from runner import configure from pipecat.audio.vad.silero import SileroVADAnalyzer -from pipecat.frames.frames import TextFrame +from pipecat.frames.frames import TTSSpeakFrame from pipecat.pipeline.pipeline import Pipeline from pipecat.pipeline.runner import PipelineRunner from pipecat.pipeline.task import PipelineParams, PipelineTask @@ -31,7 +31,7 @@ logger.add(sys.stderr, level="DEBUG") async def start_fetch_weather(function_name, llm, context): """Push a frame to the LLM; this is handy when the LLM response might take a while.""" - await llm.push_frame(TextFrame("Let me check on that.")) + await llm.push_frame(TTSSpeakFrame("Let me check on that.")) logger.debug(f"Starting fetch_weather_from_api with function_name: {function_name}") diff --git a/examples/foundational/14c-function-calling-together.py b/examples/foundational/14c-function-calling-together.py index 41baba457..9c981f7bc 100644 --- a/examples/foundational/14c-function-calling-together.py +++ b/examples/foundational/14c-function-calling-together.py @@ -15,7 +15,7 @@ from openai.types.chat import ChatCompletionToolParam from runner import configure from pipecat.audio.vad.silero import SileroVADAnalyzer -from pipecat.frames.frames import TextFrame +from pipecat.frames.frames import TTSSpeakFrame from pipecat.pipeline.pipeline import Pipeline from pipecat.pipeline.runner import PipelineRunner from pipecat.pipeline.task import PipelineTask @@ -32,7 +32,7 @@ logger.add(sys.stderr, level="DEBUG") async def start_fetch_weather(function_name, llm, context): """Push a frame to the LLM; this is handy when the LLM response might take a while.""" - await llm.push_frame(TextFrame("Let me check on that.")) + await llm.push_frame(TTSSpeakFrame("Let me check on that.")) logger.debug(f"Starting fetch_weather_from_api with function_name: {function_name}") diff --git a/examples/foundational/14f-function-calling-groq.py b/examples/foundational/14f-function-calling-groq.py index 2b927637c..ee36b513f 100644 --- a/examples/foundational/14f-function-calling-groq.py +++ b/examples/foundational/14f-function-calling-groq.py @@ -15,7 +15,7 @@ from openai.types.chat import ChatCompletionToolParam from runner import configure from pipecat.audio.vad.silero import SileroVADAnalyzer -from pipecat.frames.frames import TextFrame +from pipecat.frames.frames import TTSSpeakFrame from pipecat.pipeline.pipeline import Pipeline from pipecat.pipeline.runner import PipelineRunner from pipecat.pipeline.task import PipelineParams, PipelineTask @@ -32,7 +32,7 @@ logger.add(sys.stderr, level="DEBUG") async def start_fetch_weather(function_name, llm, context): """Push a frame to the LLM; this is handy when the LLM response might take a while.""" - await llm.push_frame(TextFrame("Let me check on that.")) + await llm.push_frame(TTSSpeakFrame("Let me check on that.")) logger.debug(f"Starting fetch_weather_from_api with function_name: {function_name}") diff --git a/examples/foundational/14g-function-calling-grok.py b/examples/foundational/14g-function-calling-grok.py index 40c77c323..49b3d6831 100644 --- a/examples/foundational/14g-function-calling-grok.py +++ b/examples/foundational/14g-function-calling-grok.py @@ -15,7 +15,7 @@ from openai.types.chat import ChatCompletionToolParam from runner import configure from pipecat.audio.vad.silero import SileroVADAnalyzer -from pipecat.frames.frames import TextFrame +from pipecat.frames.frames import TTSSpeakFrame from pipecat.pipeline.pipeline import Pipeline from pipecat.pipeline.runner import PipelineRunner from pipecat.pipeline.task import PipelineParams, PipelineTask @@ -32,7 +32,7 @@ logger.add(sys.stderr, level="DEBUG") async def start_fetch_weather(function_name, llm, context): """Push a frame to the LLM; this is handy when the LLM response might take a while.""" - await llm.push_frame(TextFrame("Let me check on that.")) + await llm.push_frame(TTSSpeakFrame("Let me check on that.")) logger.debug(f"Starting fetch_weather_from_api with function_name: {function_name}") diff --git a/examples/foundational/14h-function-calling-azure.py b/examples/foundational/14h-function-calling-azure.py index f280e6de9..cd426366c 100644 --- a/examples/foundational/14h-function-calling-azure.py +++ b/examples/foundational/14h-function-calling-azure.py @@ -15,7 +15,7 @@ from openai.types.chat import ChatCompletionToolParam from runner import configure from pipecat.audio.vad.silero import SileroVADAnalyzer -from pipecat.frames.frames import TextFrame +from pipecat.frames.frames import TTSSpeakFrame from pipecat.pipeline.pipeline import Pipeline from pipecat.pipeline.runner import PipelineRunner from pipecat.pipeline.task import PipelineParams, PipelineTask @@ -32,7 +32,7 @@ logger.add(sys.stderr, level="DEBUG") async def start_fetch_weather(function_name, llm, context): """Push a frame to the LLM; this is handy when the LLM response might take a while.""" - await llm.push_frame(TextFrame("Let me check on that.")) + await llm.push_frame(TTSSpeakFrame("Let me check on that.")) logger.debug(f"Starting fetch_weather_from_api with function_name: {function_name}") diff --git a/examples/foundational/14i-function-calling-fireworks.py b/examples/foundational/14i-function-calling-fireworks.py index 241df5cf7..331e1c850 100644 --- a/examples/foundational/14i-function-calling-fireworks.py +++ b/examples/foundational/14i-function-calling-fireworks.py @@ -15,7 +15,7 @@ from openai.types.chat import ChatCompletionToolParam from runner import configure from pipecat.audio.vad.silero import SileroVADAnalyzer -from pipecat.frames.frames import TextFrame +from pipecat.frames.frames import TTSSpeakFrame from pipecat.pipeline.pipeline import Pipeline from pipecat.pipeline.runner import PipelineRunner from pipecat.pipeline.task import PipelineParams, PipelineTask @@ -32,7 +32,7 @@ logger.add(sys.stderr, level="DEBUG") async def start_fetch_weather(function_name, llm, context): """Push a frame to the LLM; this is handy when the LLM response might take a while.""" - await llm.push_frame(TextFrame("Let me check on that.")) + await llm.push_frame(TTSSpeakFrame("Let me check on that.")) logger.debug(f"Starting fetch_weather_from_api with function_name: {function_name}") diff --git a/examples/foundational/14j-function-calling-nim.py b/examples/foundational/14j-function-calling-nim.py index 08060fa0b..6a2d7d061 100644 --- a/examples/foundational/14j-function-calling-nim.py +++ b/examples/foundational/14j-function-calling-nim.py @@ -15,7 +15,7 @@ from openai.types.chat import ChatCompletionToolParam from runner import configure from pipecat.audio.vad.silero import SileroVADAnalyzer -from pipecat.frames.frames import TextFrame +from pipecat.frames.frames import TTSSpeakFrame from pipecat.pipeline.pipeline import Pipeline from pipecat.pipeline.runner import PipelineRunner from pipecat.pipeline.task import PipelineParams, PipelineTask @@ -32,7 +32,7 @@ logger.add(sys.stderr, level="DEBUG") async def start_fetch_weather(function_name, llm, context): """Push a frame to the LLM; this is handy when the LLM response might take a while.""" - await llm.push_frame(TextFrame("Let me check on that.")) + await llm.push_frame(TTSSpeakFrame("Let me check on that.")) logger.debug(f"Starting fetch_weather_from_api with function_name: {function_name}") diff --git a/examples/foundational/14k-function-calling-cerebras.py b/examples/foundational/14k-function-calling-cerebras.py index 176511a46..05f7d2a94 100644 --- a/examples/foundational/14k-function-calling-cerebras.py +++ b/examples/foundational/14k-function-calling-cerebras.py @@ -15,7 +15,7 @@ from openai.types.chat import ChatCompletionToolParam from runner import configure from pipecat.audio.vad.silero import SileroVADAnalyzer -from pipecat.frames.frames import TextFrame +from pipecat.frames.frames import TTSSpeakFrame from pipecat.pipeline.pipeline import Pipeline from pipecat.pipeline.runner import PipelineRunner from pipecat.pipeline.task import PipelineParams, PipelineTask @@ -32,7 +32,7 @@ logger.add(sys.stderr, level="DEBUG") async def start_fetch_weather(function_name, llm, context): """Push a frame to the LLM; this is handy when the LLM response might take a while.""" - await llm.push_frame(TextFrame("Let me check on that.")) + await llm.push_frame(TTSSpeakFrame("Let me check on that.")) logger.debug(f"Starting fetch_weather_from_api with function_name: {function_name}") @@ -93,7 +93,7 @@ async def main(): messages = [ { "role": "system", - "content": """You are a helpful LLM in a WebRTC call. Your goal is to demonstrate your capabilities in a succinct way. + "content": """You are a helpful LLM in a WebRTC call. Your goal is to demonstrate your capabilities in a succinct way. You have one functions available: diff --git a/examples/foundational/14l-function-calling-deepseek.py b/examples/foundational/14l-function-calling-deepseek.py index 50421a83b..8170c7d0f 100644 --- a/examples/foundational/14l-function-calling-deepseek.py +++ b/examples/foundational/14l-function-calling-deepseek.py @@ -15,7 +15,7 @@ from openai.types.chat import ChatCompletionToolParam from runner import configure from pipecat.audio.vad.silero import SileroVADAnalyzer -from pipecat.frames.frames import TextFrame +from pipecat.frames.frames import TTSSpeakFrame from pipecat.pipeline.pipeline import Pipeline from pipecat.pipeline.runner import PipelineRunner from pipecat.pipeline.task import PipelineParams, PipelineTask @@ -32,7 +32,7 @@ logger.add(sys.stderr, level="DEBUG") async def start_fetch_weather(function_name, llm, context): """Push a frame to the LLM; this is handy when the LLM response might take a while.""" - await llm.push_frame(TextFrame("Let me check on that.")) + await llm.push_frame(TTSSpeakFrame("Let me check on that.")) logger.debug(f"Starting fetch_weather_from_api with function_name: {function_name}") @@ -93,7 +93,7 @@ async def main(): messages = [ { "role": "system", - "content": """You are a helpful LLM in a WebRTC call. Your goal is to demonstrate your capabilities in a succinct way. + "content": """You are a helpful LLM in a WebRTC call. Your goal is to demonstrate your capabilities in a succinct way. You have one functions available: diff --git a/examples/foundational/14m-function-calling-openrouter.py b/examples/foundational/14m-function-calling-openrouter.py index 5252c9a5d..3325ab240 100644 --- a/examples/foundational/14m-function-calling-openrouter.py +++ b/examples/foundational/14m-function-calling-openrouter.py @@ -15,7 +15,7 @@ from openai.types.chat import ChatCompletionToolParam from runner import configure from pipecat.audio.vad.silero import SileroVADAnalyzer -from pipecat.frames.frames import TextFrame +from pipecat.frames.frames import TTSSpeakFrame from pipecat.pipeline.pipeline import Pipeline from pipecat.pipeline.runner import PipelineRunner from pipecat.pipeline.task import PipelineParams, PipelineTask @@ -32,7 +32,7 @@ logger.add(sys.stderr, level="DEBUG") async def start_fetch_weather(function_name, llm, context): """Push a frame to the LLM; this is handy when the LLM response might take a while.""" - await llm.push_frame(TextFrame("Let me check on that.")) + await llm.push_frame(TTSSpeakFrame("Let me check on that.")) logger.debug(f"Starting fetch_weather_from_api with function_name: {function_name}")