Gemini API generateAnswer still valid?

Hello,

I want to do RAG.

Is the generateAnswer end point still valid, or should I only use generateContent?

The API doc explains that generateAnswer is designed for RAG:

What models can I use with generateAnswer?

Where can I get some CURL example using generateAnswer

So far I get HTTP error 400 / Bad request …

Thanks

I could make it work, using the “aqa” model.
Still:

  • doc should be reviewed with samples
  • is the generateAnswer API obsolete or should it last for a while?
    Seb
1 Like

Hi @sebfla4js

Welcome to the forum.

As you discovered yourself, it depends on the model and it’s supportedMethods. The generateAnswer is bound to the aqa model only, IIRC.

It has a specific use case though. If that’s not for you, then ignore it.

Cheers

Thanks @jkirstaetter for your answer!

I am still a bit confused by which API/model I should use to do RAG with the Gemini API.

My understanding is that generateAnswer was designed to get “groundings” ( grounding_source) with inlinePassages or semanticRetriever, so the facts to be used for reasoning are clearly identified in the input data. And I like that approach.

On the other hand, generateContent API has the systemInstruction property, where you should specify the RAG input data (groundings) with content parts. Right?

So long term, which API/model should I use to do RAG to get best results?

Where can I find a real use case of RAG with any of the Gemini APIs/models?

Seb