Search code examples
jsonoutputbackendartificial-intelligencegoogle-gemini

Google Gemini API giving back inaccurate information


I am trying to use Google Gemini's API in order to generate responses for a list of buildings in NYC. I have structured the prompt to give a format of a list of bullet points about building information. When writing the same prompt in the browser in Gemini, I am getting accurate information, but when writing prompts to test in postman the responses are inaccurate. I provided and explained my example below:

The address in the response was being constructed in 2001 not in 1929

This issue here is that the building was built in 2001 finished in 2003 not in 1929. Other attempts to change the prompt give other years that are also in the early 1900s. Some of the other information in the response of the image above is also inaccurate, but my assumption is that if I can get one to work it will have them all work.

I've played with the generationConfig to no avail. What do I need to do in order to get pretty much the same response I would get on the browser as an output from the API call or what do I need to change in order to get the accurate information?


Solution

  • What do I need to do in order to get pretty much the same response I would get on the browser as an output from the API call?

    You can not. There is currently no way to get the exact same response from AI studio in the API.

    If you are trying to get the same response from the Gemini web app then the response will be completely different in most cases. The Gemini chat app at gemini.google.com includes many models and sets of information, some of which are proprietary. It does not have an API.

    Remember this is an ai not a database the response is generated real time and may change. It picks the most likely answer it can come up with at the time it is run.