Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -14,21 +14,23 @@ load_dotenv()
|
|
| 14 |
GOOGLE_API_KEY = os.getenv("GOOGLE_API_KEY")
|
| 15 |
FIRECRAWL_API_KEY = os.getenv("FIRECRAWL_API_KEY")
|
| 16 |
SHEET_ID = os.getenv("SHEET")
|
|
|
|
|
|
|
| 17 |
# Setup Google Sheets connection (update the path and sheet name)
|
| 18 |
-
genai ={
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
}
|
| 31 |
-
gc = gspread.service_account_from_dict(
|
| 32 |
sh = gc.open_by_key(SHEET_ID) # Replace with your Google Sheet name
|
| 33 |
worksheet = sh.worksheet("S1") # Replace with your worksheet name if different
|
| 34 |
|
|
|
|
| 14 |
GOOGLE_API_KEY = os.getenv("GOOGLE_API_KEY")
|
| 15 |
FIRECRAWL_API_KEY = os.getenv("FIRECRAWL_API_KEY")
|
| 16 |
SHEET_ID = os.getenv("SHEET")
|
| 17 |
+
cred_dic = os.getenv("cred_dict")
|
| 18 |
+
cred_dict = json.loads(cred_dic)
|
| 19 |
# Setup Google Sheets connection (update the path and sheet name)
|
| 20 |
+
# genai ={
|
| 21 |
+
# "type": str(os.getenv("type")),
|
| 22 |
+
# "project_id": str(os.getenv("project_id")),
|
| 23 |
+
# "private_key_id": str(os.getenv("private_key_id")),
|
| 24 |
+
# "private_key": str(os.getenv("private_key")),
|
| 25 |
+
# "client_email": str(os.getenv("client_email")),
|
| 26 |
+
# "client_id": str(os.getenv("client_id")),
|
| 27 |
+
# "auth_uri": str(os.getenv("auth_uri")),
|
| 28 |
+
# "token_uri": str(os.getenv("token_uri")),
|
| 29 |
+
# "auth_provider_x509_cert_url": str(os.getenv("auth_provider_x509_cert_url")),
|
| 30 |
+
# "client_x509_cert_url": str(os.getenv("client_x509_cert_url")),
|
| 31 |
+
# "universe_domain": str(os.getenv("universe_domain"))
|
| 32 |
+
# }
|
| 33 |
+
gc = gspread.service_account_from_dict(cred_dict)
|
| 34 |
sh = gc.open_by_key(SHEET_ID) # Replace with your Google Sheet name
|
| 35 |
worksheet = sh.worksheet("S1") # Replace with your worksheet name if different
|
| 36 |
|