Prava Python SDK – OpenAI-like API client for LLMs.
Project description
Prava Python SDK
The official Python SDK for Prava's computer automation APIs.
Installation
pip install prava
Quick Start
from prava import ControlClient
# Set your API key
import os
os.environ["PRAVA_API_KEY"] = "dummy"
# Initialize client
client = ControlClient()
# Take a screenshot and get an action
response = client.predict({
"model": "prava-af-medium",
"instruction": "Click the login button",
"image_url": "data:image/png;base64,..."
})
# Execute the action
action = response["action"]
print(f"Action: {action['kind']} at {action.get('coordinate')}")
Complete Example
from playwright.sync_api import sync_playwright
from prava import ControlClient
client = ControlClient()
with sync_playwright() as p:
browser = p.chromium.launch(headless=False)
page = browser.new_page()
page.goto("https://www.google.com")
# Take screenshot
screenshot = page.screenshot()
image_url = client.screenshot_to_data_uri(screenshot)
# Get AI action
response = client.predict({
"model": "prava-af-medium",
"instruction": "Search for 'Prava AI'",
"image_url": image_url
})
# Execute action
action = response["action"]
if action["kind"] == "left_click":
coord = action["coordinate"]
page.mouse.click(coord["x"], coord["y"])
browser.close()
See examples/ for complete working examples including browser automation, desktop control, and testing frameworks.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
prava-0.1.22.tar.gz
(4.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file prava-0.1.22.tar.gz.
File metadata
- Download URL: prava-0.1.22.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1bc58ddc8a97220f35376564eee993b994801c2e1700ba7e2a1e8df6f2965487
|
|
| MD5 |
7c2f89ac867316cea7647265b69d003f
|
|
| BLAKE2b-256 |
62895b4e0e34436d9d1a343016009bbcdf44caf2f0bb4955fce299f5c59a456d
|
File details
Details for the file prava-0.1.22-py3-none-any.whl.
File metadata
- Download URL: prava-0.1.22-py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e296c9d1a6d29518a574dba22712f2541147330afaefc83efc8eeda22932a0c2
|
|
| MD5 |
2534201e6767723fe92c1c95f67dc08e
|
|
| BLAKE2b-256 |
30413ebb91e6eaf78003d787980c8ed5f1ad8b82c9c8a07440e087191ea607c8
|