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.
Metadata
Release files for lmos-openai-types 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| lmos_openai_types-0.1.0.tar.gz | 148.1 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| lmos_openai_types-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 199.9 kB
Release files / lmos_openai_types-0.1.0.tar.gz
| Download URL | lmos_openai_types-0.1.0.tar.gz |
|---|---|
| Size | 148.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a6ea2014e3646b8771d2a517dd9c1aacb7a2ec49393858d358b5f1ffe19d8df5
|
|
BLAKE2b-256 checksum How to use checksums |
443f849352a2bbc2381a22c02b3d762357e5a17d955026e6bfe1cd18f6e8534c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.5.18
|
Release files / lmos_openai_types-0.1.0-py3-none-any.whl
| Download URL | lmos_openai_types-0.1.0-py3-none-any.whl |
|---|---|
| Size | 51.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b2785f117afd133c4c285a87ce15c757afc9add405fb9f2c481d758d07a68291
|
|
BLAKE2b-256 checksum How to use checksums |
2ef71007c9b74f44395c6e6b24cb7383c2df811e2e12994b5e333816eeca19ad
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.5.18
|
Security for lmos-openai-types 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.