Skip to main content

A lightweight Python client for Skyvern

Project description

skyvern-client

A lightweight Python-based Skyvern client

Setup

git clone git@github.com:elucherini/skyvern-client.git
cd skyvern-client
poetry install
  • Create a .env file in the root with your Skyvern API key. An example is provided in .env_example.

Usage

from dotenv import load_dotenv
from skyvern_client import SkyvernClient

# Initialize client; use https://api.skyvern.com/ for the cloud-hosted skyvern
load_dotenv()
client = SkyvernClient("http://localhost:8000")

# Retrieve all tasks
all_tasks = client.list_tasks()

# Get an existing task by ID
print(client.get_task(all_tasks[0]["task_id"]))

# Create a new task
task_payload = {
    "title": "my title",
    "url": "https://www.target.com",
    "webhook_callback_url": None,
    "navigation_goal": "Go to target.com and add any item to the cart. COMPLETE when an item has been added to "
                       "the cart and the cart is not empty. Do not add more than one item to the cart.",
    "data_extraction_goal": None,
    "proxy_location": "RESIDENTIAL",
    "navigation_payload": None,
    "extracted_information_schema": None,
    "totp_verification_url": None,
    "totp_identifier": None,
    "error_code_mapping": None
}

client.create_task(task_payload)

FAQ

1. Do I need an LLM to use this library?

No, but the Skyvern UI uses an LLM to generate the payload for task generation. That functionality will be available soon. For now, I have imported the prompt used by Skyvern in skyvern-prompts/generate-task.j2. Feel free to prompt your LLM of choice with that prompt and lightly parse the output before calling create_task.

2. Where can I find my Skyvern API key?

Go to the Skyvern UI and click on Settings. Locate the "API Keys" section and click on Reveal.

Alternatively, you may want to create a task through a customized prompt with the UI. After submitting and next to the "Run" button, you will find a "cURL" button. This will copy the cURL request to your clipboard and will look like this:

curl 'https://api.skyvern.com/api/v1/tasks' -X POST -H "Content-Type: application/json" -H "x-api-key: abcde321.abcde1234.edabc321" --data-binary '{"title":null,"url":"https://www.target.com","webhook_callback_url":null,"navigation_goal":null,"data_extraction_goal":null,"proxy_location":"RESIDENTIAL","navigation_payload":"null","extracted_information_schema":null,"totp_verification_url":null,"totp_identifier":null,"error_code_mapping":null}'

Use a text editor to extract the value of x-api-key.

3. Does this library work with Cloud or self-hosted Skyvern?

Both!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

skyvern_client-0.1.0.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

skyvern_client-0.1.0-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file skyvern_client-0.1.0.tar.gz.

File metadata

  • Download URL: skyvern_client-0.1.0.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.5 Darwin/23.1.0

File hashes

Hashes for skyvern_client-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b7408811bb6a6aa2e5ca1da6b820ab063d4b0ed099a0ac2d8932afefae07f5f2
MD5 4aaeb17cab2cb2539894b972996245cc
BLAKE2b-256 d69d75ab2f546f28e8895dd19d1089bfbe49bd3c3828256651fc2854451eb3b3

See more details on using hashes here.

File details

Details for the file skyvern_client-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: skyvern_client-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.5 Darwin/23.1.0

File hashes

Hashes for skyvern_client-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6277e628a4dd86ba99f034609f8099e90a0cf6b8c0924e5d304d0c1e96669bdb
MD5 819cd039856266379b73d142226b5eda
BLAKE2b-256 a1b157933d25b379af6377a91a35cd3107ee8715dc70a98fbf9d7e39eb645092

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page