Hallucinating With Gemini 1.5 pro Function Calling

So, I am making a chatbot for restaurants. It actually fetches relevant data using function calling.
I have also written the prompt so work with that even explicitly told in system prompt " ALWAYS prioritize function calling to fetch information

  • You will always use available functions to answer queries."

and also prevent hallucination. But it still hallucinating. So, for the restaurants product search I have a function to fetch the relevant product. but Gemini sometimes doesn’t call the function just make up product by its own. It’s giving me so much problem.

previously I was using the 1.5 flash model which was giving me the worst result ever so, I have moved to pro model which still hallucinating. Even I am only giving last two conversations as a history to less hallucinate.

So can you give me a better solution?

Hi @Rafsan,

Welcome to the forum! To address the hallucination issue and potentially improve your results, I’d recommend exploring grounding techniques. Grounding helps the model stay connected to factual information, which can lead to more accurate outputs. It might be a useful strategy for what you’re trying to achieve.

Cheers!