Skip to content

Send a phone call from AI agent, in an API call. Or, directly call the bot from the configured phone number!

Python

fix: OpenAI hallucination for calling tools

Clémence Lesnéf50f0dd69850
diff --git a/main.py b/main.py
index 6e68d2a..b80c4bd 100644
--- a/main.py
+++ b/main.py
@@ -1,4 +1,7 @@
-from typing import List, Optional
+# See: https://community.openai.com/t/model-tries-to-call-unknown-function-multi-tool-use-parallel/490653/23
+import openai_multi_tool_use_parallel_patch
+
+# General imports
from azure.communication.callautomation import (
CallAutomationClient,
CallConnectionClient,
diff --git a/requirements.txt b/requirements.txt
index 9f958c6..e8e6009 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -6,6 +6,7 @@ azure-eventgrid==4.16.0
azure-identity==1.15.0
fastapi==0.108.0
jinja2==3.1.3
+openai-multi-tool-use-parallel-patch==0.2.0
openai==1.8.0
phonenumbers==8.13.28
pydantic-extra-types==2.4.1