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.23.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.23.tar.gz.
File metadata
- Download URL: prava-0.1.23.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 |
d24268a2cca3d38e35afa4f988db1642ca20930debb8ae6925f13dc358d51199
|
|
| MD5 |
555aa0bfdbbbcc9953df9ca07df8417c
|
|
| BLAKE2b-256 |
914fc46521ed7aee256f797c7844f1cba47350e0950713316e626950bec43350
|
File details
Details for the file prava-0.1.23-py3-none-any.whl.
File metadata
- Download URL: prava-0.1.23-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 |
ed9d4f1c99ed9ed348e1b27f53cff5e62e6496c7ce2d9c15dd1d1291d1226382
|
|
| MD5 |
12adb4453087bf5e6aff7a96f08631f0
|
|
| BLAKE2b-256 |
d42e91d9b664a910aadbe9457836fe161d9bcbaab6d76c9d38e94accd5a72cb3
|