This post pretends to be a basic example to someone starting the road using a function call from Openai Assistants, and at the same time I am looking for some help to find what I am missing.
To do this example i readed and used a part of the great post of @rafaelsanchezrd (Mastering OpenAI Function Calling in Make.com (Formerly Integromat) | by Hideyuki Shibata | Dec, 2024 | Medium) and a part of the great post of @hideyukishibata (Mastering OpenAI Function Calling in Make.com (Formerly Integromat) | by Hideyuki Shibata | Dec, 2024 | Medium)
Well let’s start to showcase the example
Image 1
Our Assistant is ready and has a function to call in case the assistant decides to call it.
For the purpose of this example the Assistant may use: reservar_visita to perform the appointment on google calendar.
here is the defined function
NOW LETS TAKE A LOOK AT THE MAKE MODULES SIDE
WE HAVE 2 SCENARIOS
ONE SCENARIO HAVE 2 MODULES
LETS SEE HOW IT WORKS
Image 7 we have a set user module and the OpenAI message assistant module
Image 8
The set User Message has a var name: MensajeUsuario with a value that is precisely data needed to send to the OpenAI Assistant
Image 9
The Assistant will use the data received and call the webhook of the other SCENARIO
THE OTHER SCENARIO
Image-10
Image 11
WE have the webhook URL that is called by the Assistant (as seen on image 9)
Image 12
We have the connection to our calendar, the minimum time required value we use the datetime requested to the appointment. (with desired format DD-MM-YYY HHMM) and maximum time i used {{addHours(1.fecha_hora; 1)}} to add 1 hour to the datetime requested to appoitment.
…And note we have access to the 4 vars related to the appointment data required (date, duration, name, email)
Image 13
We have the router that has filters to go to create the event or to not create., depending on the availability of date requested to appointment on the google calendar.
LETS SEE IN ACTION, WE HAVE ALMOST ALL DAYS FREE
First we must start (clic to RUN) the webhook SCENARIO
immediately we go to OTHER SCENARIO and start it (clic to RUN)
Image 17
***Remember we use the following data on the set User Message for this testing.
Finally we obtain the webhook SCENARIO with all modules having a number 1 inside a circle, this means we have executed and have results.
Image 19
As you can note, the webhook received the data provided by the other SCENARIO, by the set User Message as seen on image 17
Image 20
Lets see what is received by the Google Calendar Get Free/Busy module
Image 21
Finally we have the send response webhook with the results! the event was successfully created
AND on the Other side we have this
Image 22
As we can see, the data that we manually added (as seen on image 17) has his OUTPUT side, and it is exactly the same information.
Image 23
Lets see what is on the inside of the openai assistant module. We could see that the output corresponds to a successful appointment created., so lets see our calendar
OUR CALENDAR talks itself, THE APPOINTMENT is DONE! (9 of february at 6 pm)
SO, OUR SCENARIOS WORKS PERFECTLY!
NOW THE OPENAI PLATFORM SIDE
WE GO to the Openai Assistant Playground to do the same by giving the data to the Assistant
Image 25
We say to the Assistant: Hola quiero reservar una visita (hi, i want to appoint a visit), the Assistant recognize that there is a function with data definition required for this type of user request and response by asking the name, datetime, email, duration
Image 26
So we provide the data required by the Assistant as follow:
mi nombre es carlos maidana, la visita sera para en domingo 10 de febrero del 2025 a las 18hs, mi correo es carlosmaria.asesorinmobiliario@gmail.com
and we note that the Assistant is making the function call reservar_visita
Now we proceed to input OK to complete de action required (on the playground we must complete manually the action required)
AND we could see that the Assistant says that the appointment was created…
Let’s see if it is true or not… look at our google calendar
WELL the appointment definitely was not created
Final words, Can someone please illuminate us by giving what could be the issue or what is missing on the Openai Assistant or the make side of this example Maybe @rafaelsanchezrd or @hideyukishibata
THANKS IN ADVANCE!!! REGARDS!!