Skip to main content

A Python tool to generate Pydantic response schemas using various LLM APIs

Project description

LLM Schema Generator

A Python library that generates Pydantic response schemas based on user descriptions using various LLM providers (OpenAI, Anthropic Claude, Google Gemini).

Installation

Install from PyPI:

pip install schema_gen_ai

Example: Using OpenAI

from schema_gen_ai import generate_schema

schema_code = generate_schema( description="Extract name, age, and occupation from a person's bio", provider="openai", api_key="your_openai_api_key", # Or set OPENAI_API_KEY env var model="gpt-4o-mini" # Optional )

print(schema_code)

Example: Using gemini

from schema_gen_ai import generate_schema

schema_code = generate_schema( description="Extract name, age, and occupation from a person's bio", provider="gemini", api_key="your_gemini_api_key", # Or set GOOGLE_API_KEY env var model="gemini-2.5-flash" # Optional )

print(schema_code)

Example: Using OpenAI

from schema_gen_ai import generate_schema

schema_code = generate_schema( description="Extract name, age, and occupation from a person's bio", provider="claude", api_key="your_claude_api_key", # Or set ANTHROPIC_API_KEY env var model="claude-sonnet-4-5-20250929" # Optional )

print(schema_code)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

schema_gen_ai-0.1.0.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

schema_gen_ai-0.1.0-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file schema_gen_ai-0.1.0.tar.gz.

File metadata

  • Download URL: schema_gen_ai-0.1.0.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.14

File hashes

Hashes for schema_gen_ai-0.1.0.tar.gz
Algorithm Hash digest
SHA256 236f73cbe8f254503854cf8eab6726abad0a8bc536452b5d907feda13074efad
MD5 ab4cb16e9e4bab7386970ed6438fdb87
BLAKE2b-256 282ae915d9f190093378803502440d4dc7ba30e36afe24ebfe79fcd8311f06b5

See more details on using hashes here.

File details

Details for the file schema_gen_ai-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: schema_gen_ai-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.14

File hashes

Hashes for schema_gen_ai-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 912826bd042fa277bec3df930d5941427933e43ca3d644cdbfc583d7b73a6bd3
MD5 4904f1870e894111c9f5df0f41b896b0
BLAKE2b-256 fb583cbf4cde21308628800f45c977ed53120b793c0b7dcb48909749ba3d8252

See more details on using hashes here.

Supported by

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