Hi, I’m trying to integrate External APIs into my character and I’m running into issues with how the model generates responses.
Scenario:
I have a character that is supposed to provide real-time information, for example searches for points of interest (restaurants, ATMs, attractions, etc.) via an External API I configured called search_places, based on Google Places. I tested the API calls in my code and they work correctly.
However, when I chat with the character in the Playground:
sometimes the character responds correctly based on the real API results,
other times the character invents data that is not present in the API results,
or it mixes real API data with unverified information generated by the model.
Currently I am not using Narrative Design or advanced triggers — my character relies on the Character Description only.
My Character Description includes clear instructions such as:
“Never invent real-time data.
When updated information is requested (weather, places, etc.), always use external tools available to get reliable data.”
However this is not sufficient to guarantee that the model actually calls the API or correctly uses the returned data.
My specific question:
What is the recommended best practice for using External APIs with Convai so that the model does not hallucinate or invent information that is not present in the API results?
Hi, thanks for the quick response — I’m happy to provide the details you requested.
Below are the specific identifiers and settings related to the sessions where the character returned incorrect / hallucinated information.
Character ID:
8dd072c6-0822-11f1-9957-42010a7be027
Session ID(s) with incorrect behavior:
c5779974669689518623e7e76cf12122
Please let me know if you need additional session IDs for further investigation.
LLM Model used for this character:
gpt-4o
To clarify the issue:
I have an External API method called search_places which correctly returns results from Google Places. The first response within the Session ID is correct and based on real API data.
From the second response onward in the same session, the character starts generating invented locations that do not exist.
If it can help with the investigation, I can also share the code I use to call the API.
Hi, I can confirm that the issue is still occurring.
I’ve run several tests on other characters as well, updating the character description and setting up triggers in the Narrative Design, but I continue to experience incorrect behaviors.
I would really appreciate more detailed guidance, both for resolving the issue and for properly integrating the external APIs, as the current documentation hasn’t been sufficient to clarify my doubts.
Without more in-depth support, I’m concerned that I may not be able to continue using the service.