Closed aadi1295 closed 6 months ago
I would suggest to move server to any supported region: https://ai.google.dev/available_regions
Proxy would not be a reliable solution.
If you still want to use proxy, then just initialize a HttpClient instance with Proxy and pass it to the model:
var handler = new HttpClientHandler()
{
Proxy = new WebProxy("IP:PORT")
{
Credentials = new NetworkCredential("UserName","Password")
}
};
var httpClient = new HttpClient(handler);
var model = new GenerativeModel(apiKey,client:httpClient);
//var model = new GeminiProModel(apiKey, client: httpClient)
//var visionModel = new GeminiProVision(apiKey, client: httpClient);
Hello, Thank you for this SDK. It's working fine locally as Gemini API support my local region. However on server deployment it is giving me this error. My server is in Netherlands and according to this https://ai.google.dev/available_regions#available_regions Netherlands is not supported. Can you please add functionality to use proxy so that it can use supported region. Thank you again.