Add chatId in ws connection

This commit is contained in:
Xin Wang
2026-05-31 22:46:48 +08:00
parent 5cbfd0f0fa
commit 402ad81cb6
14 changed files with 106 additions and 12 deletions

View File

@@ -103,10 +103,12 @@ class ProductWebsocketSerializer(FrameSerializer):
message_type = message.get("type")
if message_type == "session.start":
chat_id = message.get("chatId") or message.get("chat_id")
return InputTransportMessageFrame(
message={
"type": "session.started",
"protocol": self.protocol,
"chatId": chat_id if isinstance(chat_id, str) else None,
"audio": {
"encoding": "pcm_s16le",
"sample_rate": self._sample_rate,