Spaces:
Sleeping
Sleeping
update
#1
by poemsforaphrodite - opened
app.py
CHANGED
|
@@ -125,14 +125,13 @@ def create_assistant():
|
|
| 125 |
|
| 126 |
def format_response(response, citations):
|
| 127 |
"""Format the response with proper markdown structure."""
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
""
|
| 135 |
-
return formatted_text.strip()
|
| 136 |
|
| 137 |
def response_generator(response, citations):
|
| 138 |
"""Generator for streaming response with structured output."""
|
|
@@ -521,3 +520,5 @@ elif page == "Admin":
|
|
| 521 |
|
| 522 |
|
| 523 |
|
|
|
|
|
|
|
|
|
| 125 |
|
| 126 |
def format_response(response, citations):
|
| 127 |
"""Format the response with proper markdown structure."""
|
| 128 |
+
parts = ["### Response", response]
|
| 129 |
+
|
| 130 |
+
if citations:
|
| 131 |
+
parts.extend(["### Citations"])
|
| 132 |
+
parts.extend(f"- {citation}" for citation in citations)
|
| 133 |
+
|
| 134 |
+
return "\n\n".join(parts)
|
|
|
|
| 135 |
|
| 136 |
def response_generator(response, citations):
|
| 137 |
"""Generator for streaming response with structured output."""
|
|
|
|
| 520 |
|
| 521 |
|
| 522 |
|
| 523 |
+
|
| 524 |
+
|