Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -314,22 +314,13 @@ if query:
|
|
| 314 |
|
| 315 |
final_output = context_management_chain({"context":context,"retriever_query":query,"query":query})
|
| 316 |
|
| 317 |
-
st.markdown("## π‘ **Final Answer
|
| 318 |
st.success(final_output["final_response"] if final_output["final_response"] else "β οΈ No clear answer found based on retrieved content.")
|
| 319 |
|
| 320 |
-
|
| 321 |
-
st.
|
| 322 |
-
|
| 323 |
-
|
| 324 |
-
st.markdown("### π **Relevant Contexts Extracted**")
|
| 325 |
-
if isinstance(final_output["relevant_contexts"], list):
|
| 326 |
-
for idx, doc in enumerate(final_output["relevant_contexts"], 1):
|
| 327 |
-
st.write(f"πΉ **Context {idx}:** {doc}")
|
| 328 |
-
else:
|
| 329 |
-
st.warning("β οΈ No relevant contexts available.")
|
| 330 |
-
|
| 331 |
-
with st.expander("π **View Relevance Analysis**"):
|
| 332 |
-
st.markdown("### π **Context Relevancy Scores & Analysis**")
|
| 333 |
if isinstance(final_output["relevancy_response"], list):
|
| 334 |
for item in final_output["relevancy_response"]:
|
| 335 |
st.write(f"β
**Context {item.get('content', 'N/A')} - Score: {item.get('score', 'N/A')}**")
|
|
@@ -337,8 +328,16 @@ if query:
|
|
| 337 |
else:
|
| 338 |
st.warning("β οΈ No relevance analysis available.")
|
| 339 |
|
| 340 |
-
|
| 341 |
-
st.markdown("###
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 342 |
st.write(final_output["context_number"])
|
| 343 |
|
| 344 |
|
|
|
|
| 314 |
|
| 315 |
final_output = context_management_chain({"context":context,"retriever_query":query,"query":query})
|
| 316 |
|
| 317 |
+
st.markdown("## π‘ **Final Answer:**")
|
| 318 |
st.success(final_output["final_response"] if final_output["final_response"] else "β οΈ No clear answer found based on retrieved content.")
|
| 319 |
|
| 320 |
+
# π Expand for Details
|
| 321 |
+
with st.expander("π **View Detailed Processing (Relevance, Retrieved Contexts, Analysis)**"):
|
| 322 |
+
# π Relevance Analysis
|
| 323 |
+
st.markdown("### π **Relevance Analysis**")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 324 |
if isinstance(final_output["relevancy_response"], list):
|
| 325 |
for item in final_output["relevancy_response"]:
|
| 326 |
st.write(f"β
**Context {item.get('content', 'N/A')} - Score: {item.get('score', 'N/A')}**")
|
|
|
|
| 328 |
else:
|
| 329 |
st.warning("β οΈ No relevance analysis available.")
|
| 330 |
|
| 331 |
+
# π Retrieved Contexts
|
| 332 |
+
st.markdown("### π **Retrieved Contexts**")
|
| 333 |
+
if isinstance(final_output["relevant_contexts"], list):
|
| 334 |
+
for idx, doc in enumerate(final_output["relevant_contexts"], 1):
|
| 335 |
+
st.write(f"πΉ **Context {idx}:** {doc}")
|
| 336 |
+
else:
|
| 337 |
+
st.warning("β οΈ No retrieved context available.")
|
| 338 |
+
|
| 339 |
+
# π Retrieved Context Numbers
|
| 340 |
+
st.markdown("### π **Relevant Context Numbers**")
|
| 341 |
st.write(final_output["context_number"])
|
| 342 |
|
| 343 |
|