diff --git a/examples/foundational/14-function-calling.py b/examples/foundational/14-function-calling.py index 3d1b1f39b..013164c67 100644 --- a/examples/foundational/14-function-calling.py +++ b/examples/foundational/14-function-calling.py @@ -15,6 +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.pipeline.pipeline import Pipeline from pipecat.pipeline.runner import PipelineRunner from pipecat.pipeline.task import PipelineParams, PipelineTask @@ -29,11 +30,8 @@ logger.add(sys.stderr, level="DEBUG") async def start_fetch_weather(function_name, llm, context): - # note: we can't push a frame to the LLM here. the bot - # can interrupt itself and/or cause audio overlapping glitches. - # possible question for Aleix and Chad about what the right way - # to trigger speech is, now, with the new queues/async/sync refactors. - # await llm.push_frame(TextFrame("Let me check on that.")) + """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.")) 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 e7d110070..41baba457 100644 --- a/examples/foundational/14c-function-calling-together.py +++ b/examples/foundational/14c-function-calling-together.py @@ -15,6 +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.pipeline.pipeline import Pipeline from pipecat.pipeline.runner import PipelineRunner from pipecat.pipeline.task import PipelineTask @@ -30,11 +31,8 @@ logger.add(sys.stderr, level="DEBUG") async def start_fetch_weather(function_name, llm, context): - # note: we can't push a frame to the LLM here. the bot - # can interrupt itself and/or cause audio overlapping glitches. - # possible question for Aleix and Chad about what the right way - # to trigger speech is, now, with the new queues/async/sync refactors. - # await llm.push_frame(TextFrame("Let me check on that.")) + """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.")) 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 65ba9166f..2b927637c 100644 --- a/examples/foundational/14f-function-calling-groq.py +++ b/examples/foundational/14f-function-calling-groq.py @@ -15,6 +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.pipeline.pipeline import Pipeline from pipecat.pipeline.runner import PipelineRunner from pipecat.pipeline.task import PipelineParams, PipelineTask @@ -30,11 +31,8 @@ logger.add(sys.stderr, level="DEBUG") async def start_fetch_weather(function_name, llm, context): - # note: we can't push a frame to the LLM here. the bot - # can interrupt itself and/or cause audio overlapping glitches. - # possible question for Aleix and Chad about what the right way - # to trigger speech is, now, with the new queues/async/sync refactors. - # await llm.push_frame(TextFrame("Let me check on that.")) + """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.")) 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 f38663859..40c77c323 100644 --- a/examples/foundational/14g-function-calling-grok.py +++ b/examples/foundational/14g-function-calling-grok.py @@ -15,6 +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.pipeline.pipeline import Pipeline from pipecat.pipeline.runner import PipelineRunner from pipecat.pipeline.task import PipelineParams, PipelineTask @@ -30,11 +31,8 @@ logger.add(sys.stderr, level="DEBUG") async def start_fetch_weather(function_name, llm, context): - # note: we can't push a frame to the LLM here. the bot - # can interrupt itself and/or cause audio overlapping glitches. - # possible question for Aleix and Chad about what the right way - # to trigger speech is, now, with the new queues/async/sync refactors. - # await llm.push_frame(TextFrame("Let me check on that.")) + """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.")) 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 93aa9eaf5..f280e6de9 100644 --- a/examples/foundational/14h-function-calling-azure.py +++ b/examples/foundational/14h-function-calling-azure.py @@ -15,6 +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.pipeline.pipeline import Pipeline from pipecat.pipeline.runner import PipelineRunner from pipecat.pipeline.task import PipelineParams, PipelineTask @@ -30,11 +31,8 @@ logger.add(sys.stderr, level="DEBUG") async def start_fetch_weather(function_name, llm, context): - # note: we can't push a frame to the LLM here. the bot - # can interrupt itself and/or cause audio overlapping glitches. - # possible question for Aleix and Chad about what the right way - # to trigger speech is, now, with the new queues/async/sync refactors. - # await llm.push_frame(TextFrame("Let me check on that.")) + """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.")) 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 2befb7d19..241df5cf7 100644 --- a/examples/foundational/14i-function-calling-fireworks.py +++ b/examples/foundational/14i-function-calling-fireworks.py @@ -15,6 +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.pipeline.pipeline import Pipeline from pipecat.pipeline.runner import PipelineRunner from pipecat.pipeline.task import PipelineParams, PipelineTask @@ -30,11 +31,8 @@ logger.add(sys.stderr, level="DEBUG") async def start_fetch_weather(function_name, llm, context): - # note: we can't push a frame to the LLM here. the bot - # can interrupt itself and/or cause audio overlapping glitches. - # possible question for Aleix and Chad about what the right way - # to trigger speech is, now, with the new queues/async/sync refactors. - # await llm.push_frame(TextFrame("Let me check on that.")) + """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.")) 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 00a9fe67b..08060fa0b 100644 --- a/examples/foundational/14j-function-calling-nim.py +++ b/examples/foundational/14j-function-calling-nim.py @@ -15,6 +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.pipeline.pipeline import Pipeline from pipecat.pipeline.runner import PipelineRunner from pipecat.pipeline.task import PipelineParams, PipelineTask @@ -30,11 +31,8 @@ logger.add(sys.stderr, level="DEBUG") async def start_fetch_weather(function_name, llm, context): - # note: we can't push a frame to the LLM here. the bot - # can interrupt itself and/or cause audio overlapping glitches. - # possible question for Aleix and Chad about what the right way - # to trigger speech is, now, with the new queues/async/sync refactors. - # await llm.push_frame(TextFrame("Let me check on that.")) + """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.")) 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 5a53b7d0f..176511a46 100644 --- a/examples/foundational/14k-function-calling-cerebras.py +++ b/examples/foundational/14k-function-calling-cerebras.py @@ -15,6 +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.pipeline.pipeline import Pipeline from pipecat.pipeline.runner import PipelineRunner from pipecat.pipeline.task import PipelineParams, PipelineTask @@ -30,11 +31,8 @@ logger.add(sys.stderr, level="DEBUG") async def start_fetch_weather(function_name, llm, context): - # note: we can't push a frame to the LLM here. the bot - # can interrupt itself and/or cause audio overlapping glitches. - # possible question for Aleix and Chad about what the right way - # to trigger speech is, now, with the new queues/async/sync refactors. - # await llm.push_frame(TextFrame("Let me check on that.")) + """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.")) logger.debug(f"Starting fetch_weather_from_api with function_name: {function_name}") diff --git a/examples/foundational/14l-function-calling-deepseek.py b/examples/foundational/14l-function-calling-deepseek.py index b1ca1e250..50421a83b 100644 --- a/examples/foundational/14l-function-calling-deepseek.py +++ b/examples/foundational/14l-function-calling-deepseek.py @@ -15,6 +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.pipeline.pipeline import Pipeline from pipecat.pipeline.runner import PipelineRunner from pipecat.pipeline.task import PipelineParams, PipelineTask @@ -30,11 +31,8 @@ logger.add(sys.stderr, level="DEBUG") async def start_fetch_weather(function_name, llm, context): - # note: we can't push a frame to the LLM here. the bot - # can interrupt itself and/or cause audio overlapping glitches. - # possible question for Aleix and Chad about what the right way - # to trigger speech is, now, with the new queues/async/sync refactors. - # await llm.push_frame(TextFrame("Let me check on that.")) + """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.")) logger.debug(f"Starting fetch_weather_from_api with function_name: {function_name}") diff --git a/examples/foundational/14m-function-calling-openrouter.py b/examples/foundational/14m-function-calling-openrouter.py index 2535160e9..5252c9a5d 100644 --- a/examples/foundational/14m-function-calling-openrouter.py +++ b/examples/foundational/14m-function-calling-openrouter.py @@ -15,6 +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.pipeline.pipeline import Pipeline from pipecat.pipeline.runner import PipelineRunner from pipecat.pipeline.task import PipelineParams, PipelineTask @@ -30,11 +31,8 @@ logger.add(sys.stderr, level="DEBUG") async def start_fetch_weather(function_name, llm, context): - # note: we can't push a frame to the LLM here. the bot - # can interrupt itself and/or cause audio overlapping glitches. - # possible question for Aleix and Chad about what the right way - # to trigger speech is, now, with the new queues/async/sync refactors. - # await llm.push_frame(TextFrame("Let me check on that.")) + """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.")) logger.debug(f"Starting fetch_weather_from_api with function_name: {function_name}")