Give a response to something and let the AI be aware

I’m currently building an AI and I want it to access some data via a REST API. How could I give it the response to something?
I have two ideas:
Get the AI to output something and let it choose the format (eg., The room has {“name”:“room-name”,“format”:“$views”} views!) and just display it on the user’s end - but I want the AI to actually have some awareness and not just unknown to what’s actually being displayed. Any solution?

Current Preferred Model: 1.5Flash-002

2 Likes

Does anyone have a solution?

How about using function calling? The function calling provided by the gemini-api would be a good alternative.

The conversation could proceed as follows:

Gemini API Function calling documentation : Intro to function calling

Translate by Gemini.

I’d much prefer a way that only uses one prompt. Thanks for sharing though, I will look into it.