Spaces:
				
			
			
	
			
			
		Build error
		
	
	
	
			
			
	
	
	
	
		
		
		Build error
		
	File size: 1,019 Bytes
			
			| bed8fd5 bdd9bb4 05b0abe bdd9bb4 de23dfa d51420d 852aeb1 d51420d 83f1d28 97ef7b0 852aeb1 d51420d 97ef7b0 b8f6237 1f67cd8 6b8ac8b ca48c47 001496d e0f18c1 21a600f f42fd59 e0f18c1 f42fd59 e0f18c1 f42fd59 | 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 48 49 50 51 52 53 54 55 56 | import streamlit as st 
import json
import google.generativeai as genai
def add_to_json(new_data):
    with open("test.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("test.json", "w") as file:
        json.dump(existing_data, file, indent=4)
# Usage:
new_data = {
    
    
      "goal":  "userinput ",
      
   
}
    
   
 # st.button("Save",on_click=add_to_json) 
GOOGLE_API_KEY="AIzaSyCUBaL7TdISL7lRuBy19_X0-OsZfgbIgEc"
genai.configure(api_key=GOOGLE_API_KEY)
model = genai.GenerativeModel('gemini-pro')
if userinput := st.chat_input("Hi"):
      newuserinput = f""" 
           Act as a personal assistant, Understand users intent and tell user their intent while also motivating for setting goals from this input = {userinput}"""
answer = model.generate_content(newuserinput)
    
    
with st.chat_message("Assistant"):
    st.write(answer.text)
 | 
