un reverse
This commit is contained in:
@@ -129,7 +129,7 @@ class ProductChatView(APIView):
|
|||||||
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})
|
||||||
|
|
||||||
formatted_messages.reverse()
|
# formatted_messages.reverse()
|
||||||
paginator = StructurePagination()
|
paginator = StructurePagination()
|
||||||
paginated_messages = paginator.paginate_queryset(formatted_messages, request)
|
paginated_messages = paginator.paginate_queryset(formatted_messages, request)
|
||||||
return paginator.get_paginated_response(paginated_messages)
|
return paginator.get_paginated_response(paginated_messages)
|
||||||
@@ -172,7 +172,7 @@ class ProductChatView(APIView):
|
|||||||
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:
|
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})
|
||||||
formatted_messages.reverse()
|
# formatted_messages.reverse()
|
||||||
paginator = StructurePagination()
|
paginator = StructurePagination()
|
||||||
paginated_messages = paginator.paginate_queryset(formatted_messages, request)
|
paginated_messages = paginator.paginate_queryset(formatted_messages, request)
|
||||||
return paginator.get_paginated_response(paginated_messages)
|
return paginator.get_paginated_response(paginated_messages)
|
||||||
Reference in New Issue
Block a user