Find answers from the community

Updated 2 years ago

Was anyone able to get the google docs

Was anyone able to get the google docs reader integration setup within Google Colab? I keep running into oauth errors even after passing in credentials (and i think it has to do with colab not being able to run localhost)
K
j
s
17 comments
@Krrish@LiteLLM.ai what's the error you're running into?
are you setting up your app in google docs as a "desktop app"?
that's the main flow i've tested it out with
and sorry this is a colab notebook right
does the issue persist if you run the notebook locally?
my local environment is pretty messed up (issues with pip, etc.)
so trying to do this in colab / replit
Hmm I can try in colas
Can you post stack trace?
i'm getting the same issue running this locally and passing in service worker credentials via credentials.json , the specific error i was getting is:
raise ValueError("Client secrets must be for a web or installed app.")
i was able to read the document in python via another method, but got a little lost trying to combine that with googleDocReader :agony:
I'mma try debuggin this and will relay my findings, i feel like @jerryjliu0 is already providing superhuman levels of support for this project ๐Ÿ˜„
I think I got this working ๐Ÿ˜ฎ but I don't fully understand how (python is not really my strong suite). I obtained the creds from this stackoverflow answer: https://stackoverflow.com/questions/56445257/valueerror-client-secrets-must-be-for-a-web-or-installed-app and just commented out everything else :ape:
```
creds = None
# if os.path.exists("token.json"):
# creds = Credentials.from_authorized_user_file("token.json", SCOPES)
# If there are no (valid) credentials available, let the user log in.
if not creds or not creds.valid:
if creds and creds.expired and creds.refresh_token:
creds.refresh(Request())
else:
# flow = InstalledAppFlow.from_client_secrets_file(
# "credentials.json", SCOPES
# )
# # creds = flow.run_local_server(port=0)
SERVICE_ACCOUNT_FILE = 'credentials.json'
creds = service_account.Credentials.from_service_account_file(
SERVICE_ACCOUNT_FILE, scopes=SCOPES)
# Save the credentials for the next run
# with open("token.json", "w") as token:
# token.write(creds.to_json())
return creds
Add a reply
Sign up and join the conversation on Discord