Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,26 +10,26 @@ import google.generativeai as genai
|
|
| 10 |
|
| 11 |
#save json data
|
| 12 |
|
| 13 |
-
def save_data():
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
|
| 18 |
-
|
| 19 |
|
| 20 |
-
|
| 21 |
-
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
-
Uinput = st.text_input()
|
| 26 |
-
Output = GenAI.jobhi (uinput)
|
| 27 |
|
| 28 |
-
Chatlog= {
|
| 29 |
-
|
| 30 |
-
out : output}
|
| 31 |
|
| 32 |
-
save_data()
|
| 33 |
|
| 34 |
|
| 35 |
|
|
@@ -40,10 +40,15 @@ genai.configure(api_key=GOOGLE_API_KEY)
|
|
| 40 |
|
| 41 |
model = genai.GenerativeModel('gemini-pro')
|
| 42 |
|
| 43 |
-
if
|
| 44 |
-
|
| 45 |
-
Act as a personal assistant, Understand
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
#save json data
|
| 12 |
|
| 13 |
+
# def save_data():
|
| 14 |
+
# with open("data.json")as file:
|
| 15 |
+
# data =json.load(file)
|
| 16 |
+
# allchatlog = data["chatlog"]
|
| 17 |
|
| 18 |
+
# allchatlog.append(Chatlog)
|
| 19 |
|
| 20 |
+
# with open("data.json","w") as file:
|
| 21 |
+
# json.dump(data,file,indent=4 )
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
+
# Uinput = st.text_input()
|
| 26 |
+
# Output = GenAI.jobhi (uinput)
|
| 27 |
|
| 28 |
+
# Chatlog= {
|
| 29 |
+
# user: uinput,
|
| 30 |
+
# out : output}
|
| 31 |
|
| 32 |
+
# save_data()
|
| 33 |
|
| 34 |
|
| 35 |
|
|
|
|
| 40 |
|
| 41 |
model = genai.GenerativeModel('gemini-pro')
|
| 42 |
|
| 43 |
+
if userinput := st.chat_input("Hi"):
|
| 44 |
+
newuserinputstring = f"""
|
| 45 |
+
Act as a personal assistant, Understand users intent and tell user their intent while also motivating for setting goals from this input = {userinput}"""
|
| 46 |
+
|
| 47 |
+
|
| 48 |
+
|
| 49 |
+
|
| 50 |
+
answer = model.generate_content(newuserinputstring)
|
| 51 |
+
|
| 52 |
+
|
| 53 |
+
# with st.chat_message("Assistant"):
|
| 54 |
+
# st.write(completetion.text)
|