Could a custom url be used to call Gemini api? #31365
-
Self Checks
1. Is this request related to a challenge you're experiencing? Tell me about your story.Gemini does not support my area of residence, and I am relaying my requests with Netlify to get around it, which means I usually substitute the usual google api call url with another url determined by Netlify. However, filling in my Netlify url to Gemini’s “base url” input box in Dify results in the error message "Error -3 while decompressing data: incorrect header check". I am unsure whether this is due to a problem in my input, or if this input box is for some different purpose that I do not realize. 2. Additional context or comments
I spent a few days trying to read the source code and figure out what the api call structure would be, but was proved to be incapable of that. I was also unable to find related discussion online, so it appears that I am currently in desperate need of assistance. Thanks in advance to any responders. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Hi @RythmOfLight! I'm Dosu and I’m helping the dify team. Yes, Dify's Gemini plugin does support using a custom base URL (like a Netlify relay) starting from version 0.5.4. However, the error "Error -3 while decompressing data: incorrect header check" usually means the proxy/relay isn't returning responses in the exact format or encoding (such as gzip, deflate, or br) that Dify expects from the native Gemini API. Dify's plugin sets the To troubleshoot: use a tool like curl or Postman to call your Netlify URL and inspect the response headers and body. Make sure the As an alternative, you can set HTTP proxy environment variables (like To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other Footnotes |
Beta Was this translation helpful? Give feedback.
It appears that the proxy returns a "content-encoding" header that indicates a zip file while the content is plain text. One unconfirmed possibility is that netlify automatically unpacked whatever was fetched from google, and the script I was using did not account for that. Either way, this was resolved by deleting that header.