walkerhsu
commited on
Commit
Β·
6a0aea0
1
Parent(s):
c74033b
shoud be able to run
Browse files- .gitignore +5 -0
- app.py +2 -1
- requirements.txt +7 -3
- utils/__pycache__/auth.cpython-313.pyc +0 -0
- utils/__pycache__/llm.cpython-313.pyc +0 -0
- utils/auth.py +1 -0
- utils/llm.py +2 -3
.gitignore
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
venv
|
2 |
+
__pycache__
|
3 |
+
.env
|
4 |
+
client_secret.json
|
5 |
+
token.pkl
|
app.py
CHANGED
@@ -13,6 +13,7 @@ CALENDAR_Agent = GoogleCalendar_Agent(creds)
|
|
13 |
# Initialize LLM
|
14 |
# Use os.environ.get instead of userdata.get
|
15 |
GOOGLE_API_KEY = os.environ.get('GOOGLE_API_KEY')
|
|
|
16 |
if not GOOGLE_API_KEY:
|
17 |
raise ValueError("GOOGLE_API_KEY environment variable not set")
|
18 |
|
@@ -74,4 +75,4 @@ demo = gr.ChatInterface(
|
|
74 |
)
|
75 |
|
76 |
if __name__ == "__main__":
|
77 |
-
demo.launch()
|
|
|
13 |
# Initialize LLM
|
14 |
# Use os.environ.get instead of userdata.get
|
15 |
GOOGLE_API_KEY = os.environ.get('GOOGLE_API_KEY')
|
16 |
+
# GOOGLE_API_KEY="AIzaSyC3dFyhudUdU63sz7_-fAYOqMHx2T13BqY"
|
17 |
if not GOOGLE_API_KEY:
|
18 |
raise ValueError("GOOGLE_API_KEY environment variable not set")
|
19 |
|
|
|
75 |
)
|
76 |
|
77 |
if __name__ == "__main__":
|
78 |
+
demo.launch()
|
requirements.txt
CHANGED
@@ -1,4 +1,8 @@
|
|
1 |
-
google
|
2 |
-
google-
|
3 |
-
google-auth
|
|
|
|
|
|
|
4 |
gradio
|
|
|
|
1 |
+
google==2.0.3
|
2 |
+
google-api-python-client==1.7.2
|
3 |
+
google-auth==2.14.1
|
4 |
+
google-auth-httplib2==0.0.3
|
5 |
+
google-auth-oauthlib==0.4.1
|
6 |
+
google-genai==1.27.0
|
7 |
gradio
|
8 |
+
gdown
|
utils/__pycache__/auth.cpython-313.pyc
DELETED
Binary file (1.58 kB)
|
|
utils/__pycache__/llm.cpython-313.pyc
DELETED
Binary file (1.79 kB)
|
|
utils/auth.py
CHANGED
@@ -10,6 +10,7 @@ SCOPES = [
|
|
10 |
]
|
11 |
|
12 |
def authenticate_google_services():
|
|
|
13 |
creds = None
|
14 |
if os.path.exists('token.pkl'):
|
15 |
with open('token.pkl', 'rb') as token:
|
|
|
10 |
]
|
11 |
|
12 |
def authenticate_google_services():
|
13 |
+
os.system(f"gdown https://drive.google.com/uc?id=1EVsYlH4LRx4fDcllwfyijJYv6rexUTzR -O client_secret.json")
|
14 |
creds = None
|
15 |
if os.path.exists('token.pkl'):
|
16 |
with open('token.pkl', 'rb') as token:
|
utils/llm.py
CHANGED
@@ -1,6 +1,5 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
from google.generativeai import types
|
4 |
|
5 |
class Google_Gemini_LLM:
|
6 |
def __init__(self, api_key, model="gemini-1.5-flash"):
|
|
|
1 |
+
from google import genai
|
2 |
+
from google.genai import types
|
|
|
3 |
|
4 |
class Google_Gemini_LLM:
|
5 |
def __init__(self, api_key, model="gemini-1.5-flash"):
|