Jashan1 poemsforaphrodite commited on
Commit
5d29a7b
1 Parent(s): b3ff64d
Files changed (1) hide show
  1. app.py +9 -8
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
- formatted_text = f"""
129
- ### Response
130
- {response}
131
-
132
- {"### Citations" if citations else ""}
133
- {"".join([f"- {citation}\n" for citation in citations]) if citations else ""}
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
+