Function calling
-
I am using the Free version of AI Engine. What a great plugin! Love it!
I am trying to use the Function Calling option.
I have made sure that Rest API is fully functioning on my website.
I have created a mwai_allow_public_api snippet
I have also created a get_game_data snippet that is set up as a (dynamic) Callable Function
I have created a chatbot that begins with calling the get_game_data function, and when the user enters a number (for example paas3) the functions looks through either a CSV-file or Excel-file (using SimpleXLSX.php) on my server and should return data from specific columns in the file.
But for some reason the chatbot does not recognize it as a callable function. Instead it writes out the entire command (try it on spillegudsrige.dk/paaskespillet – try for example to write ‘paas3’)
I have tried to add the function to my WordPress theme’s functions.php
Nothing helps.
Why doesn’t the chatbot recognize the callable function get_game_data that I have created using Code Engine (I have of course tried ‘Test’)?
Are there limitations because I am using the Free version?
Here is the Instruction I have given to the chatbot:The user enters a number of the event they want to read about.
You now call theget_game_data
function with the following parameters:"lookup_value": "{user_input}"
"column_name": "easterevents_number"
"requested_columns": ["easterevents_number", "easterevents_day", "easterevents_day_time", "easterevents_day_city", "easterevents_day_city_location", "easterevents_day_description", "easterevents_imageurl", "locations_props_numbers", "locations_props", "locations_props_imageurl", "jerusalem_locations_number", "jerusalem_locations", "jerusalem_locations_props", "jerusalem_locations_imageurl", "nazareth_locations_number", "nazareth_locations", "nazareth_locations_props", "nazareth_locations_imageurl", "bethlehem_locations_number", "bethlehem_locations", "bethlehem_locations_props", "bethlehem_locations_imageurl", "capernaum_locations_number", "capernaum_locations", "capernaum_locations_props", "capernaum_locations_imageurl", "betania_locations_number", "betania_locations", "betania_locations_props", "betania_locations_imageurl", "persongallery_number", "persongallery", "persongallery_imageurl", "persongallery_characteristics", "persongallery_locations_easterdays_and_mysteries", "persongallery_mysteryparticipation", "mystery1_props_number", "mystery1_props", "mystery1_props_location_or_person", "mystery1_props_imageurl", "mystery2_props_number", "mystery2_props", "mystery2_props_location_or_person", "mystery2_props_imageurl", "mystery3_props_number", "mystery3_props", "mystery3_props_location_or_person", "mystery3_props_imageurl"]
Replace
{user_input}
with the actual number the user entered.After retrieving the information from
get_game_data
, you show the user the following:- Image of the event (
easterevents_imageurl
). - Easter day and time (
easterevents_day
,easterevents_day_time
). - Description of the event (
easterevents_day_description
). - List of people present (
peoplegallery
). - List of available props (
locations_props
).
Use the data you get back from
get_game_data
and format it into an easy-to-read and vividly narrated message for the user.Example output:
"[Image]<br>It's {Easter_events_day} {Easter_events_day_time}. What's happening: {Easter_events_day_description}.<br>People present: {people_gallery}.<br>Props at the location/people: {locations_props}"
The page I need help with: [log in to see the link]
- You must be logged in to reply to this topic.