Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -99,9 +99,11 @@ def convert_to_markdown(vectara_response):
|
|
99 |
sources = response_set.get('response', [])[:5]
|
100 |
sources_text = [source.get('text', '') for source in sources]
|
101 |
|
102 |
-
# Format the summary
|
103 |
markdown_summary = f'**Summary:** {summary_text}\n\n'
|
104 |
-
|
|
|
|
|
105 |
|
106 |
return f"{markdown_summary}**Sources:**\n{markdown_sources}"
|
107 |
else:
|
|
|
99 |
sources = response_set.get('response', [])[:5]
|
100 |
sources_text = [source.get('text', '') for source in sources]
|
101 |
|
102 |
+
# Format the summary as Markdown
|
103 |
markdown_summary = f'**Summary:** {summary_text}\n\n'
|
104 |
+
|
105 |
+
# Format the sources as a numbered list
|
106 |
+
markdown_sources = "\n".join([f"{i+1}. {source}" for i, source in enumerate(sources_text)])
|
107 |
|
108 |
return f"{markdown_summary}**Sources:**\n{markdown_sources}"
|
109 |
else:
|