Skip to main content

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


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

lazyopenai-0.0.6-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file lazyopenai-0.0.6-py3-none-any.whl.

File metadata

File hashes

Hashes for lazyopenai-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 308b947fc335a881e1045e35d30af429f9f20bbb395924defed1676bbea823ef
MD5 cfc9d145a8a02d4e4959189be70643ee
BLAKE2b-256 45970121b01334b1a3650103aff2e8fb017042c57dfadf083a2597371316ae92

See more details on using hashes here.

Supported by

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