File size: 921 Bytes
4ce5796
 
 
f42fd59
 
 
4ce5796
 
 
4aa102e
4ce5796
3c67127
4ce5796
3c67127
 
4ca7ce8
3c67127
1d44ef4
4ce5796
 
3c67127
4ce5796
0262447
 
4ce5796
 
 
 
 
 
 
c3aaa36
3c3c7f8
c3aaa36
 
3c3c7f8
c3aaa36
 
 
 
 
 
 
4ce5796
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import streamlit as st 
import json
import google.generativeai as genai






def add_to_json():
    with open("test.json", "r") as file:
        data = json.load(file)

    new_item = {
        "goal": new_goal,
        # "reminder": new_reminder
    }
    data["goals"].append(new_item)(new_goal)

    with open("test.json", "w") as file:
        json.dump(data, file, indent=4)

add_to_json()


GOOGLE_API_KEY="AIzaSyCUBaL7TdISL7lRuBy19_X0-OsZfgbIgEc"

genai.configure(api_key=GOOGLE_API_KEY)

model = genai.GenerativeModel('gemini-pro')

if prompt := st.chat_input("Hi, how can I help you?"):
    goals = f""" 
    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}
    :-  {prompt}"""
    completetion = model.generate_content(goals)
    with st.chat_message("Assistant"):
        st.write(completetion.text)