Skip to content

Commit 1ec73bd

Browse files
committed
fix: updated aggregator URL to include /api/v1 suffix in server.py and chat.py for proper API routing
1 parent 775ba94 commit 1ec73bd

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

mcp/server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ def get_sdk_client_for_user(user_email: str) -> Optional["SyftHubSDKClient"]:
221221
# Use internal URLs for container-to-container communication
222222
client = SyftHubSDKClient(
223223
base_url=SYFTHUB_URL, # Internal backend URL (http://backend:8000)
224-
aggregator_url=AGGREGATOR_URL, # Internal aggregator URL (http://aggregator:8001)
224+
aggregator_url=f"{AGGREGATOR_URL.rstrip('/')}/api/v1", # SDK expects URL with /api/v1 suffix
225225
timeout=60.0
226226
)
227227
client.set_tokens(AuthTokens(

sdk/python/src/syfthub_sdk/chat.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ def complete(
501501

502502
try:
503503
response = self._agg_client.post(
504-
f"{self._aggregator_url}/api/v1/chat",
504+
f"{self._aggregator_url}/chat",
505505
json=request_body,
506506
headers={"Content-Type": "application/json"},
507507
)
@@ -627,7 +627,7 @@ def stream(
627627
try:
628628
with self._agg_client.stream(
629629
"POST",
630-
f"{self._aggregator_url}/api/v1/chat/stream",
630+
f"{self._aggregator_url}/chat/stream",
631631
json=request_body,
632632
headers={
633633
"Content-Type": "application/json",

0 commit comments

Comments
 (0)