-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support for gemini-1.5-pro-exp-0801 #7
Comments
Hey @sig-mandel - so you are suggesting something similar to the Google published client libraries which auto switch the endpoint if you are using experimental models? |
... I see in the Google client libraries they default to |
ah no, its ok to have to pass the version, but if you try to do so, the library fails because the google api (called from inside this library) doesnt like to receive extra properties. |
just to be clear, this library already has a mechanism to change the api version by setting "apiVersion" : "v1beta" in requestOptions, however doing so causes a problem, because that same requestOptions object is passed as-is to the Google API, and the Google api complains that there are extra unexpected properties in the object. So the fix would be to generate a new, sanitized requestOptions before calling the google api, or to use an extra parameter on this library to set the api version instead of setting it in the requestOptions object (but that requires more code changes) |
What you are saying is clear now, however, I don't think I've encountered issues in the past when making |
im not sure if its just a matter of the default. I get your point about the requestOptions not getting passed straight, but it does get passed indirectly: makerequest is called by generateContent, called by sendMessage. In there, see this line, where it sets generateContentRequest (called "params" in that called function) including the apiVersion that could be there. Its easy to reproduce it you use a config like this one in the call: |
Ah - I think it's not clearly documented about where
|
aha! my issue was I was using the library wrong, sorry :( |
Related to conversation in #7 updating api version default to v1beta
When I tried to use that version of the model, the library returns an error about not finding the model. In the library I see the default version is "v1" and I found that changing it to "v1beta" makes it work.
However, if instead of modifying the library I try to use the library mechanism of adding
"apiVersion" : "v1beta"
to requestOptions, it does pick up that version inconst apiVersion = this.requestOptions?.apiVersion || DEFAULT_API_VERSION;
but later the API call fails with:Request to Gemini failed with response code 400 - {
"error": {
"code": 400,
"message": "Invalid JSON payload received. Unknown name "apiVersion" at 'generation_config': Cannot find field.",
"status": "INVALID_ARGUMENT",...
The text was updated successfully, but these errors were encountered: