Redfire-1234 commited on
Commit
a018299
·
verified ·
1 Parent(s): 668e568

Update app/services/google_docs.py

Browse files
Files changed (1) hide show
  1. app/services/google_docs.py +7 -4
app/services/google_docs.py CHANGED
@@ -4,12 +4,15 @@ from googleapiclient.errors import HttpError
4
  from typing import Optional
5
 
6
  class GoogleDocsReader:
7
- def __init__(self, credentials_path: str):
8
- self.credentials = service_account.Credentials.from_service_account_file(
9
- credentials_path,
 
 
 
10
  scopes=['https://www.googleapis.com/auth/documents.readonly']
11
  )
12
- self.service = build('docs', 'v1', credentials=self.credentials)
13
 
14
  def read_document(self, document_id: str) -> str:
15
  """Read and extract text from Google Doc"""
 
4
  from typing import Optional
5
 
6
  class GoogleDocsReader:
7
+ def __init__(self, credentials_dict: dict):
8
+ """
9
+ Initialize with credentials dictionary (decoded from base64)
10
+ """
11
+ self.credentials = service_account.Credentials.from_service_account_info(
12
+ credentials_dict,
13
  scopes=['https://www.googleapis.com/auth/documents.readonly']
14
  )
15
+ self.docs_service = build('docs', 'v1', credentials=self.credentials)
16
 
17
  def read_document(self, document_id: str) -> str:
18
  """Read and extract text from Google Doc"""