GPT5 Models | Tool choices other than 'auto' are not supported with model
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
再現手順内の Responses API 呼び出しから始め、そこにある allowed_tools tool_choice とリンク先の API ドキュメントを比較してください。400 応答の原因が Python ライブラリにあるのか、基盤となる API にあるのかを確認してください。サポートされる動作と、必要なライブラリの変更が確定すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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:
- https://platform.openai.com/docs/guides/latest-model#allowed-tools
- https://platform.openai.com/docs/api-reference/responses/create#responses_create-tool_choice
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:
- https://community.openai.com/t/error-400-tool-choices-other-than-auto-are-not-supported-with-model-gpt-5-and-the-following-tool-types-web-search-preview/1337152
- https://community.openai.com/t/gpt5-and-forced-web-search/1344079
- https://community.openai.com/t/gpt5-cannot-use-web-search-please-help/1337041
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
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
openai/openai-python のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
openai/openai-python#4156 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
openai/openai-python#4022 · コメント 23 件 ·
メンテナーはふだん 1 日以内に返信
-
fix(auth): SubjectTokenProviderError drops response and duplicates error message in workload identity providers対応中かも @mohmedmm が 23 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
openai/openai-python#4017 · コメント 5 件 ·
メンテナーはふだん 1 日以内に返信
-
Querystring drops explicit empty-string scalar values対応中かも @sylvesterkaczmarek が 45 日前に担当しました。 オープンsdk-breaking-change v4
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
openai/openai-python#3837 ·
メンテナーはふだん 1 日以内に返信
-
Define + export `ServiceTiers` string literal対応中かも @SparshGarg999 が 72 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
openai/openai-python#3556 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
openai/openai-python の issue をすべて見る
似ている issue
-
The changelog workflow excludes otelbot but not dependabot, so every Dependabot pull request fails the changelog check対応中かも @ocelotl が今日担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
open-telemetry/opentelemetry-python#5825 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
cuga-project/cuga-agent#1020 ·
メンテナーはふだん 2 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 70/100
microsoft/playwright#43640 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
stac-utils/stac-fastapi-elasticsearch-opensearch#965 ·
メンテナーはふだん 2 日以内に返信
-
from-review-extraction library privacy python severity:suggested
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
LearningCircuit/local-deep-research#7951 ·
メンテナーはふだん 2 日以内に返信