No project description provided
Project description
Lazy OpenAI
Installation
pip install lazyopenai
Usage
from lazyopenai import generate_text
print(generate_text("Hi"))
Structured Outputs
from pydantic import BaseModel
from rich import print
from lazyopenai import generate_object
class Step(BaseModel):
explanation: str
output: str
class MathReasoning(BaseModel):
steps: list[Step]
final_answer: str
# https://platform.openai.com/docs/guides/structured-outputs?context=ex1#chain-of-thought
resp = generate_object("how can I solve 8x + 7 = -23", MathReasoning)
print(resp)
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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
File details
Details for the file lazyopenai-0.0.5-py3-none-any.whl
.
File metadata
- Download URL: lazyopenai-0.0.5-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1051eb46b870a9209ba41f97146a43d69253acb329c0649a3aee526daaa2f7f2 |
|
MD5 | b96597ff863080d41ddb3a2cc964c144 |
|
BLAKE2b-256 | 8cbb9e0ed28759a32e50214aff9fb626f4b2e39e82c2593a5c087fdedcc6709e |