Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,6 +1,19 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import random
|
| 3 |
from huggingface_hub import InferenceClient
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
|
| 5 |
travel_plan_output=""
|
| 6 |
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import random
|
| 3 |
from huggingface_hub import InferenceClient
|
| 4 |
+
import google.generativeai as genai
|
| 5 |
+
import os
|
| 6 |
+
import requests
|
| 7 |
+
import dateparser
|
| 8 |
+
|
| 9 |
+
GOOGLE_API_KEY = os.environ.get("GOOGLE_API_KEY")
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
if GOOGLE_API_KEY:
|
| 13 |
+
genai.configure(api_key=GOOGLE_API_KEY)
|
| 14 |
+
model = genai.GenerativeModel(model_name="gemini-1.5-flash")
|
| 15 |
+
else:
|
| 16 |
+
print("Warning: Google Gemini API key not found. Chatbot will not function.")
|
| 17 |
|
| 18 |
travel_plan_output=""
|
| 19 |
|