From 9cd7c82e77be4d2939a133cdb3d129a85fd2ed50 Mon Sep 17 00:00:00 2001 From: Kwindla Hultman Kramer Date: Mon, 30 Sep 2024 14:52:18 -0700 Subject: [PATCH] testing pushing a frame from function call start hook --- examples/foundational/14-function-calling.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/examples/foundational/14-function-calling.py b/examples/foundational/14-function-calling.py index 9141029ca..e260e8637 100644 --- a/examples/foundational/14-function-calling.py +++ b/examples/foundational/14-function-calling.py @@ -5,10 +5,15 @@ # import asyncio -import aiohttp import os import sys +import aiohttp +from dotenv import load_dotenv +from loguru import logger +from openai.types.chat import ChatCompletionToolParam +from runner import configure + from pipecat.frames.frames import TextFrame from pipecat.pipeline.pipeline import Pipeline from pipecat.pipeline.runner import PipelineRunner @@ -19,14 +24,6 @@ from pipecat.services.openai import OpenAILLMContext, OpenAILLMService from pipecat.transports.services.daily import DailyParams, DailyTransport from pipecat.vad.silero import SileroVADAnalyzer -from openai.types.chat import ChatCompletionToolParam - -from runner import configure - -from loguru import logger - -from dotenv import load_dotenv - load_dotenv(override=True) logger.remove(0) @@ -38,7 +35,7 @@ async def start_fetch_weather(function_name, llm, context): # 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.")) + await llm.push_frame(TextFrame("Let me check on that. ")) logger.debug(f"Starting fetch_weather_from_api with function_name: {function_name}")