DrishtiSharma commited on
Commit
8457558
·
verified ·
1 Parent(s): 16132cd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -3
app.py CHANGED
@@ -222,9 +222,14 @@ def run_agent(
222
 
223
  try:
224
  # Ensure retriever tool is included in tools
225
- if "Retrieval" in st.session_state.tool_names[0] and st.session_state.retriever_tool:
226
- if st.session_state.retriever_tool not in tools:
227
- tools.append(st.session_state.retriever_tool)
 
 
 
 
 
228
 
229
  llm = get_chat_model(model, temperature, [StreamHandler(st.empty())])
230
  if llm is None:
@@ -400,6 +405,11 @@ def get_retriever() -> None:
400
  "this tool!"
401
  ),
402
  )
 
 
 
 
 
403
  st.session_state.uploader_key += 1
404
 
405
 
 
222
 
223
  try:
224
  # Ensure retriever tool is included in tools
225
+
226
+ if st.session_state.retriever_tool:
227
+ st.write("**Retriever tool has been added to the tools list.**")
228
+ if st.session_state.retriever_tool not in tools:
229
+ tools.append(st.session_state.retriever_tool)
230
+ else:
231
+ st.warning("Retriever tool is not available for querying.")
232
+
233
 
234
  llm = get_chat_model(model, temperature, [StreamHandler(st.empty())])
235
  if llm is None:
 
405
  "this tool!"
406
  ),
407
  )
408
+ if st.session_state.retriever_tool:
409
+ st.success("Retriever tool has been successfully initialized.")
410
+ else:
411
+ st.error("Failed to initialize retriever tool.")
412
+
413
  st.session_state.uploader_key += 1
414
 
415