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

GPT5 Models | Tool choices other than 'auto' are not supported with model

クローズ
#2,537 コメント 17 件 リアクション 3 件 担当者 0 名 GitHub で見る

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

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
python
領域
api

調査の方向性

再現手順内の Responses API 呼び出しから始め、そこにある allowed_tools tool_choice とリンク先の API ドキュメントを比較してください。400 応答の原因が Python ライブラリにあるのか、基盤となる API にあるのかを確認してください。サポートされる動作と、必要なライブラリの変更が確定すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

api bug
Confirm this is an issue with the Python library and not an underlying OpenAI API
  • This is an issue with the Python library
Describe the bug

We are unable to use any tool_choice besides 'auto' for GPT5 models in the Responses API using the latest release v.1.99.5.

Documentation:
BadRequestError: Error code: 400 - {'error': {'message': "Tool choices other than 'auto' are not supported with model 'gpt-5-mini-2025-08-07' and the following tool types: 'code_interpreter', 'file_search'.", 'type': 'invalid_request_error', 'param': 'tool_choice', 'code': None}}
Posts on community.openai.com:
To Reproduce
stream = await llm.responses.create(
    model="gpt-5",
    input="Use your python tool to do this math: 8*9183*7663",
    tools=[
        {"type": "code_interpreter", "container": {"type": "auto"}},
    ],
    tool_choice={
        "type": "allowed_tools",
        "mode": "auto",
        "tools": [
            {
                "type": "code_interpreter",
            }
        ],
    },
    stream=True,
)
async for event in stream:
    print(event.model_dump_json(indent=2))
Code snippets

OS

Windows 11

Python version

Python 3.13.2

Library version

openai v.1.99.5

主要言語
Python
スター
31.9k
フォーク
8k
平均マージ
11時間 44分
マージ済み PR(30日)
166

環境構築

Codespaces で開く

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

はじめの一歩

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

openai/openai-python のほかの issue

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

似ている issue

Python の issue をもっと見る

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

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