openai / openai/openai-python

Define + export `ServiceTiers` string literal

Open Beginner friendly
#3,556 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
31.6k
Forks
5.7k
Avg merge
1d 6h
Merged PRs (30d)
96

Description

Confirm this is a feature request for the Python library and not the underlying OpenAI API.
  • This is a feature request for the Python library
Describe the feature or improvement you're requesting

If I want to annotate service_tier in my code, I have to hard-code a type like Literal["auto", "default", "flex", "scale", "priority", "fast"], and then the hard-coded type annotation breaks if I'm using anything other than the latest version of the sdk.

Additional context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Search the Python library for the existing service_tier definitions and exported string-literal types. Define and export ServiceTiers so callers can use it for annotations, while keeping compatibility with SDK versions that support different service tiers; verify the relevant existing tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.