Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -216,9 +216,7 @@ class SearchAgentUI:
|
|
216 |
|
217 |
# Sidebar settings
|
218 |
with st.sidebar:
|
219 |
-
|
220 |
-
st.session_state.messages = []
|
221 |
-
agent.clear_chat()
|
222 |
|
223 |
st.title("讛讙讚专讜转")
|
224 |
|
@@ -261,17 +259,21 @@ class SearchAgentUI:
|
|
261 |
|
262 |
# Provider selection in sidebar
|
263 |
with st.sidebar:
|
|
|
|
|
|
|
|
|
264 |
|
265 |
-
|
266 |
st.session_state.provider = available_providers[0]
|
267 |
|
268 |
-
|
269 |
"住驻拽 讘讬谞讛 诪诇讗讻讜转讬转",
|
270 |
options=available_providers,
|
271 |
key='provider',
|
272 |
help="讘讞专 讗转 诪讜讚诇 讛AI 诇砖讬诪讜砖 (专拽 诪讜讚诇讬诐 注诐 诪驻转讞 API 讝诪讬谉 讬讜爪讙讜)"
|
273 |
)
|
274 |
-
|
275 |
agent.set_llm(provider)
|
276 |
|
277 |
|
|
|
216 |
|
217 |
# Sidebar settings
|
218 |
with st.sidebar:
|
219 |
+
|
|
|
|
|
220 |
|
221 |
st.title("讛讙讚专讜转")
|
222 |
|
|
|
259 |
|
260 |
# Provider selection in sidebar
|
261 |
with st.sidebar:
|
262 |
+
|
263 |
+
if st.button("爪'讗讟 讞讚砖"):
|
264 |
+
st.session_state.messages = []
|
265 |
+
agent.clear_chat()
|
266 |
|
267 |
+
if 'provider' not in st.session_state or st.session_state.provider not in available_providers:
|
268 |
st.session_state.provider = available_providers[0]
|
269 |
|
270 |
+
provider = st.selectbox(
|
271 |
"住驻拽 讘讬谞讛 诪诇讗讻讜转讬转",
|
272 |
options=available_providers,
|
273 |
key='provider',
|
274 |
help="讘讞专 讗转 诪讜讚诇 讛AI 诇砖讬诪讜砖 (专拽 诪讜讚诇讬诐 注诐 诪驻转讞 API 讝诪讬谉 讬讜爪讙讜)"
|
275 |
)
|
276 |
+
if agent:
|
277 |
agent.set_llm(provider)
|
278 |
|
279 |
|