Add your description here
Project description
LMOS-openai-types
Python type definitions generated from OpenAI's OpenAPI specification
Overview
LMOS-openai-types provides strongly-typed Python models generated from OpenAI's official OpenAPI specification. It serves as a foundational package in the LMOS ecosystem, ensuring type safety and consistency across all LMOS services that interact with OpenAI-compatible APIs.
Features
- 🔄 Auto-generated Types: Automatically generates Python types from OpenAI's OpenAPI specification
- 📦 Multiple Format Support: Generates both Pydantic and Msgspec models
- 🔍 Type Safety: Provides full type hints and validation for OpenAI API objects
- 🔄 CI/CD Integration: Automated builds via GitHub Actions
Generated Packages
This repository automatically generates two Python packages:
-
Pydantic Models (branch:
pydantic-gen)- Built using Pydantic v2
- Full validation support
- IDE-friendly with complete type hints
-
Msgspec Models (branch:
msgspec-gen)- High-performance serialization
- Optimized for production deployments
- Reduced overhead compared to Pydantic
Development
To set up the development environment:
-
Open in Dev Container (recommended)
# VSCode will automatically detect and open the dev container -
Install dependencies
pip install -r builder/requirements.txt
-
Generate types
# Generate Pydantic models python builder/generate_package.py # Generate Msgspec models python builder/generate_package.py --modeltype MsgspecStruct
CI/CD Pipeline
The repository includes two GitHub Actions workflows:
build-pydantic.yml: Generates Pydantic modelsbuild-msgspec.yml: Generates Msgspec models
Both workflows:
- Trigger on pushes to main/master
- Generate respective Python packages
- Push to separate branches (
pydantic-genandmsgspec-gen)
OpenAPI Validation
The repository includes validation for the OpenAPI specification:
- Validates the OpenAPI definition using Swagger Editor
- Runs on pull requests
- Ensures specification compliance
Project Structure
├── builder/ # Type generation scripts
│ ├── requirements.txt # Python dependencies
│ └── generate_package.py # Main generation script
├── .devcontainer/ # Dev container configuration
├── .github/workflows/ # GitHub Actions workflows
└── openapi.yaml # OpenAI API specification
Contributing
We welcome contributions! Please:
- Fork the repository
- Create a feature branch
- Submit a pull request
License
Apache 2.0 - See LICENSE for details
Part of the LMOS Ecosystem
This package is part of the larger LMOS (Language Model Orchestration System) ecosystem. Visit LMOS.io to learn more about our other packages and services.
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 Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lmos_openai_types-0.1.0.tar.gz.
File metadata
- Download URL: lmos_openai_types-0.1.0.tar.gz
- Upload date:
- Size: 148.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a6ea2014e3646b8771d2a517dd9c1aacb7a2ec49393858d358b5f1ffe19d8df5
|
|
| MD5 |
91bea0a09e87b108573fb08d3958036e
|
|
| BLAKE2b-256 |
443f849352a2bbc2381a22c02b3d762357e5a17d955026e6bfe1cd18f6e8534c
|
File details
Details for the file lmos_openai_types-0.1.0-py3-none-any.whl.
File metadata
- Download URL: lmos_openai_types-0.1.0-py3-none-any.whl
- Upload date:
- Size: 51.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b2785f117afd133c4c285a87ce15c757afc9add405fb9f2c481d758d07a68291
|
|
| MD5 |
7067cc4e115c5aff0ab3e03aa1c624ec
|
|
| BLAKE2b-256 |
2ef71007c9b74f44395c6e6b24cb7383c2df811e2e12994b5e333816eeca19ad
|