DrishtiSharma
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -222,9 +222,14 @@ def run_agent(
|
|
222 |
|
223 |
try:
|
224 |
# Ensure retriever tool is included in tools
|
225 |
-
|
226 |
-
|
227 |
-
|
|
|
|
|
|
|
|
|
|
|
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 |
|