remove the first message in the post method
This commit is contained in:
@@ -169,7 +169,7 @@ class ProductChatView(APIView):
|
|||||||
formatted_messages = []
|
formatted_messages = []
|
||||||
for message in message_response.data:
|
for message in message_response.data:
|
||||||
for content in message.content:
|
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'
|
sender = 'user' if message.role == 'user' else 'ai'
|
||||||
formatted_messages.append({'sender': sender, 'content': content.text.value})
|
formatted_messages.append({'sender': sender, 'content': content.text.value})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user