Myranda commited on
Commit
06e4f99
·
1 Parent(s): df6534a

Merge pull request #134 from vanderbilt-data-science/122-save-drafts

Browse files
Files changed (1) hide show
  1. app.py +8 -0
app.py CHANGED
@@ -212,6 +212,14 @@ if authentication_status:
212
  key='draft_response_key'
213
  )
214
 
 
 
 
 
 
 
 
 
215
  # Initialization of the regeneration flag
216
  if 'is_regenerating' not in st.session_state:
217
  st.session_state.is_regenerating = False
 
212
  key='draft_response_key'
213
  )
214
 
215
+ # Add option to save responses
216
+ if st.button("Save This Response"):
217
+ #user_data["writing_style"] += st.session_state.draft_response
218
+ writing_style = user_data["writing_style"] + "\n" + st.session_state.draft_response
219
+
220
+ db.put({"key": username, "writing_style": writing_style})
221
+ st.write("Response saved to your writing style.")
222
+
223
  # Initialization of the regeneration flag
224
  if 'is_regenerating' not in st.session_state:
225
  st.session_state.is_regenerating = False