feat(types): define and export ServiceTier string literal (fix #3556) - #3618
feat(types): define and export ServiceTier string literal (fix #3556)#3618SparshGarg999 wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6919c345f1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| __all__ = ["ServiceTier"] | ||
|
|
||
| ServiceTier: TypeAlias = Literal["auto", "default", "flex", "scale", "priority", "fast"] |
There was a problem hiding this comment.
Mirror the nullable ServiceTier schema
The shared ServiceTier component is defined as the enum or null in api_reference/openapi.transformed.yml:56792-56812, and the generated response fields already expose service_tier as optional. Exporting the new public alias as only Literal[...] makes it narrower than the schema, so users annotating values read from responses (or nullable request values) still cannot use ServiceTier without adding their own | None. Please mirror the schema with Optional/None support.
AGENTS.md reference: AGENTS.md:L5-L6
Useful? React with 👍 / 👎.
Fixes #3556
Summary
Define and export
ServiceTieras a string literal type (Literal["auto", "default", "flex", "scale", "priority", "fast"]) underopenai.typesandopenai.types.shared.This allows SDK consumers to import
from openai.types import ServiceTierwithout hardcoding custom string literal unions that break across SDK updates.How was this tested?
tests/test_client.pyverifyingServiceTierexport and type literal values.