Spaces:
Sleeping
Sleeping
Commit
•
5d29a7b
1
Parent(s):
b3ff64d
update (#1)
Browse files- update (29ac834d86dd07259f41aaea2c6167e9b9f3880f)
Co-authored-by: push <poemsforaphrodite@users.noreply.huggingface.co>
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 |
+
|