diff --git a/ui/chat-chainlit-assistant/app.py b/ui/chat-chainlit-assistant/app.py index 4a8580de..3af798a5 100644 --- a/ui/chat-chainlit-assistant/app.py +++ b/ui/chat-chainlit-assistant/app.py @@ -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 @@ -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 = ""