whats2000 / CodeBRT

CodeBRT is an AI program generation plugin for VSCode. It helps you quickly generate code through AI, thus improving development efficiency.
https://whats2000.github.io/CodeBRT/docs/introduction
GNU General Public License v3.0
16 stars 2 forks source link

API problem #12

Open bojun-chen opened 5 days ago

bojun-chen commented 5 days ago

I try to use gemini , but after i enter the API key and run , it show :

"Failed to get response from Gemini Service: Error: [GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash:streamGenerateContent?alt=sse: [403 Forbidden] Method doesn't allow unregistered callers (callers without established identity). Please use API Key or other form of API consumer identity to call this API."

What may cause and how to fix this problem?

whats2000 commented 5 days ago

@bojun-chen Thank you for reporting this issue.

This looks like an intermittent error and should work after some time later. Please tell me if this is still happening for several hours later.

For issues related to Gemini API, we would suggest you also post this issue on Google AI forum.

bojun-chen commented 3 days ago

It still happen after few days. And i notice that everytime i close Visual Studio Code, the gemini API vanish. I am sure i click "Close and save" button.

whats2000 commented 3 days ago

Oh, I see. That's related to the settings are saved at user profile. I guess you have never logged in the VSCode. As the API key is belong to user profile. I think this is able to fix just simply click the account icon (At bottom left in VSCode) > Sign in to sync settings > After login restart the VSCode for init the user profile.

bojun-chen commented 2 days ago

I find out i already sign in. Or maybe it is API problem. Here is my API key, is it ok for "free of charge"?

API key

whats2000 commented 2 days ago

That's strange, I have a friend report some of his Google account have similar issue. After he swap to a new account, he work just fine. I think this might related to Gemini API issue. Sorry for, but I can not reproduce the issue. You can ask me in discord with screenshare for further debugging. My discord id is whats2000_.

whats2000 commented 1 day ago

Did you get a similar issue https://github.com/whats2000/CodeBRT/issues/17 ? You can try the solution I mentioned at the end. Please tell me if it fixes your issue! Thank you so much!