Skip to content

Commit

Permalink
Merge pull request #36 from hackathon-Vink-Team-3/dev
Browse files Browse the repository at this point in the history
Fixes.
  • Loading branch information
AndreyDogadkin authored Apr 8, 2024
2 parents 463bd74 + dd01411 commit 2804f54
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion chat_bot/src/apps/chat/consumers.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ async def get_gpt_answer(self, message: str) -> str:
message=message,
chat_uuid=chat_uuid,
)
await self.save_message(message_text=gpt_answer, sender_type="bot")
logger.info("The response from GPT has been received.")
return gpt_answer

Expand Down
2 changes: 1 addition & 1 deletion chat_bot/src/apps/chat/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,4 +168,4 @@ class SenderType(models.TextChoices):
class Meta:
verbose_name = "Сообщение"
verbose_name_plural = "Сообщения"
ordering = ["-created_date"]
ordering = ["created_date"]
2 changes: 1 addition & 1 deletion chat_bot/src/apps/chat/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class Meta:
)

def get_first_message_text(self, obj: Dialog) -> str | None:
first_message = Message.objects.filter(dialog_id=obj.id).first()
first_message = Message.objects.filter(dialog_id=obj.id).last()
return first_message.text if first_message else None

def create(self, validated_data):
Expand Down

0 comments on commit 2804f54

Please sign in to comment.