mirror of
https://github.com/Skyvern-AI/skyvern.git
synced 2025-09-14 09:19:40 +00:00
Sync cloud streamlit to open-source streamlit (#54)
This commit is contained in:
parent
59a4a528e0
commit
647ea2ac0f
1 changed files with 4 additions and 0 deletions
|
@ -3,10 +3,13 @@ from typing import Any
|
||||||
|
|
||||||
import curlify
|
import curlify
|
||||||
import requests
|
import requests
|
||||||
|
import structlog
|
||||||
from requests import PreparedRequest
|
from requests import PreparedRequest
|
||||||
|
|
||||||
from skyvern.forge.sdk.schemas.tasks import TaskRequest
|
from skyvern.forge.sdk.schemas.tasks import TaskRequest
|
||||||
|
|
||||||
|
LOG = structlog.get_logger()
|
||||||
|
|
||||||
|
|
||||||
class SkyvernClient:
|
class SkyvernClient:
|
||||||
def __init__(self, base_url: str, credentials: str):
|
def __init__(self, base_url: str, credentials: str):
|
||||||
|
@ -28,6 +31,7 @@ class SkyvernClient:
|
||||||
|
|
||||||
response = requests.post(url, headers=headers, data=json.dumps(payload))
|
response = requests.post(url, headers=headers, data=json.dumps(payload))
|
||||||
if "task_id" not in response.json():
|
if "task_id" not in response.json():
|
||||||
|
LOG.info(f"Failed to create task: {response.text}")
|
||||||
return None
|
return None
|
||||||
return response.json()["task_id"]
|
return response.json()["task_id"]
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue