Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Add convenience methods for detecting model parameter support (temperature, reasoning)

オープン
#3,073 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@SinhSinhAn がすでに取り組んでいます。

2026年4月25日 から。

  • #3124 @SinhSinhAn による — オープン

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
38/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
静か
技術スタック
python
領域
api

調査の方向性

この 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 != none
  • reasoning: Only supported by gpt-5 family models, not gpt-4.x
  • reasoning.effort values: Vary by model — gpt-5 supports minimal/low/medium/high, gpt-5.1+ adds none, gpt-5.4+ adds xhigh

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

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

openai/openai-python のほかの issue

openai/openai-python の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。