fix(api): avoid circular import by deferring protocols import

This commit is contained in:
Zhengshou Lai
2026-06-03 23:45:12 +08:00
parent 334ff647fc
commit 58a141416c
+3 -2
View File
@@ -5,8 +5,6 @@ import json
import uuid
from pathlib import Path
from bin.commands.protocols import EventType, MsgType, full_client_request, receive_message
_RESOURCE_ID = "volc.service_type.10029"
_ENDPOINT = "wss://openspeech.bytedance.com/api/v3/tts/unidirectional/stream"
@@ -33,6 +31,9 @@ def synthesize_tts(
Returns absolute path to the output audio file.
"""
# Delayed import to avoid circular dependency when bin.commands is not yet loaded
from bin.commands.protocols import EventType, MsgType, full_client_request, receive_message
try:
import websockets
except ImportError as e: