Spaces:
Runtime error
Runtime error
changes to gmail auth
Browse files- app/gmail_auth.py +2 -4
app/gmail_auth.py
CHANGED
|
@@ -5,7 +5,7 @@ from app.core.config import settings
|
|
| 5 |
AUTH_DIR = Path("/tmp/google_auth")
|
| 6 |
AUTH_DIR.mkdir(parents=True, exist_ok=True)
|
| 7 |
|
| 8 |
-
|
| 9 |
CREDENTIALS_PATH = AUTH_DIR / "credentials.json"
|
| 10 |
TOKEN_PATH = AUTH_DIR / "token.json"
|
| 11 |
|
|
@@ -19,7 +19,7 @@ if "GOOGLE_TOKEN" in os.environ:
|
|
| 19 |
else:
|
| 20 |
raise ValueError("GOOGLE_TOKEN secret is missing from environment variables!")
|
| 21 |
|
| 22 |
-
|
| 23 |
from langchain_google_community.gmail.utils import (
|
| 24 |
build_resource_service,
|
| 25 |
get_gmail_credentials,
|
|
@@ -27,8 +27,6 @@ from langchain_google_community.gmail.utils import (
|
|
| 27 |
from langchain_google_community import GmailToolkit
|
| 28 |
|
| 29 |
credentials = get_gmail_credentials(
|
| 30 |
-
|
| 31 |
-
|
| 32 |
token_file=str(TOKEN_PATH.resolve()),
|
| 33 |
scopes=["https://mail.google.com/"],
|
| 34 |
client_sercret_file=str(CREDENTIALS_PATH.resolve()),
|
|
|
|
| 5 |
AUTH_DIR = Path("/tmp/google_auth")
|
| 6 |
AUTH_DIR.mkdir(parents=True, exist_ok=True)
|
| 7 |
|
| 8 |
+
|
| 9 |
CREDENTIALS_PATH = AUTH_DIR / "credentials.json"
|
| 10 |
TOKEN_PATH = AUTH_DIR / "token.json"
|
| 11 |
|
|
|
|
| 19 |
else:
|
| 20 |
raise ValueError("GOOGLE_TOKEN secret is missing from environment variables!")
|
| 21 |
|
| 22 |
+
|
| 23 |
from langchain_google_community.gmail.utils import (
|
| 24 |
build_resource_service,
|
| 25 |
get_gmail_credentials,
|
|
|
|
| 27 |
from langchain_google_community import GmailToolkit
|
| 28 |
|
| 29 |
credentials = get_gmail_credentials(
|
|
|
|
|
|
|
| 30 |
token_file=str(TOKEN_PATH.resolve()),
|
| 31 |
scopes=["https://mail.google.com/"],
|
| 32 |
client_sercret_file=str(CREDENTIALS_PATH.resolve()),
|