Skip to content

Commit

Permalink
Minor fix for when there are no citations
Browse files Browse the repository at this point in the history
  • Loading branch information
dividor committed Jul 16, 2024
1 parent 9e7e87c commit 288cc6b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ui/chat-chainlit-assistant/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,8 @@ def handle_message_completed(self, message):
None
"""

citations = None

# Check for citations
if hasattr(message.content[0], "text"):
message_content = message.content[0].text
Expand Down Expand Up @@ -232,7 +234,7 @@ def handle_message_completed(self, message):

word_count = len(self.current_message_text.split())
if word_count > 10:
if citations is not None:
if citations is not None and len(citations) > 0:
citations = "; Sources: " + "; ".join(citations)
else:
citations = ""
Expand Down

0 comments on commit 288cc6b

Please sign in to comment.