cline / cline

Autonomous coding agent right in your IDE, capable of creating/editing files, executing commands, using the browser, and more with your permission every step of the way.
https://marketplace.visualstudio.com/items?itemName=saoudrizwan.claude-dev
Apache License 2.0
13.05k stars 1.03k forks source link

Google Gemini API Error: "Error fetching from https://generative... generateContent: fetch failed" #311

Open slayeryahu opened 2 months ago

slayeryahu commented 2 months ago

Hi, I use clash as my http/https proxy client. I need this proxy to access google gemini. Google Gemini is currently accessible through my browser, but it doesn't work in vscode claude dev (lastest version) image

image I have done the proxy config in the settings.

Begging your reply. Thank you!

saoudrizwan commented 2 months ago

I will look into this as soon as I can! In the meantime can you try using OpenAI compatible and see if you can get it working that way?

cuidezhu commented 2 months ago

I have the same problem. Claude dev use Google Gemini request url is":generateContent", [GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash-latest:generateContent: fetch failed. But I see Continue use"streamGenerateContent" is work, [https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash-latest:streamGenerateContent?key=your key], Continue can use Gemini, But Claude dev can't use Gemini, please check, thank you.

slayeryahu commented 2 months ago

I will look into this as soon as I can! In the meantime can you try using OpenAI compatible and see if you can get it working that way?

Sorry I can't use OPENAI's product. And my gemini api account was locked after testing claude dev....

slayeryahu commented 2 months ago

I will look into this as soon as I can! In the meantime can you try using OpenAI compatible and see if you can get it working that way?

Google said I can't use gemini with other competitive models, my project was banned forever.

kaileysong commented 2 months ago

I will look into this as soon as I can! In the meantime can you try using OpenAI compatible and see if you can get it working that way?

I use litellm converting gemini api into openai compatible api, but only get error 400: no body

degeneratehyperbola commented 2 months ago

I will look into this as soon as I can! In the meantime can you try using OpenAI compatible and see if you can get it working that way?

Is there a way to use OpenAI compatible without an API key? My proxy does not require an api key but if one is provided it ceases to work :c

liliwen365 commented 2 months ago

Hi, I am using clash as my http/https proxy client. I need this proxy to access google gemini. Currently it is possible to access Google Gemini through my browser, but it doesn't work in vscode claude dev (latest version) ! [image](https://private-user-images.githubusercontent.com/7860485/367636601-aa59b42e-bb9f-44f1-9a92-b5cded709c60.png?jwt= eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9. eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjcwNTg1ODgsIm5iZiI6MTcyNzA1ODI4OCwicGF0aCI6Ii83ODYwNDg1LzM2NzYzNjYwMS1hYTU5YjQyZS1iYjlmLTQ0ZjEtOWE5Mi1iNWNkZWQ3MDljNjAucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDkyMyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA5MjNUMDIyNDQ4WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZThmYjkyZGE4NzU5YWUwNGZlZGMxMDc5ZDI5ZGZmNGQwN2NmODJmNzg1MGFhYzA0MWE2MWI0MGRiOGZlYWYzNSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ .SQA-HhCLicr6gt1aN_hklyv2Lr8BWw-VP2k1vPnLCpM)

! [image](https://private-user-images.githubusercontent.com/7860485/367636796-550ac499-18e0-41f2-8012-4818499ebfc6.png?jwt= eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9. eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjcwNTg1ODgsIm5iZiI6MTcyNzA1ODI4OCwicGF0aCI6Ii83ODYwNDg1LzM2NzYzNjc5Ni01NTBhYzQ5OS0xOGUwLTQxZjItODAxMi00ODE4NDk5ZWJmYzYucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDkyMyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA5MjNUMDIyNDQ4WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ODRhZjY5Mzg0MzFiNDNhOGMwMmM5YmRiMzUxNzQ4NjczOTQwNGMzZjk2NjljOTMyODJhMzdlNjA4MGIzOGRjZCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ .UFKHNo9xx5gbbV6CvccYBt_iQqGK42SuUr0yt8jqKAo) I have done the proxy configuration in the settings.

I would appreciate your response. Thanks!

I'm also experiencing this problem, please let me know how it's being handled now, thanks!

wykthreed commented 2 months ago

the same problem

wykthreed commented 2 months ago

Maybe, it's caused by network problem. In my country, we need to set http proxy in Visual Studio Code to access google service. Other plugins works. However, Claude Dev has the problem. When I change network to another wifi (openwrt installed with shadowsocks), Claude Dev works! It seem that Claude Dev didn't use the http proxy set in Visual Studio Code. I'm on macOS.