yapr
yapr (Yet Another Prompt)
Installation
pip install yapr
Usage
A complete chat example
from yapr import LLMProvider, RoleThread
# Create an LLM provider from the API keys found in the current system env vars
llm_provider = LLMProvider.from_env()
# Create a new role based chat thread
thread = RoleThread()
thread.post(role="user", msg="How are you?")
# Chat with the LLM, store the prompt data in the namespace "foo"
response = llm_provider.chat(thread, namespace="foo")
# Add the response message to the thread
thread.add_msg(response.msg)
# Ask for a structured response
from pydantic import BaseModel
class Foo(BaseModel):
bar: str
baz: int
thread.post(role="user", msg="Given the {...} can you return that in JSON?")
# Chat with the LLM, requiring the output be parsable into the Foo object
response = llm_provider.chat(thread, namespace="foo", response_schema=Foo)
# Get the parsed response
foo_parsed = response.parsed
Metadata
Release files for yapr 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| yapr-0.1.1.tar.gz | 7.5 kB | Without provenance | Details for yapr-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| yapr-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for yapr-0.1.1-py3-none-any.whl |
Total release size: 16.4 kB
Release files / yapr-0.1.1.tar.gz
| Download URL | yapr-0.1.1.tar.gz |
|---|---|
| Size | 7.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1cb0f54fca64a1a52f27def0e77ce35e13041741b306e1bff7537371ed181688
|
|
BLAKE2b-256 checksum How to use checksums |
b023d7550298fd29422016abf0e81a2b8373c25e48f2900d67e2b497ea6e760e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.5.1 CPython/3.10.1 Darwin/22.6.0
|
Release files / yapr-0.1.1-py3-none-any.whl
| Download URL | yapr-0.1.1-py3-none-any.whl |
|---|---|
| Size | 8.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ceb926e66118e153de68f7fca3e3b50c0bdeb0940d1f796f2d78c7b7561825e9
|
|
BLAKE2b-256 checksum How to use checksums |
132dff72b9d7b202b1b30203a9f33d86b7c271c09c5d8f1736b3f5114486a22c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.5.1 CPython/3.10.1 Darwin/22.6.0
|
Security for yapr 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.