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.20.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.20.tar.gz.
File metadata
- Download URL: prava-0.1.20.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 |
7197ec9dbc6b6fc59d3432be3f6c160e2075ef870c05b75a18d4f14623dd17cc
|
|
| MD5 |
e5598a2b74572faefd4c1464b1b91824
|
|
| BLAKE2b-256 |
dd3f30d3e08a3ec088331d9e955bf4fc1fd3fd33940beff73fcae93d807e82d1
|
File details
Details for the file prava-0.1.20-py3-none-any.whl.
File metadata
- Download URL: prava-0.1.20-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 |
e5d4b326dabbf4327181b094c5cf246db2522d5dd1932119a9f64a65ca1bd53d
|
|
| MD5 |
920e22762ecaae7d3423aa204d5aa3cb
|
|
| BLAKE2b-256 |
24afe3cef59755e6878d4a11c73e84c8b0e433642324e7cbde36bc5cc3fd2468
|