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.5-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for lazyopenai-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 1051eb46b870a9209ba41f97146a43d69253acb329c0649a3aee526daaa2f7f2
MD5 b96597ff863080d41ddb3a2cc964c144
BLAKE2b-256 8cbb9e0ed28759a32e50214aff9fb626f4b2e39e82c2593a5c087fdedcc6709e

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