Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -15,24 +15,11 @@ def add_to_json(new_data):
|
|
| 15 |
|
| 16 |
# Usage:
|
| 17 |
new_data = {
|
| 18 |
-
|
| 19 |
-
# "reminder": "Read tutorials"
|
| 20 |
-
|
| 21 |
-
if userinput := st.chat_input("Hi"):
|
| 22 |
-
newuserinput = f"""
|
| 23 |
-
Act as a personal assistant, Understand users intent and tell user their intent while also motivating for setting goals from this input = {userinput}"""
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
-
answer = model.generate_content(newuserinput)
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
with st.chat_message("Assistant"):
|
| 32 |
-
st.write(answer.text)
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
}
|
| 37 |
add_to_json(new_data)
|
| 38 |
|
|
@@ -44,3 +31,17 @@ genai.configure(api_key=GOOGLE_API_KEY)
|
|
| 44 |
model = genai.GenerativeModel('gemini-pro')
|
| 45 |
|
| 46 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
# Usage:
|
| 17 |
new_data = {
|
| 18 |
+
"userinput":
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
}
|
| 24 |
add_to_json(new_data)
|
| 25 |
|
|
|
|
| 31 |
model = genai.GenerativeModel('gemini-pro')
|
| 32 |
|
| 33 |
|
| 34 |
+
if userinput := st.chat_input("Hi"):
|
| 35 |
+
newuserinput = f"""
|
| 36 |
+
Act as a personal assistant, Understand users intent and tell user their intent while also motivating for setting goals from this input = {userinput}"""
|
| 37 |
+
|
| 38 |
+
|
| 39 |
+
|
| 40 |
+
|
| 41 |
+
answer = model.generate_content(newuserinput)
|
| 42 |
+
|
| 43 |
+
|
| 44 |
+
with st.chat_message("Assistant"):
|
| 45 |
+
st.write(answer.text)
|
| 46 |
+
|
| 47 |
+
|