harshSethi commited on
Commit
2859dc1
·
verified ·
1 Parent(s): ec75db4

Update tools.py

Browse files
Files changed (1) hide show
  1. tools.py +6 -1
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
- creds = Credentials.from_service_account_file("credentials.json", scopes= scopes)
 
 
 
 
 
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)