Spaces:
Sleeping
Sleeping
n0v33n commited on
Commit ·
f1391d4
1
Parent(s): c1b780e
Fix cache permissions
Browse files
app.py
CHANGED
|
@@ -18,8 +18,6 @@ from google.adk.agents import Agent
|
|
| 18 |
from google.adk.sessions import InMemorySessionService
|
| 19 |
from google.adk.runners import Runner
|
| 20 |
from google.genai import types
|
| 21 |
-
from huggingface_hub import login
|
| 22 |
-
import os
|
| 23 |
import re
|
| 24 |
from tools import (
|
| 25 |
db_tool,
|
|
@@ -33,16 +31,7 @@ from tools import (
|
|
| 33 |
load_dotenv()
|
| 34 |
HF_TOKEN = os.getenv("HUGGINGFACE_TOKEN")
|
| 35 |
GOOGLE_API_KEY = os.getenv("GOOGLE_API_KEY")
|
| 36 |
-
TAVILY_API_KEY = os.getenv("TAVILY_API_KEY")
|
| 37 |
-
SERVICE_ACCOUNT_JSON = os.getenv("GOOGLE_SERVICE_ACCOUNT_JSON")
|
| 38 |
-
SHEET_KEY = os.getenv("SHEET_KEY")
|
| 39 |
-
PREDICTOR_API_URL = os.getenv("PREDICTOR_API_URL")
|
| 40 |
-
PREDICTOR_API_KEY = os.getenv("PREDICTOR_API_KEY")
|
| 41 |
-
|
| 42 |
-
login(token=HF_TOKEN)
|
| 43 |
|
| 44 |
-
# === GOOGLE SHEET LOGGING ===
|
| 45 |
-
service_account_dict = json.loads(SERVICE_ACCOUNT_JSON) if isinstance(SERVICE_ACCOUNT_JSON, str) else SERVICE_ACCOUNT_JSON
|
| 46 |
# === PREPROCESSING DICTIONARY ===
|
| 47 |
INSTITUTE_MAPPING = {
|
| 48 |
"iit": ["indian institute of technology"],
|
|
|
|
| 18 |
from google.adk.sessions import InMemorySessionService
|
| 19 |
from google.adk.runners import Runner
|
| 20 |
from google.genai import types
|
|
|
|
|
|
|
| 21 |
import re
|
| 22 |
from tools import (
|
| 23 |
db_tool,
|
|
|
|
| 31 |
load_dotenv()
|
| 32 |
HF_TOKEN = os.getenv("HUGGINGFACE_TOKEN")
|
| 33 |
GOOGLE_API_KEY = os.getenv("GOOGLE_API_KEY")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
|
|
|
|
|
|
|
| 35 |
# === PREPROCESSING DICTIONARY ===
|
| 36 |
INSTITUTE_MAPPING = {
|
| 37 |
"iit": ["indian institute of technology"],
|
tools.py
CHANGED
|
@@ -17,7 +17,6 @@ from langchain.embeddings.base import Embeddings
|
|
| 17 |
from sentence_transformers import SentenceTransformer
|
| 18 |
from langchain_tavily import TavilySearch
|
| 19 |
from google.adk.tools import FunctionTool
|
| 20 |
-
from huggingface_hub import login
|
| 21 |
|
| 22 |
# === LOAD ENV ===
|
| 23 |
load_dotenv()
|
|
@@ -29,7 +28,7 @@ SHEET_KEY = os.getenv("SHEET_KEY")
|
|
| 29 |
PREDICTOR_API_URL = os.getenv("PREDICTOR_API_URL")
|
| 30 |
PREDICTOR_API_KEY = os.getenv("PREDICTOR_API_KEY")
|
| 31 |
|
| 32 |
-
|
| 33 |
|
| 34 |
# === GOOGLE SHEET LOGGING ===
|
| 35 |
service_account_dict = json.loads(SERVICE_ACCOUNT_JSON) if isinstance(SERVICE_ACCOUNT_JSON, str) else SERVICE_ACCOUNT_JSON
|
|
|
|
| 17 |
from sentence_transformers import SentenceTransformer
|
| 18 |
from langchain_tavily import TavilySearch
|
| 19 |
from google.adk.tools import FunctionTool
|
|
|
|
| 20 |
|
| 21 |
# === LOAD ENV ===
|
| 22 |
load_dotenv()
|
|
|
|
| 28 |
PREDICTOR_API_URL = os.getenv("PREDICTOR_API_URL")
|
| 29 |
PREDICTOR_API_KEY = os.getenv("PREDICTOR_API_KEY")
|
| 30 |
|
| 31 |
+
hf_login(token=HF_TOKEN)
|
| 32 |
|
| 33 |
# === GOOGLE SHEET LOGGING ===
|
| 34 |
service_account_dict = json.loads(SERVICE_ACCOUNT_JSON) if isinstance(SERVICE_ACCOUNT_JSON, str) else SERVICE_ACCOUNT_JSON
|