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.6-py3-none-any.whl
.
File metadata
- Download URL: lazyopenai-0.0.6-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 | 308b947fc335a881e1045e35d30af429f9f20bbb395924defed1676bbea823ef |
|
MD5 | cfc9d145a8a02d4e4959189be70643ee |
|
BLAKE2b-256 | 45970121b01334b1a3650103aff2e8fb017042c57dfadf083a2597371316ae92 |