OthersideAI / self-operating-computer

A framework to enable multimodal models to operate a computer.
https://www.hyperwriteai.com/self-operating-computer
MIT License
8.68k stars 1.15k forks source link

Google Gemini Vision - Error with Request. (ACCESS_TOKEN_SCOPE_INSUFFICIENT) #115

Open haseeb-heaven opened 9 months ago

haseeb-heaven commented 9 months ago

Request: Open calculator and add 23 + 35

Output:

Error parsing JSON: 403 Request had insufficient authentication scopes. [
<img width="1309" alt="image" src="https://github.com/OthersideAI/self-operating-computer/assets/11544739/671e5ec2-326c-422b-8f0f-d87d58c3bd20">
reason: "ACCESS_TOKEN_SCOPE_INSUFFICIENT"
domain: "googleapis.com"
metadata {
  key: "service"
  value: "generativelanguage.googleapis.com"
}
metadata {
  key: "method"
  value: "google.ai.generativelanguage.v1beta.GenerativeService.GenerateContent"
}
]
[Self-Operating Computer][Error] something went wrong :(
[Self-Operating Computer][Error] AI response
Failed take action after looking at the scr
<img width="1309" alt="image" src="https://github.com/OthersideAI/self-operating-computer/assets/11544739/b9ab8176-860d-4794-8fe3-4b1049658cfb">
eenshot
joshbickett commented 9 months ago

Hi @haseeb-heaven, I had a similar issue. It appears that requesting a key from the Makersuite is not sufficient to use Gemini locally on your laptop.

It requires setting up a Google test project as well by following the directions at this URL: https://ai.google.dev/palm_docs/oauth_quickstart

Objectives

Let me know if this doesn't work for you. The process is more work than I originally realized as well, but I was able to get it to work locally.

If you have ideas on how to improve the README.MD Gemini section, let me know!

haseeb-heaven commented 9 months ago

I have used Google gemini pro and vision pro in my Python projects hosted offline and online they work fine and doesn’t need any Auth setup? So are you sure about this we need this setup .

Check my project https://github.com/haseeb-heaven/Gemini-Vision-Pro it uses Google gemini vision pro and works fine locally and doesn’t need any extra setups.

I think we need more logs to this to track this issue

joshbickett commented 9 months ago

@haseeb-heaven oh ok. It is possible you don't need the credentials then. I wasn't able to get it working without them but I may have been doing something wrong.

haseeb-heaven commented 9 months ago

I will test it again today and will update about this issue will have to check or update the logs then from server

sgn1989 commented 8 months ago

I was able to use Gemini-pro without the Google Cloud credentials but while using Gemini-vision-pro, I got an error relating to Google Cloud credentials. So I have set up the google cloud CLI but still, when I try to use the Vision Pro, I am getting this error. I am not sure how to make the credentials accessible in the Streamlit App.

@joshbickett Please let me know if you have any suggestions. Thanks.

haseeb-heaven commented 8 months ago

But we have Google Gemini Vision from Google AI studio not from Google Vertex AI. There is difference Google Vertex AI requires credentials files from JSON while Google Studio AI. requires only single API key.

sgn1989 commented 8 months ago

I am not sure, I generated the API key from Google Studio AI only. I tested the Gemini model and it generates the response but when I use the same key for the Vision model, it fails with this error. Not sure where I am going wrong.

haseeb-heaven commented 8 months ago

Same error for Vision its not working well need update

michsiu commented 8 months ago

hello @joshbickett, May I know how to finish the credentials? Would you please provide some tutorials? I think we met the same issue, because it raise an error about network and tcp handshaker shutdown Thanks

michsiu commented 8 months ago

I have another idea about this issue, if it's the reason that the region restrict make the device cannot connect with the Gemini pro? The same api key I tested can work on my phone but cannot work on computer

haseeb-heaven commented 8 months ago

We have to check the logs to get the exact error from project

AbdulrahmanAbdullahAI commented 5 months ago

I have the same issue, I am using Gemini pro vision. it works well locally, but when deployed to streamlit cloud it shows exactly the same error