Add convenience methods for detecting model parameter support (temperature, reasoning)
メンテナーはふだん 1 日以内に返信
評価
調査の方向性
この issue には実装ファイル、テスト、エントリーポイントが記載されていません。まず、Python ライブラリのモデル関連の公開 API と既存のモデルメタデータを見つけ、次に、機能チェックと有効な reasoning-effort 値をどのように表現すべきかを判断します。完了とは、一覧にあるモデルファミリーの動作が文書化され、サポート対象およびサポート対象外のパラメータがカバーされていることです。
索引モデルが issue の本文から書いたものです。
説明
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
Feature request
When building applications that support multiple OpenAI models (e.g., gpt-4.1-mini, gpt-5, gpt-5.1, gpt-5.4), developers need to know which parameters each model supports. Currently this requires maintaining hardcoded model lists or prefix checks, which break as new models are released.
The problem
Different model families have different parameter constraints:
temperature: Supported by gpt-4.x but rejected by gpt-5.x reasoning models when reasoning_effort != nonereasoning: Only supported by gpt-5 family models, not gpt-4.xreasoning.effortvalues: Vary by model — gpt-5 supportsminimal/low/medium/high, gpt-5.1+ addsnone, gpt-5.4+ addsxhigh
Today, developers must write code like:
def is_reasoning_model(model: str) -> bool:
return model.startswith("gpt-5")
def get_reasoning_effort_options(model: str) -> list[str]:
if not is_reasoning_model(model):
return []
if model.startswith("gpt-5."):
minor = int(model[6:].split("-")[0])
options = ["none", "low", "medium", "high"]
if minor >= 4:
options.append("xhigh")
return options
return ["minimal", "low", "medium", "high"]
This is fragile — it breaks whenever a new model family is released, and the version-based logic for effort levels is reverse-engineered from documentation rather than provided by the SDK.
Proposed solution
Add model capability metadata to the SDK in some way, for example:
# Check if a parameter is supported
openai.models.supports(model="gpt-5.4", parameter="temperature") # False
openai.models.supports(model="gpt-5.4", parameter="reasoning") # True
# Get valid values for an enum parameter
openai.models.valid_values(model="gpt-5.4", parameter="reasoning.effort")
# ["none", "low", "medium", "high", "xhigh"]
openai.models.valid_values(model="gpt-5", parameter="reasoning.effort")
# ["minimal", "low", "medium", "high"]
Or alternatively, expose it as model metadata:
from openai.models import get_model_capabilities
caps = get_model_capabilities("gpt-5.4")
caps.supports_temperature # False
caps.supports_reasoning # True
caps.reasoning_effort_options # ["none", "low", "medium", "high", "xhigh"]
Use case
This came up while migrating azure-search-openai-demo from Chat Completions to the Responses API. The app supports multiple model deployments and needs to dynamically adjust which parameters it sends and presents in the UI for users. I imagine there are many similar apps that provide users with model options and parameters.
Additional context
No response
- 主要言語
- Python
- スター
- 31.8k
- フォーク
- 8k
- 平均マージ
- 1日 1時間
- マージ済み PR(30日)
- 137
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
openai/openai-python のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
openai/openai-python#4022 · コメント 19 件 ·
メンテナーはふだん 1 日以内に返信
-
fix(auth): SubjectTokenProviderError drops response and duplicates error message in workload identity providers対応中かも @mohmedmm が 11 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
openai/openai-python#4017 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
Querystring drops explicit empty-string scalar values対応中かも @sylvesterkaczmarek が 34 日前に担当しました。 オープンsdk-breaking-change v4
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
openai/openai-python#3837 ·
メンテナーはふだん 1 日以内に返信
-
Define + export `ServiceTiers` string literal対応中かも @SparshGarg999 が 60 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
openai/openai-python#3556 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
Empty OPENAI_BASE_URL prevents fallback to default API endpoint対応中かも @Sehastrajit-S が 26 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
openai/openai-python#2927 · コメント 6 件 ·
メンテナーはふだん 1 日以内に返信
openai/openai-python の issue をすべて見る
似ている issue
-
[Bug]: Streamed /v1/chat/completions sends unredacted agent error text (keys) in the final chunk対応中かも @rodricksz4h5 が今日担当しました。 オープンarea/streaming comp/gateway P2 type/security
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
NousResearch/hermes-agent#138245 ·
メンテナーはふだん 1 日以内に返信
-
[oblt-aw][autodoc] Update user onboarding guide for mandatory trigger CODEOWNERS step対応中かも @github-actions が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
メンテナーはふだん 1 日以内に返信
-
correction metadata
難易度 2/5 1時間未満 初心者へのやさしさ 68/100
acl-org/acl-anthology#10378 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
cloudtrail_multi_region_enabled_logging_management_events fails when the advanced event selector has a custom name対応中かも @12YYCCYY16 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
prowler-cloud/prowler#13033 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
graygarbage/HermesKey#23 ·