summaryrefslogtreecommitdiffstats
path: root/gui/streamlit_chat_app.py
diff options
context:
space:
mode:
authorcckuailong <346813862@qq.com>2023-04-29 01:38:23 +0200
committercckuailong <346813862@qq.com>2023-04-29 01:38:23 +0200
commit7bfb7fcb3c4a8131c49cea574c867736dbfed9df (patch)
treeb9749f444b6848af20d85b844a5ef20427fac6d0 /gui/streamlit_chat_app.py
parentMerge pull request #243 from xiangsx/main (diff)
downloadgpt4free-7bfb7fcb3c4a8131c49cea574c867736dbfed9df.tar
gpt4free-7bfb7fcb3c4a8131c49cea574c867736dbfed9df.tar.gz
gpt4free-7bfb7fcb3c4a8131c49cea574c867736dbfed9df.tar.bz2
gpt4free-7bfb7fcb3c4a8131c49cea574c867736dbfed9df.tar.lz
gpt4free-7bfb7fcb3c4a8131c49cea574c867736dbfed9df.tar.xz
gpt4free-7bfb7fcb3c4a8131c49cea574c867736dbfed9df.tar.zst
gpt4free-7bfb7fcb3c4a8131c49cea574c867736dbfed9df.zip
Diffstat (limited to '')
-rw-r--r--gui/streamlit_chat_app.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/gui/streamlit_chat_app.py b/gui/streamlit_chat_app.py
index dce8ef29..1c0dd92a 100644
--- a/gui/streamlit_chat_app.py
+++ b/gui/streamlit_chat_app.py
@@ -76,9 +76,10 @@ submit_button = st.button("Submit")
if user_input or submit_button:
output = query(user_input, st.session_state['query_method'])
+ escaped_output = output.encode('utf-8').decode('unicode-escape')
st.session_state.current_conversation['user_inputs'].append(user_input)
- st.session_state.current_conversation['generated_responses'].append(output)
+ st.session_state.current_conversation['generated_responses'].append(escaped_output)
save_conversations(st.session_state.conversations, st.session_state.current_conversation)
user_input = input_placeholder.text_input('You:', value='', key=f'input_text_{len(st.session_state["current_conversation"]["user_inputs"])}') # Clear the input field