fix: use self-hosted Skyvern API paths and LiteLLM key

Self-hosted API uses /api/v1/tasks (not /v1/run/tasks), returns
task_id (not run_id). Pass LITELLM_API_KEY as OPENAI_API_KEY.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Christian Gick
2026-03-19 08:41:10 +02:00
parent 4463cdfee9
commit b6acfca59d
3 changed files with 9 additions and 9 deletions

View File

@@ -33,7 +33,7 @@ async def _create_task(url: str, goal: str, extraction_schema: dict | None = Non
async with httpx.AsyncClient(timeout=30.0) as client:
resp = await client.post(
f"{SKYVERN_BASE_URL}/v1/run/tasks",
f"{SKYVERN_BASE_URL}/api/v1/tasks",
headers={
"Content-Type": "application/json",
"x-api-key": SKYVERN_API_KEY,
@@ -42,7 +42,7 @@ async def _create_task(url: str, goal: str, extraction_schema: dict | None = Non
)
resp.raise_for_status()
data = resp.json()
return data["run_id"]
return data["task_id"]
async def _poll_task(run_id: str) -> dict:
@@ -51,7 +51,7 @@ async def _poll_task(run_id: str) -> dict:
async with httpx.AsyncClient(timeout=15.0) as client:
while elapsed < MAX_POLL_TIME:
resp = await client.get(
f"{SKYVERN_BASE_URL}/v1/runs/{run_id}",
f"{SKYVERN_BASE_URL}/api/v1/tasks/{run_id}",
headers={"x-api-key": SKYVERN_API_KEY},
)
resp.raise_for_status()