diff --git a/README.md b/README.md index fefb4cfd..36b61634 100644 --- a/README.md +++ b/README.md @@ -102,6 +102,33 @@ This quickstart guide will walk you through getting Skyvern up and running on yo skyvern run ui ``` +5. **Run task** +Run a skyvern task locally: +```python +from skyvern import Skyvern + +skyvern = Skyvern() +task = await skyvern.run_task(prompt="Find the top post on hackernews today") +print(task) +``` +You should see your local browser + +You can also send a task to Skyvern Cloud +```python +from skyvern import Skyvern + +skyvern = Skyvern() +task = await skyvern.agent.run_task(prompt="Find the top post on hackernews today") +print(task) +``` + +Or anywhere Skyvern is hosted: +```python +skyvern = Skyvern(base_url="http://localhost:8000", api_key="SKYVERN API KEY in LOCAL SKYVERN") +task = await skyvern.agent.run_task(prompt="Find the top post on hackernews today") +print(task) +``` + ## Docker Compose setup 1. Make sure you have [Docker Desktop](https://www.docker.com/products/docker-desktop/) installed and running on your machine diff --git a/fern/introduction.mdx b/fern/introduction.mdx index cafc367c..7d0a0391 100644 --- a/fern/introduction.mdx +++ b/fern/introduction.mdx @@ -70,6 +70,36 @@ Skyvern was inspired by the Task-Driven autonomous agent design popularized by [ ## Quickstart +### Python SDK Installation +```bash +pip install skyvern +``` + +### Run Task +After initializing your local Skyvern setup, you can run agent tasks in any python code: +```python +from skyvern import Skyvern + +skyvern = Skyvern() + +task = await skyvern.run_task(prompt="Find the top post on hackernews today") +print(task) +``` + +### Run Task In Skyvern Service +Get your API key from [Skyvern Cloud](https://app.skyvern.com/settings) and to use Skyvern Cloud to run the task: +```python +from skyvern import Skyvern + +skyvern = Skyvern(api_key="YOUR API KEY") +# OR pass the base_url to use any Skyvern service +# skyvern = Skyvern(base_url="http://localhost:8000", api_key="YOUR API KEY") + +task = await skyvern.agent.run_task(prompt="Find the top post on hackernews today") +print(task) +``` +More API & SDK information can be found in the [API Reference](/api-reference) section. +