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.21.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.21.tar.gz.
File metadata
- Download URL: prava-0.1.21.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 |
e746ead2ea5425df8f474795e56712af5262db005eb2ca3f49491f465f9597c5
|
|
| MD5 |
2396c720685f14b3f17dc46b60868165
|
|
| BLAKE2b-256 |
0b74df0c0e1333a83c06fb041c7dc8ab3ecb2221a01ff515bba3c437193efd51
|
File details
Details for the file prava-0.1.21-py3-none-any.whl.
File metadata
- Download URL: prava-0.1.21-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 |
1c776529dae157af1c7492937fcb9fc71358a1845bbe5aa2c86922090bf6c56a
|
|
| MD5 |
41dae03fc43b0926b663cce5ac439f01
|
|
| BLAKE2b-256 |
c07327219a0fd4ed6da5b6f86eaaeba5e7e9e559e9017f7e860c0cd42c089db5
|