初始化

This commit is contained in:
gouhanke
2026-03-05 18:26:08 +08:00
commit 5073036034
22 changed files with 504 additions and 0 deletions

18
server/ws_messages.py Normal file
View File

@@ -0,0 +1,18 @@
import json
from fastapi import WebSocket
async def send_text_message(websocket: WebSocket, content: str) -> None:
await websocket.send_text(json.dumps({"type": "text", "content": content}))
async def send_audio_message(websocket: WebSocket, audio_data_url: str) -> None:
await websocket.send_text(
json.dumps(
{
"type": "audio",
"content": audio_data_url,
}
)
)