Spaces:
Build error
Build error
Commit
·
5202779
1
Parent(s):
4e95c6c
app.py
CHANGED
|
@@ -141,11 +141,10 @@ class EnhancedRetriever:
|
|
| 141 |
def _format_context(self, docs: List[Document]) -> str:
|
| 142 |
context = []
|
| 143 |
for doc in docs:
|
| 144 |
-
context_str = f"""**Source**: {doc.metadata['source']}
|
| 145 |
-
**Application**: {doc.metadata['application']}
|
| 146 |
-
**Concepts**: {', '.join(doc.metadata['technical_concepts'])}
|
| 147 |
-
**Excerpt
|
| 148 |
-
**Reference**: {doc.metadata['hyperlink']}"""
|
| 149 |
context.append(context_str)
|
| 150 |
return "\n\n---\n\n".join(context)
|
| 151 |
|
|
|
|
| 141 |
def _format_context(self, docs: List[Document]) -> str:
|
| 142 |
context = []
|
| 143 |
for doc in docs:
|
| 144 |
+
context_str = f"""**Source**: [{doc.metadata['source']}]({doc.metadata['hyperlink']})
|
| 145 |
+
**Application**: {doc.metadata['application']}
|
| 146 |
+
**Key Concepts**: {', '.join(doc.metadata['technical_concepts'])}
|
| 147 |
+
**Strategy Excerpt**:\n{doc.page_content.split('Strategy Excerpt:')[-1].strip()}"""
|
|
|
|
| 148 |
context.append(context_str)
|
| 149 |
return "\n\n---\n\n".join(context)
|
| 150 |
|