Skip to content

feat(types): define and export ServiceTier string literal (fix #3556) - #3618

Open
SparshGarg999 wants to merge 1 commit into
openai:mainfrom
SparshGarg999:feat-export-service-tier-literal
Open

feat(types): define and export ServiceTier string literal (fix #3556)#3618
SparshGarg999 wants to merge 1 commit into
openai:mainfrom
SparshGarg999:feat-export-service-tier-literal

Conversation

@SparshGarg999

Copy link
Copy Markdown

Fixes #3556

Summary

Define and export ServiceTier as a string literal type (Literal["auto", "default", "flex", "scale", "priority", "fast"]) under openai.types and openai.types.shared.

This allows SDK consumers to import from openai.types import ServiceTier without hardcoding custom string literal unions that break across SDK updates.

How was this tested?

  • Added unit test in tests/test_client.py verifying ServiceTier export and type literal values.

@SparshGarg999
SparshGarg999 requested a review from a team as a code owner August 14, 2026 17:18

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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"]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Define + export ServiceTiers string literal

1 participant