CosmoAI commited on
Commit
1f67cd8
·
verified ·
1 Parent(s): e14b551

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +25 -20
app.py CHANGED
@@ -10,26 +10,26 @@ import google.generativeai as genai
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,10 +40,15 @@ genai.configure(api_key=GOOGLE_API_KEY)
40
 
41
  model = genai.GenerativeModel('gemini-pro')
42
 
43
- if prompt := st.chat_input("Hi"):
44
- enprom = f"""
45
- 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}
46
- :- {prompt}"""
47
- completetion = model.generate_content(enprom)
48
- with st.chat_message("Assistant"):
49
- st.write(completetion.text)
 
 
 
 
 
 
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)