Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,27 +1,17 @@
|
|
| 1 |
-
import
|
| 2 |
-
import streamlit as st
|
| 3 |
-
import os
|
| 4 |
import json
|
| 5 |
-
import
|
| 6 |
-
# from getvalues import getValues
|
| 7 |
-
from datetime import datetime, timedelta
|
| 8 |
-
import uuid
|
| 9 |
-
import re
|
| 10 |
|
| 11 |
-
# Set your API key
|
| 12 |
-
# Or use `os.getenv('GOOGLE_API_KEY')` to fetch an environment variable.
|
| 13 |
GOOGLE_API_KEY="AIzaSyCwSszcd45k1Ce0B48oiQnYPRdTLh49kg8"
|
| 14 |
|
| 15 |
genai.configure(api_key=GOOGLE_API_KEY)
|
|
|
|
| 16 |
model = genai.GenerativeModel('gemini-pro')
|
| 17 |
|
| 18 |
-
|
| 19 |
-
if prompt := st.chat_input("Hi"):
|
| 20 |
enprom = f"""
|
| 21 |
-
Act as a personal assistant, Understand user intent from the point of view for
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
with st.chat_message("Assistant"):
|
| 27 |
-
st.write(completetion.txt)
|
|
|
|
| 1 |
+
import streamlit as st
|
|
|
|
|
|
|
| 2 |
import json
|
| 3 |
+
import google.generativeai as genai
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
|
|
|
|
|
|
|
| 5 |
GOOGLE_API_KEY="AIzaSyCwSszcd45k1Ce0B48oiQnYPRdTLh49kg8"
|
| 6 |
|
| 7 |
genai.configure(api_key=GOOGLE_API_KEY)
|
| 8 |
+
|
| 9 |
model = genai.GenerativeModel('gemini-pro')
|
| 10 |
|
| 11 |
+
if prompt := st.chat_input("Hi, how can I help you?"):
|
|
|
|
| 12 |
enprom = f"""
|
| 13 |
+
Act as a personal assistant, Understand user intent from the point of view for asking a few questions. ask to know more details about {prompt}
|
| 14 |
+
:- {prompt}"""
|
| 15 |
+
completetion = model.generate_content(enprom)
|
| 16 |
+
with st.chat_message("Assistant"):
|
| 17 |
+
st.write(completetion.text)
|
|
|
|
|
|