Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -1,32 +1 @@
|
|
1 |
-
import google.generativeai as genai
|
2 |
-
import streamlit as st
|
3 |
-
import os
|
4 |
-
import json
|
5 |
-
import random
|
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=os.getenv('AIzaSyAmFDS2OJFixCGuNO2Wh4KP77kVD2lDqLc')
|
14 |
-
|
15 |
-
|
16 |
-
genai.configure(api_key=GOOGLE_API_KEY)
|
17 |
-
model = genai.GenerativeModel('gemini-pro')
|
18 |
-
chat = model.start_chat()
|
19 |
-
chat
|
20 |
-
|
21 |
-
# Generate text
|
22 |
-
if prompt := st.chat_input("Hi, explain me what goal you want to achieve."):
|
23 |
-
enprom = f"""
|
24 |
-
Act as a personal assistant, Understand user intent from the point of view for creating a goal. ask to know more details about the goal.
|
25 |
-
show your suggestions of routines or tasks which will help to achieve the goal as a table of 3 column of Task title, with time to invest, and repetation frequency.
|
26 |
-
Follow all the above instruction for this given input:- {prompt}"""
|
27 |
-
completion = model.generate_content(enprom)
|
28 |
-
|
29 |
-
|
30 |
-
# Print the generated text
|
31 |
-
with st.chat_message("Assistant"):
|
32 |
-
st.write(completion.text)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|