File size: 1,081 Bytes
bed8fd5
bdd9bb4
05b0abe
bdd9bb4
de23dfa
 
e16e504
 
de23dfa
 
62cd652
 
1f67cd8
 
 
 
62cd652
1f67cd8
62cd652
1f67cd8
 
62cd652
 
 
1f67cd8
 
62cd652
1f67cd8
 
 
62cd652
1f67cd8
62cd652
 
 
de23dfa
d9ca969
bdd9bb4
 
05b0abe
bdd9bb4
 
1f67cd8
 
 
 
 
 
 
 
 
871c773
 
 
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
import streamlit as st 
import json
import google.generativeai as genai


# Load JSON configuration
# with open('config.json', 'r') as f:
#     config = json.load(f)


#save json data

# def save_data():
#     with open("data.json")as file:
#         data =json.load(file)
#         allchatlog = data["chatlog"]

#         allchatlog.append(Chatlog)

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



# Uinput = st.text_input()
# Output = GenAI.jobhi (uinput)

# Chatlog= {
#     user: uinput,
# out : output}

# save_data()
 



GOOGLE_API_KEY="AIzaSyCUBaL7TdISL7lRuBy19_X0-OsZfgbIgEc"

genai.configure(api_key=GOOGLE_API_KEY)

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

if userinput := st.chat_input("Hi"):
    newuserinputstring = 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(newuserinputstring)
    
    
    with st.chat_message("Assistant"):
        st.write(answer)