Spaces:
Sleeping
Sleeping
Update tools.py
Browse files
tools.py
CHANGED
@@ -21,7 +21,12 @@ def customerDetailsGsheets( objective,personal_details,industry,recipientRole,re
|
|
21 |
scopes = [
|
22 |
"https://www.googleapis.com/auth/spreadsheets"
|
23 |
]
|
24 |
-
|
|
|
|
|
|
|
|
|
|
|
25 |
client = gspread.authorize(creds)
|
26 |
try:
|
27 |
workbook = client.open_by_key(sheet_id)
|
|
|
21 |
scopes = [
|
22 |
"https://www.googleapis.com/auth/spreadsheets"
|
23 |
]
|
24 |
+
json_string = os.getenv('credentials')
|
25 |
+
|
26 |
+
# Convert the string back to a JSON object
|
27 |
+
Credentials= json.loads(json_string)
|
28 |
+
|
29 |
+
creds = Credentials.from_service_account_file("credentials", scopes= scopes)
|
30 |
client = gspread.authorize(creds)
|
31 |
try:
|
32 |
workbook = client.open_by_key(sheet_id)
|