Skip to main content

No project description provided

Project description

Lazy OpenAI

Installation

pip install lazyopenai

Usage

from lazyopenai import generate

print(generate("Hi"))

Structured Outputs

from pydantic import BaseModel
from rich import print

from lazyopenai import generate


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("how can I solve 8x + 7 = -23", response_format=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.7-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for lazyopenai-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 3d1c663f9f6c9bef51fbd8fcc518c2793f09048c09e7a56d88eada29a3fb3c22
MD5 8edd3bd861b4b22fefa66fbbf0555e73
BLAKE2b-256 8017532acaa3b34cecc5563c2740bba9c2b35341feee475d9736c05423424086

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