From 6ad3437fd2b3511b7aef91d4f9785b30ff0dc1ec Mon Sep 17 00:00:00 2001 From: Kwindla Hultman Kramer Date: Sun, 29 Sep 2024 21:10:21 -0700 Subject: [PATCH] throw error if the llm tries to call a function that's not registered --- src/pipecat/services/openai.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/pipecat/services/openai.py b/src/pipecat/services/openai.py index 73dae4644..8a032ea40 100644 --- a/src/pipecat/services/openai.py +++ b/src/pipecat/services/openai.py @@ -288,6 +288,10 @@ class BaseOpenAILLMService(LLMService): tool_call_id=tool_id, run_llm=run_llm, ) + else: + raise OpenAIUnhandledFunctionException( + f"The LLM tried to call a function named '{function_name}', but there isn't a callback registered for that function." + ) async def _update_settings(self, frame: LLMUpdateSettingsFrame): if frame.model is not None: