Hi, guys! I'm trying to use Ai Gateway to cache requests for Gemini using Google Ai Studio but maybe
Hi, guys! I'm trying to use Ai Gateway to cache requests for Gemini using Google Ai Studio but maybe i am doing something wrong :/
I am getting some errors regarding the system_instruction and generationConfig parameters
The same request works by using the direct endpoint on google
https://generativelanguage.googleapis.com/v1beta/models/
9 Replies
Example of request made:
Am i doing something wrong?
Or since it is on beta, somethings are still yet to be implemented?
json is camel cased within googleapis
change
system_instruction
to systemInstruction
and response_mime_type
to responseMimeType
Hummm 🤔
Saw this example within Google APIs
Forgot to send the link (sorry 😅 )
https://ai.google.dev/gemini-api/docs/system-instructions?lang=rest
try it with camel case
likely the json to grpc transcoder accepts non-camel case, but not cases where some json keys are camel case while others aren't (such as in your code above)
in googleapis, all json/protojson requests are transcoded to grpc calls to google's actual servers
they are mapped to a protobuf definition
I tried, but got the same error :/
Thank you for the suggestion anyway!!
Are you specifying generationConfig or generation_config?
It has to all be camel case or all snake case, not a mixture as it seems you might have there.
So:
Or
I just tried both, and got the same error
Tried with all camelCase like this:
And got the same error 🤔
Funny how in the error message seems like i am sending generation_config, but i am actually sending in camelCase like generationConfig
Not sure why
How I change Change My Website FIles In Workers And Pages
ANY ONE KNOW
Hey team. Is it possible to have own inferring server (With OpenAI compatible API) to be proxied by the AI Gateway?