XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet
公开
关注 0 Fork 0 Star 1
返回提交历史

XFEstudio/gpt4free

Update streamlit_chat_app.py

08f53b33
– sanz <sanzbernward@gmail.com>
提交于

代码差异

1 个文件 +3 -4
Modified gui/streamlit_chat_app.py +3 -4
@@ -74,7 +74,6 @@ user_input = input_placeholder.text_input(
74 74 )
75 75 submit_button = st.button("Submit")
76 76
77
78 77 if (user_input and user_input != st.session_state['input_text']) or submit_button:
79 78 output = query(user_input, st.session_state['query_method'])
80 79
@@ -84,6 +83,7 @@ if (user_input and user_input != st.session_state['input_text']) or submit_butto
84 83 st.session_state.current_conversation['generated_responses'].append(escaped_output)
85 84 save_conversations(st.session_state.conversations, st.session_state.current_conversation)
86 85 st.session_state['input_text'] = ''
86 st.session_state['input_field_key'] += 1 # Increment key value for new widget
87 87 user_input = input_placeholder.text_input(
88 88 'You:', value=st.session_state['input_text'], key=f'input_text_{st.session_state["input_field_key"]}'
89 89 ) # Clear the input field
@@ -92,9 +92,8 @@ if (user_input and user_input != st.session_state['input_text']) or submit_butto
92 92 if st.sidebar.button("New Conversation"):
93 93 st.session_state['selected_conversation'] = None
94 94 st.session_state['current_conversation'] = {'user_inputs': [], 'generated_responses': []}
95 st.session_state['input_field_key'] += 1
96
97 st.session_state['query_method'] = st.sidebar.selectbox("Select API:", options=avail_query_methods, index=0)
95 st.session_state['input_field_key'] += 1 # Increment key value for new widget
96 st.session_state['query_method'] = st.sidebar.selectbox("Select API:", options=avail_query_methods, index=0)
98 97
99 98 # Proxy
100 99 st.session_state['proxy'] = st.sidebar.text_input("Proxy: ")