Skip to content

Commit b42db64

Browse files
authored
feat: default realtime base URL to wss://api.decart.ai (#75)
The realtime WebSocket endpoint is served from api.decart.ai, the same host as the REST API. DecartClient's realtime_base_url now defaults to wss://api.decart.ai; the argument still overrides it and api3.decart.ai keeps working.
1 parent fa1cc10 commit b42db64

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

‎decart/client.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class DecartClient:
2525
Args:
2626
api_key: Your Decart API key. Defaults to the DECART_API_KEY environment variable.
2727
base_url: API base URL for batch/process/queue endpoints (defaults to https://api.decart.ai)
28-
realtime_base_url: WebSocket base URL for realtime streaming (defaults to wss://api3.decart.ai)
28+
realtime_base_url: WebSocket base URL for realtime streaming (defaults to wss://api.decart.ai)
2929
integration: Optional integration identifier (e.g., "langchain/0.1.0")
3030
3131
Example:
@@ -56,7 +56,7 @@ def __init__(
5656
self,
5757
api_key: Optional[str] = None,
5858
base_url: str = "https://api.decart.ai",
59-
realtime_base_url: str = "wss://api3.decart.ai",
59+
realtime_base_url: str = "wss://api.decart.ai",
6060
integration: Optional[str] = None,
6161
) -> None:
6262
resolved_api_key = api_key or os.environ.get("DECART_API_KEY", "").strip() or None

‎tests/test_realtime_unit.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ async def test_realtime_connect_omits_speed_when_unset():
194194
url = await _connect_and_capture_url(model="lucy-2.5")
195195
assert "speed" not in url
196196
assert url == (
197-
"wss://api3.decart.ai/v1/stream"
197+
"wss://api.decart.ai/v1/stream"
198198
"?api_key=test-key&model=lucy-2.5&livekit_early_room_info=true"
199199
)
200200

@@ -203,7 +203,7 @@ async def test_realtime_connect_omits_speed_when_unset():
203203
async def test_realtime_connect_appends_speed_fast():
204204
url = await _connect_and_capture_url(speed="fast", model="lucy-2.5")
205205
assert url == (
206-
"wss://api3.decart.ai/v1/stream"
206+
"wss://api.decart.ai/v1/stream"
207207
"?api_key=test-key&model=lucy-2.5&livekit_early_room_info=true&speed=fast"
208208
)
209209
assert url.count("speed=") == 1
@@ -743,13 +743,13 @@ def post(self, url, headers):
743743

744744
with patch("decart.realtime.client.aiohttp.ClientSession", return_value=fake_session):
745745
room_info = await _fetch_watch_stream_credentials(
746-
base_url="wss://api3.decart.ai",
746+
base_url="wss://api.decart.ai",
747747
api_key="test-key",
748748
room_name="room-123",
749749
)
750750

751751
assert fake_session.post_calls == [
752-
("https://api3.decart.ai/watch-stream/room-123", {"x-api-key": "test-key"})
752+
("https://api.decart.ai/watch-stream/room-123", {"x-api-key": "test-key"})
753753
]
754754
assert room_info.livekit_url == "wss://livekit.example"
755755
assert room_info.session_id == "room-123"

0 commit comments

Comments
 (0)