Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,6 +8,31 @@ with open('config.json', 'r') as f:
|
|
| 8 |
config = json.load(f)
|
| 9 |
|
| 10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
GOOGLE_API_KEY="AIzaSyCUBaL7TdISL7lRuBy19_X0-OsZfgbIgEc"
|
| 13 |
|
|
|
|
| 8 |
config = json.load(f)
|
| 9 |
|
| 10 |
|
| 11 |
+
#save json data
|
| 12 |
+
|
| 13 |
+
def save_data():
|
| 14 |
+
with open ("database/data.json")as file:
|
| 15 |
+
data =json.load(file)
|
| 16 |
+
allchatlog = data["Chatlog"]
|
| 17 |
+
|
| 18 |
+
allchatlog.append(Chatlog)
|
| 19 |
+
|
| 20 |
+
with open("database/data.json","w") as file:
|
| 21 |
+
json.dump(data,file,indent=4 )
|
| 22 |
+
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
Uinput = st.textinput()
|
| 26 |
+
Output = GenAI.jobhi (uinput)
|
| 27 |
+
|
| 28 |
+
Chatlog= {
|
| 29 |
+
user: uinput,
|
| 30 |
+
out : output}
|
| 31 |
+
|
| 32 |
+
save_data()
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
|
| 36 |
|
| 37 |
GOOGLE_API_KEY="AIzaSyCUBaL7TdISL7lRuBy19_X0-OsZfgbIgEc"
|
| 38 |
|