Better docs on apiVersion request option #76
Labels
component:documentation
Improvements or additions to documentation
status:triaged
Issue/PR triaged to the corresponding sub-team
type:bug
Something isn't working
I scoured the docs for an example of how to specify the
apiVersion
parameter in a generate content request. I couldn't find it so I did a hard trace on thefetch()
and finally figured out that it has to be in the call togetGenerativeModel()
:I believe this is about to trip up a lot of people up due to the huge number of participants in the Google AI Hackathon going on right now. The contest wants you to use the Gemini 1.5 Pro advanced API and that is only available with the
v1beta
API. So initially my API calls to that model were failing until I figured out how to declare request option that properly.Post-mortem I did manage to find an example of it buried in the
node /advanced-function-calling.js
sample. Given it's importance I feel it should be added to the the man repo README page and also at least somewhere on the main API docs page for JavaScript developers:https://ai.google.dev/tutorials/get_started_web
If you scan that page, you will find many
getGenerativeModel()
call examples, some even showing how to declare SAFETY settings, but none of them show you where to put theapiVersion
option.The text was updated successfully, but these errors were encountered: