diff --git a/cron/browser_executor.py b/cron/browser_executor.py index 888bc77..815fbe3 100644 --- a/cron/browser_executor.py +++ b/cron/browser_executor.py @@ -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() diff --git a/docker-compose.yml b/docker-compose.yml index d6e4070..49270f4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -80,8 +80,8 @@ services: restart: unless-stopped environment: DATABASE_STRING: postgresql+psycopg://skyvern:${SKYVERN_DB_PASSWORD:-skyvern}@skyvern-db:5432/skyvern - OPENAI_API_KEY: placeholder - OPENAI_API_BASE: ${LITELLM_BASE_URL} + OPENAI_API_KEY: ${LITELLM_API_KEY} + OPENAI_API_BASE: ${LITELLM_BASE_URL}/v1 LLM_KEY: OPENAI_GPT4O SECONDARY_LLM_KEY: OPENAI_GPT4O_MINI BROWSER_TYPE: chromium-headful @@ -96,7 +96,7 @@ services: skyvern-db: condition: service_healthy healthcheck: - test: ["CMD", "curl", "-f", "http://127.0.0.1:8000/api/v1/health"] + test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/api/v1/heartbeat')"] interval: 30s timeout: 10s retries: 3 diff --git a/pipelines/steps/skyvern.py b/pipelines/steps/skyvern.py index 232f65e..0cd3c24 100644 --- a/pipelines/steps/skyvern.py +++ b/pipelines/steps/skyvern.py @@ -68,12 +68,12 @@ async def execute_skyvern(config: dict, send_text=None, target_room: str = "", * 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=headers, json=payload, ) resp.raise_for_status() - run_id = resp.json()["run_id"] + run_id = resp.json()["task_id"] logger.info("Skyvern pipeline task created: %s", run_id) @@ -85,7 +85,7 @@ async def execute_skyvern(config: dict, send_text=None, target_room: str = "", * async with httpx.AsyncClient(timeout=15.0) as client: while elapsed < max_poll: 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()