Uprelic Python SDK
pip install uprelic
Set UPRELIC_API_KEY (create a key at https://platform.uprelic.com), or pass api_key= to the client.
from uprelic import Uprelic, Noul, Choice, Score
client = Uprelic()
response = client.system_one(
model="strom-1.0.7",
state="I was charged twice for my subscription. Please fix this today.",
questions={
"billing": Noul("Is this message about billing?"),
"tone": Choice("What is the tone?", criteria={"angry": "Upset or hostile", "calm": "Neutral or polite"}),
"urgency": Score("How urgent is this?", criteria=["Can wait", "This week", "Today"]),
},
)
response.nouls["billing"].noul # 0.98
response.choices["tone"].choice # "angry"
response.scores["urgency"].score # 1.8
response.usage.input_tokens
Images go in images= as http(s) or data:image/... URLs. client.models() lists the available models.
Async
from uprelic import AsyncUprelic
async with AsyncUprelic() as client:
response = await client.system_one(model="strom-1.0.7", state="...", questions={...})
Errors and retries
Failed requests raise uprelic.APIError subclasses: AuthenticationError (401), InsufficientBalanceError (402),
InvalidRequestError (400, 422), RateLimitError (429) and ServerError (5xx). Each has status_code and detail.
Rate limits (429), 502/503/504 responses and connection failures are retried twice with backoff. Change this with
Uprelic(max_retries=...).
API reference: https://api.uprelic.com/v1/docs
Metadata
Release files for uprelic 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| uprelic-0.1.0.tar.gz | 4.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| uprelic-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.8 kB
Release files / uprelic-0.1.0.tar.gz
| Download URL | uprelic-0.1.0.tar.gz |
|---|---|
| Size | 4.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
01e99fc0165ed49a694d2b9785857c7f334ad3a37c7ed97415c7600aefb77970
|
|
BLAKE2b-256 checksum How to use checksums |
b5f1558cf248d768b405bf9f8593b63d8b12f6128e01a817677c2c27ef8955a4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / uprelic-0.1.0-py3-none-any.whl
| Download URL | uprelic-0.1.0-py3-none-any.whl |
|---|---|
| Size | 5.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
576791bcaf31a0f13484aafeb4440d73badd893e3388e0495363d3f655b24231
|
|
BLAKE2b-256 checksum How to use checksums |
e50774f57f4df7af01062d51ead8475f3aa9f68b0b83581151c7d04470bb9e8d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|