make wait_for_completion=False by default for run_task function in the python lib (#2500)
This commit is contained in:
101
README.md
101
README.md
@@ -43,51 +43,96 @@ Want to see examples of Skyvern in action? Jump to [#real-world-examples-of-skyv
|
||||
|
||||
If you'd like to try it out, navigate to [app.skyvern.com](https://app.skyvern.com) and create an account.
|
||||
|
||||
## Local Install & Run
|
||||
> ⚠️ **REQUIREMENT**: This project requires at least Python 3.11 ⚠️
|
||||
## Install & Run
|
||||
> ⚠️ **Supported Python Versions**: Python 3.11, 3.12, 3.13 ⚠️
|
||||
|
||||
1. **Install Skyvern**
|
||||
### 1. Install Skyvern
|
||||
|
||||
```bash
|
||||
pip install skyvern
|
||||
```
|
||||
|
||||
2. **Run Skyvern**
|
||||
### 2. Run Skyvern
|
||||
|
||||
```bash
|
||||
skyvern quickstart
|
||||
```
|
||||
|
||||
3. **Run task**
|
||||
### 3. Run task
|
||||
|
||||
Run a skyvern task locally:
|
||||
```python
|
||||
from skyvern import Skyvern
|
||||
```python
|
||||
from skyvern import Skyvern
|
||||
|
||||
skyvern = Skyvern()
|
||||
task = await skyvern.run_task(prompt="Find the top post on hackernews today")
|
||||
print(task)
|
||||
```
|
||||
A local browser will pop up. Skyvern will start executing the task in the browser and close the it when the task is done. You will be able to review the task from http://localhost:8080/history
|
||||
skyvern = Skyvern()
|
||||
task = await skyvern.run_task(prompt="Find the top post on hackernews today")
|
||||
print(task)
|
||||
```
|
||||
A browser will pop up. Skyvern will start executing the task in the browser and close the it when the task is done. You will be able to review the task from http://localhost:8080/history
|
||||
|
||||
You can also run a task autonomously on Skyvern Cloud:
|
||||
```python
|
||||
from skyvern import Skyvern
|
||||
|
||||
skyvern = Skyvern(api_key="SKYVERN API KEY")
|
||||
task = await skyvern.run_task(prompt="Find the top post on hackernews today")
|
||||
print(task)
|
||||
```
|
||||
|
||||
Or any hosted Skyvern service:
|
||||
```python
|
||||
skyvern = Skyvern(base_url="http://localhost:8000", api_key="SKYVERN API KEY")
|
||||
task = await skyvern.run_task(prompt="Find the top post on hackernews today")
|
||||
print(task)
|
||||
```
|
||||
|
||||
Check out more features to use for Skyvern task in our [official doc](https://docs.skyvern.com/running-tasks/run-tasks). Here are a couple of interesting examples:
|
||||
#### Let Skyvern control your own browser
|
||||
Firstly, add two variables to your .env file:
|
||||
```
|
||||
# This is the path to your local chromium-compatible browser. We're using Google Chrome in Mac as an example
|
||||
CHROME_EXECUTABLE_PATH="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
|
||||
BROWSER_TYPE=cdp-connect
|
||||
```
|
||||
|
||||
Secondly, make sure you quit your browser (Skyvern will restart it) and run the task:
|
||||
```python
|
||||
from skyvern import Skyvern
|
||||
|
||||
skyvern = Skyvern()
|
||||
task = await skyvern.run_task(prompt="Find the top post on hackernews today")
|
||||
```
|
||||
|
||||
#### Get consistent output schema from your run
|
||||
You can do this by adding the `data_extraction_schema` parameter:
|
||||
```python
|
||||
from skyvern import Skyvern
|
||||
|
||||
skyvern = Skyvern()
|
||||
task = await skyvern.run_task(
|
||||
prompt="Find the top post on hackernews today",
|
||||
data_extraction_schema={
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"title": {
|
||||
"type": "string",
|
||||
"description": "The title of the top post"
|
||||
},
|
||||
"url": {
|
||||
"type": "string",
|
||||
"description": "The URL of the top post"
|
||||
},
|
||||
"points": {
|
||||
"type": "integer",
|
||||
"description": "Number of points the post has received"
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
```
|
||||
|
||||
You can also run a task autonomously on Skyvern Cloud:
|
||||
```python
|
||||
from skyvern import Skyvern
|
||||
|
||||
skyvern = Skyvern(api_key="SKYVERN API KEY")
|
||||
task = await skyvern.run_task(prompt="Find the top post on hackernews today")
|
||||
print(task)
|
||||
```
|
||||
Or any hosted Skyvern service:
|
||||
```python
|
||||
skyvern = Skyvern(base_url="http://localhost:8000", api_key="SKYVERN API KEY")
|
||||
task = await skyvern.run_task(prompt="Find the top post on hackernews today")
|
||||
print(task)
|
||||
```
|
||||
|
||||
### Helpful commands to debug issues
|
||||
|
||||
|
||||
**Launch the Skyvern Server Separately**
|
||||
|
||||
```bash
|
||||
|
||||
Reference in New Issue
Block a user