Spaces:
Sleeping
Sleeping
Mimi
commited on
Commit
·
efdee19
1
Parent(s):
f3bf560
fixed typo
Browse files- app.py +11 -2
- data_utils.py +0 -2
app.py
CHANGED
|
@@ -49,8 +49,16 @@ def open_intake_form():
|
|
| 49 |
def open_chat_window(**kwargs):
|
| 50 |
# adds to current state (deletes if doesnt)
|
| 51 |
st.session_state.update(kwargs)
|
| 52 |
-
st.session_state.naomi = Naomi(**kwargs)
|
| 53 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
if "messages" not in st.session_state:
|
| 55 |
st.session_state.messages = ChatSession()
|
| 56 |
|
|
@@ -73,7 +81,8 @@ def open_chat_window(**kwargs):
|
|
| 73 |
st.session_state.messages.add_message(role='assistant', content=response)
|
| 74 |
|
| 75 |
undo_button, reset_button = st.columns(2)
|
| 76 |
-
|
|
|
|
| 77 |
st.session_state['undo_button'] = True
|
| 78 |
if reset_button.button('Reset chat', use_container_width=True, type='primary'):
|
| 79 |
st.session_state.clear()
|
|
|
|
| 49 |
def open_chat_window(**kwargs):
|
| 50 |
# adds to current state (deletes if doesnt)
|
| 51 |
st.session_state.update(kwargs)
|
|
|
|
| 52 |
|
| 53 |
+
if 'naomi' not in st.session_state:
|
| 54 |
+
inputs = dict(
|
| 55 |
+
name=kwargs.get('name', None),
|
| 56 |
+
contact_type=kwargs.get('contact_type', None),
|
| 57 |
+
contact=kwargs.get('contact', None),
|
| 58 |
+
dob=kwargs.get('dob', None),
|
| 59 |
+
location=kwargs.get('location', None)
|
| 60 |
+
)
|
| 61 |
+
st.session_state.naomi = Naomi(**inputs)
|
| 62 |
if "messages" not in st.session_state:
|
| 63 |
st.session_state.messages = ChatSession()
|
| 64 |
|
|
|
|
| 81 |
st.session_state.messages.add_message(role='assistant', content=response)
|
| 82 |
|
| 83 |
undo_button, reset_button = st.columns(2)
|
| 84 |
+
# TODO: Add undo buttn haha
|
| 85 |
+
if undo_button.button('Does Nothing button', use_container_width=True, type='secondary'):
|
| 86 |
st.session_state['undo_button'] = True
|
| 87 |
if reset_button.button('Reset chat', use_container_width=True, type='primary'):
|
| 88 |
st.session_state.clear()
|
data_utils.py
CHANGED
|
@@ -229,8 +229,6 @@ def new_user(**kwargs):
|
|
| 229 |
|
| 230 |
kwargs.pop('contact_type')
|
| 231 |
kwargs.pop('contact')
|
| 232 |
-
kwargs.pop('intake_submission')
|
| 233 |
-
|
| 234 |
return Candidate(**kwargs)
|
| 235 |
|
| 236 |
if __name__ == "__main__":
|
|
|
|
| 229 |
|
| 230 |
kwargs.pop('contact_type')
|
| 231 |
kwargs.pop('contact')
|
|
|
|
|
|
|
| 232 |
return Candidate(**kwargs)
|
| 233 |
|
| 234 |
if __name__ == "__main__":
|