diff --git a/backend/chat/views.py b/backend/chat/views.py index ee3c96c..a97060c 100644 --- a/backend/chat/views.py +++ b/backend/chat/views.py @@ -169,7 +169,7 @@ class ProductChatView(APIView): formatted_messages = [] for message in message_response.data: for content in message.content: - if content.type == "text": + if content.type == "text" and 'this is the start of the chat greet the user this chat is about the product with given detail:' not in content.text.value: sender = 'user' if message.role == 'user' else 'ai' formatted_messages.append({'sender': sender, 'content': content.text.value})