Skip to content

Commit

Permalink
fix iso bug
Browse files Browse the repository at this point in the history
  • Loading branch information
gecBurton committed Oct 17, 2024
1 parent 35ef651 commit 05be406
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions django_app/redbox_app/redbox_core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -789,17 +789,17 @@ def get_messages_ordered_by_citation_priority(cls, chat_id: uuid.UUID) -> Sequen
def log(self):
token_count = self.chatmessagetokenuse_set.annotate(token_count=Sum("token_count"))
elastic_log_msg = {
"@timestamp": self.created_at.isotime(),
"id": self.id,
"chat_id": self.chat.id,
"user_id": self.chat.user.id,
"text": self.text,
"route": self.route,
"@timestamp": self.created_at.isoformat(),
"id": str(self.id),
"chat_id": str(self.chat.id),
"user_id": str(self.chat.user.id),
"text": str(self.text),
"route": str(self.route),
"role": "ai",
"token_count": token_count["token_count"],
"rating": self.rating,
"rating_text": self.rating_text,
"rating_chips": self.rating_chips,
"token_count": int(token_count["token_count"]),
"rating": int(self.rating),
"rating_text": str(self.rating_text),
"rating_chips": list(map(str, self.rating_chips)),
}
es_client.create(env.elastic_chat_mesage_index, uuid.uuid4(), elastic_log_msg)

Expand Down

0 comments on commit 05be406

Please sign in to comment.