Skip to main content

Prava Python SDK – OpenAI-like API client for LLMs.

Project description

Prava Python SDK

Minimal, OpenAI-like client for the Prava API.

Install

pip install prava

Usage

from prava import Prava
import os

client = Prava(api_key=os.getenv("PRAVA_API_KEY"))

completion = client.chat.completions.create({
    "model": "prava-large",
    "messages": [
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "Write a haiku about coffee."},
    ],
})

print(completion["choices"][0]["message"]["content"])

Configuration

  • api_key: Explicit API key, or set PRAVA_API_KEY env var.
  • base_url: Override base URL or set PRAVA_BASE_URL env var.
  • timeout: Request timeout seconds (default 60).

License

MIT

Project details


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.0.tar.gz (2.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

prava-0.1.0-py3-none-any.whl (2.7 kB view details)

Uploaded Python 3

File details

Details for the file prava-0.1.0.tar.gz.

File metadata

  • Download URL: prava-0.1.0.tar.gz
  • Upload date:
  • Size: 2.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.6

File hashes

Hashes for prava-0.1.0.tar.gz
Algorithm Hash digest
SHA256 caa5245dfd2120e1052e1ef24f8424b27c40185064342ddb291268bbca9c4da7
MD5 027c800f56cbbdf4f1a5e0309c0ec31d
BLAKE2b-256 999b819428b9a7f3a3ab5bf244c90e89147c37803ff8dfff0886f1e5206e2951

See more details on using hashes here.

File details

Details for the file prava-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: prava-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 2.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.6

File hashes

Hashes for prava-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a2bcf7e70a5c9fda0d4d2c072d1f26ba8e46334cfc7a0a3476c262cd065e44fb
MD5 da0fa529a5d37c3a8db3bb48720a5baa
BLAKE2b-256 f79862ffa672a307a8493b0773470fe8587b3ee7d409ecd278928f56c080fbdc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page