fix(api): avoid circular import by deferring protocols import
This commit is contained in:
+3
-2
@@ -5,8 +5,6 @@ import json
|
|||||||
import uuid
|
import uuid
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from bin.commands.protocols import EventType, MsgType, full_client_request, receive_message
|
|
||||||
|
|
||||||
_RESOURCE_ID = "volc.service_type.10029"
|
_RESOURCE_ID = "volc.service_type.10029"
|
||||||
_ENDPOINT = "wss://openspeech.bytedance.com/api/v3/tts/unidirectional/stream"
|
_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.
|
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:
|
try:
|
||||||
import websockets
|
import websockets
|
||||||
except ImportError as e:
|
except ImportError as e:
|
||||||
|
|||||||
Reference in New Issue
Block a user