Update LLMInsights.py
Browse files- LLMInsights.py +14 -15
LLMInsights.py
CHANGED
|
@@ -410,24 +410,23 @@ with tab1:
|
|
| 410 |
st.markdown(f'<div style="max-height: 300px; overflow-y: auto; background-color:#f0f0f0; padding:10px; border-radius:10px;">{cleaned_context}</div>', unsafe_allow_html=True)
|
| 411 |
|
| 412 |
|
| 413 |
-
|
|
|
|
|
|
|
|
|
|
| 414 |
formatted_metadata_list = []
|
| 415 |
for i, metadata in enumerate(metadata_list, start=1):
|
| 416 |
-
|
| 417 |
-
source = metadata.get('source', '').replace('\n', '')
|
| 418 |
-
title = metadata.get('title', '').replace('\n', '')
|
| 419 |
-
description = metadata.get('description', '').replace('\n', '')
|
| 420 |
-
|
| 421 |
-
|
| 422 |
-
|
| 423 |
-
formatted_metadata += f"<span style='color:#ff9900; font-weight:bold;'>Description:</span> <span style='color:#ff0000;'>{description}</span><br><br>"
|
| 424 |
-
|
| 425 |
-
formatted_metadata_list.append(formatted_metadata)
|
| 426 |
-
|
| 427 |
metadata_text = '\n'.join(formatted_metadata_list)
|
| 428 |
-
|
| 429 |
-
|
| 430 |
-
st.markdown(
|
| 431 |
|
| 432 |
|
| 433 |
|
|
|
|
| 410 |
st.markdown(f'<div style="max-height: 300px; overflow-y: auto; background-color:#f0f0f0; padding:10px; border-radius:10px;">{cleaned_context}</div>', unsafe_allow_html=True)
|
| 411 |
|
| 412 |
|
| 413 |
+
# Augmented Knowledge Metadata Section
|
| 414 |
+
metadata_header = '<h2 style="color:#100170;">Augmented Knowledge Metadata</h2>'
|
| 415 |
+
metadata_container = '<div style="max-height: 300px; overflow-y: auto; background-color:#f0f0f0; padding:10px; border-radius:10px;">{}</div>'
|
| 416 |
+
|
| 417 |
formatted_metadata_list = []
|
| 418 |
for i, metadata in enumerate(metadata_list, start=1):
|
| 419 |
+
metadata_item = f"<h3 style='color:#3366ff;'>Metadata {i}:</h3>"
|
| 420 |
+
source = f"<span style='color:#ff9900; font-weight:bold;'>Source:</span> <span style='color:#009900;'>{metadata.get('source', '').replace('\n', '')}</span><br>"
|
| 421 |
+
title = f"<span style='color:#ff9900; font-weight:bold;'>Title:</span> <span style='color:#cc00cc;'>{metadata.get('title', '').replace('\n', '')}</span><br>"
|
| 422 |
+
description = f"<span style='color:#ff9900; font-weight:bold;'>Description:</span> <span style='color:#ff0000;'>{metadata.get('description', '').replace('\n', '')}</span><br><br>"
|
| 423 |
+
formatted_metadata_item = f"{metadata_item}{source}{title}{description}"
|
| 424 |
+
formatted_metadata_list.append(formatted_metadata_item)
|
| 425 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
| 426 |
metadata_text = '\n'.join(formatted_metadata_list)
|
| 427 |
+
formatted_metadata_section = metadata_header + metadata_container.format(metadata_text)
|
| 428 |
+
|
| 429 |
+
st.markdown(formatted_metadata_section, unsafe_allow_html=True)
|
| 430 |
|
| 431 |
|
| 432 |
|