mirror of
https://github.com/zulip/zulip.git
synced 2025-10-23 04:52:12 +00:00
message_summary: Switch to orjson.
This commit is contained in:
committed by
Tim Abbott
parent
816dde5b9a
commit
69524b48b5
@@ -1,6 +1,6 @@
|
||||
import json
|
||||
from typing import Any
|
||||
|
||||
import orjson
|
||||
from django.conf import settings
|
||||
from django.utils.timezone import now as timezone_now
|
||||
|
||||
@@ -47,7 +47,7 @@ def format_zulip_messages_for_model(zulip_messages: list[dict[str, Any]]) -> str
|
||||
{"sender": message["sender_full_name"], "content": message["content"]}
|
||||
for message in zulip_messages
|
||||
]
|
||||
return json.dumps(zulip_messages_list)
|
||||
return orjson.dumps(zulip_messages_list).decode()
|
||||
|
||||
|
||||
def make_message(content: str, role: str = "user") -> dict[str, str]:
|
||||
|
Reference in New Issue
Block a user