0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

GPT-5 の Reasoning.effort に何が指定できるか?

Posted at

OpenAIの各モデルで Reasoning.effort パラメータにどの値を指定すればいいのか分からなかったため、試しに調べてみました。

調査結果

  • gpt‑5.1'minimal' ではなく 'none' を指定します。無指定の場合のデフォルト値も 'none' です。
  • gpt‑5.1‑chat‑latestmedium 固定で変更できないようです。
  • gpt‑5‑chat‑latest には Reasoning パラメータが存在しません。
  • Codex 系や gpt‑5.1 系 では minimal が使用できませんが、gpt‑5 系 では minimal が使用できます。

コード実行結果

model default none minimal low medium high
gpt-5.1 none O - O O O
gpt-5.1-chat-latest medium - - - O -
gpt-5.1-codex medium - - O O O
gpt-5.1-codex-mini medium - - O O O
gpt-5-mini medium - O O O O
gpt-5-nano medium - O O O O
gpt-5-chat-latest ? - - - - -
gpt-5-codex medium - - O O O
codex-mini-latest medium - - O O O

調査コード


import regex
import ast
from openai import OpenAI
from openai import BadRequestError
from openai.types.shared_params.reasoning import Reasoning  # type: ignore


def testrun():

    effort_list = ['none','minimal','low','medium','high']
    model_list = [ 'gpt-5.1', 'gpt-5.1-chat-latest', 'gpt-5.1-codex', 'gpt-5.1-codex-mini', 'gpt-5-mini', 'gpt-5-nano', 'gpt-5-chat-latest', 'gpt-5-codex', 'codex-mini-latest']

    emap = {}
    for model_name in model_list:

        default_effort = "unknown"
        efforts = "unknown"

        # defaultを調査する
        emap.setdefault(model_name, {})['default'] = '?'

        print(f"Testing model: {model_name} default")
        try:
            client = OpenAI()
            resp = client.responses.create(model=model_name,input='say yes')
            if resp and resp.reasoning and resp.reasoning.effort:
                emap.setdefault(model_name, {})['default'] = resp.reasoning.effort
        except Exception as exc:
            print(exc)
            return
        # 選択肢を調査する

        for e in effort_list:
            print(f"Testing model: {model_name} {e}")
            emap.setdefault(model_name, {})[e] = '-'
            reasoning_param = Reasoning(effort=e) # type: ignore
            try:
                client = OpenAI()
                resp = client.responses.create(
                        model=model_name,
                        reasoning=reasoning_param,
                        input='say yes'
                    )
                if resp and resp.reasoning and resp.reasoning.effort:
                    if e == resp.reasoning.effort:
                        emap.setdefault(model_name, {})[e] = 'O'
                    else:
                        emap.setdefault(model_name, {})[e] = 'E'
            except BadRequestError as exc:
                mesg = str(exc)
                if regex.search(r'reasoning\.effort', mesg):
                    continue
                else:
                    # 理由が違うエラー
                    raise exc

    print("| model | default |",end="")
    for e in effort_list:
        print(f" {e} |",end="",)
    print()
    print("|-------|---------|",end="")
    for e in effort_list:
        print("---------|",end="",)
    print()
    for m in model_list:
        print(f"|{m}|{emap[m]['default']}|",end="")
        for e in effort_list:
            print(f"  {emap[m][e]}|",end="")
        print()

if __name__ == "__main__":
    testrun()
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?