Spaces:
Sleeping
Sleeping
Google secret import updated
Browse files- backend/cache_utils.py +4 -0
- backend/config.py +4 -0
- backend/goal_extraction.py +4 -0
- backend/mood_extraction.py +4 -0
- backend/rag_utils.py +3 -0
- tools/goal_tools.py +4 -0
backend/cache_utils.py
CHANGED
@@ -1,6 +1,10 @@
|
|
1 |
import time
|
2 |
from typing import Dict, Any, Optional
|
3 |
|
|
|
|
|
|
|
|
|
4 |
# Simple in-memory cache
|
5 |
user_cache: Dict[str, Dict[str, Any]] = {}
|
6 |
routing_cache: Dict[str, str] = {}
|
|
|
1 |
import time
|
2 |
from typing import Dict, Any, Optional
|
3 |
|
4 |
+
from server import setup_google_credentials
|
5 |
+
|
6 |
+
setup_google_credentials()
|
7 |
+
|
8 |
# Simple in-memory cache
|
9 |
user_cache: Dict[str, Dict[str, Any]] = {}
|
10 |
routing_cache: Dict[str, str] = {}
|
backend/config.py
CHANGED
@@ -5,6 +5,10 @@ from tools.goal_tools import add_goal_tool, list_goal_categories
|
|
5 |
|
6 |
load_dotenv()
|
7 |
|
|
|
|
|
|
|
|
|
8 |
OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")
|
9 |
DEEPSEEK_API_KEY = os.getenv("DEEPSEEK_API_KEY")
|
10 |
|
|
|
5 |
|
6 |
load_dotenv()
|
7 |
|
8 |
+
from server import setup_google_credentials
|
9 |
+
|
10 |
+
setup_google_credentials()
|
11 |
+
|
12 |
OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")
|
13 |
DEEPSEEK_API_KEY = os.getenv("DEEPSEEK_API_KEY")
|
14 |
|
backend/goal_extraction.py
CHANGED
@@ -1,6 +1,10 @@
|
|
1 |
import re
|
2 |
from backend.config import gpt4o
|
3 |
|
|
|
|
|
|
|
|
|
4 |
async def extract_goal_details(user_message: str, conversation_history: list = None) -> dict:
|
5 |
details = {
|
6 |
"goal_name": None,
|
|
|
1 |
import re
|
2 |
from backend.config import gpt4o
|
3 |
|
4 |
+
from server import setup_google_credentials
|
5 |
+
|
6 |
+
setup_google_credentials()
|
7 |
+
|
8 |
async def extract_goal_details(user_message: str, conversation_history: list = None) -> dict:
|
9 |
details = {
|
10 |
"goal_name": None,
|
backend/mood_extraction.py
CHANGED
@@ -5,6 +5,10 @@ from backend.config import gpt4o
|
|
5 |
|
6 |
db = firestore.Client()
|
7 |
|
|
|
|
|
|
|
|
|
8 |
COMMON_EMOTIONS = [
|
9 |
"grateful", "hope", "content", "connected", "drained",
|
10 |
"envy", "disappointed", "relief", "happy", "sad", "angry",
|
|
|
5 |
|
6 |
db = firestore.Client()
|
7 |
|
8 |
+
from server import setup_google_credentials
|
9 |
+
|
10 |
+
setup_google_credentials()
|
11 |
+
|
12 |
COMMON_EMOTIONS = [
|
13 |
"grateful", "hope", "content", "connected", "drained",
|
14 |
"envy", "disappointed", "relief", "happy", "sad", "angry",
|
backend/rag_utils.py
CHANGED
@@ -4,6 +4,9 @@ from backend.mood_extraction import get_recent_mood_entries
|
|
4 |
import time
|
5 |
from backend.cache_utils import get_cached_user_data, cache_user_data
|
6 |
|
|
|
|
|
|
|
7 |
|
8 |
# Load from .env file
|
9 |
load_dotenv()
|
|
|
4 |
import time
|
5 |
from backend.cache_utils import get_cached_user_data, cache_user_data
|
6 |
|
7 |
+
from server import setup_google_credentials
|
8 |
+
|
9 |
+
setup_google_credentials()
|
10 |
|
11 |
# Load from .env file
|
12 |
load_dotenv()
|
tools/goal_tools.py
CHANGED
@@ -3,6 +3,10 @@ from langchain_core.tools import tool
|
|
3 |
from datetime import datetime, timedelta
|
4 |
import pytz
|
5 |
|
|
|
|
|
|
|
|
|
6 |
APP_TO_DB_CATEGORY = {
|
7 |
"vocational": "occupational",
|
8 |
}
|
|
|
3 |
from datetime import datetime, timedelta
|
4 |
import pytz
|
5 |
|
6 |
+
from server import setup_google_credentials
|
7 |
+
|
8 |
+
setup_google_credentials()
|
9 |
+
|
10 |
APP_TO_DB_CATEGORY = {
|
11 |
"vocational": "occupational",
|
12 |
}
|