File size: 924 Bytes
164a657
f31fa55
164a657
f31fa55
f00ac3f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4e7bcc4
f31fa55
 
164a657
f31fa55
 
4d8ed41
f31fa55
164a657
 
 
 
 
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
import streamlit as st 
import json
import google.generativeai as genai

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

    # Assuming you want to add 'new_goal' and 'reminder' into existing_data 
    existing_data.update(new_data)  

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

# Usage:













GOOGLE_API_KEY="AIzaSyCwSszcd45k1Ce0B48oiQnYPRdTLh49kg8"

genai.configure(api_key=GOOGLE_API_KEY)

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

if prompt := st.chat_input("Hi , what can I do for you "):
    enprom = 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(enprom)
    with st.chat_message("Assistant"):
        st.write(completetion.text)