Update app.py
Browse files
app.py
CHANGED
|
@@ -1,12 +1,29 @@
|
|
| 1 |
-
import google.generativeai as palm
|
| 2 |
-
import streamlit as st
|
| 3 |
-
import os
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
|
| 5 |
# Set your API key
|
| 6 |
-
|
|
|
|
| 7 |
|
| 8 |
-
|
| 9 |
-
model = '
|
| 10 |
|
| 11 |
# Generate text
|
| 12 |
if prompt := st.chat_input("Hi, I can help you manage your daily tasks."):
|
|
|
|
| 1 |
+
# import google.generativeai as palm
|
| 2 |
+
# import streamlit as st
|
| 3 |
+
# import os
|
| 4 |
+
|
| 5 |
+
# # Set your API key
|
| 6 |
+
# palm.configure(api_key = os.environ['PALM_KEY'])
|
| 7 |
+
|
| 8 |
+
# # Select the PaLM 2 model
|
| 9 |
+
# model = 'models/text-bison-001'
|
| 10 |
+
|
| 11 |
+
import google.generativeai as genai
|
| 12 |
+
import gradio as gr
|
| 13 |
+
import os
|
| 14 |
+
import json
|
| 15 |
+
import random
|
| 16 |
+
from getvalues import getValues
|
| 17 |
+
from datetime import datetime, timedelta
|
| 18 |
+
import uuid
|
| 19 |
+
import re
|
| 20 |
|
| 21 |
# Set your API key
|
| 22 |
+
# Or use `os.getenv('GOOGLE_API_KEY')` to fetch an environment variable.
|
| 23 |
+
GOOGLE_API_KEY=os.getenv('PALM_KEY')
|
| 24 |
|
| 25 |
+
genai.configure(api_key=GOOGLE_API_KEY)
|
| 26 |
+
model = genai.GenerativeModel('gemini-pro')
|
| 27 |
|
| 28 |
# Generate text
|
| 29 |
if prompt := st.chat_input("Hi, I can help you manage your daily tasks."):
|