Docs: `tool_choice="required"` can select a state-changing tool when the needed one is not shown

オープン 初心者向け
#5,461 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

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

評価

難易度
1/5
見積もり時間
1時間未満
初心者へのやさしさ
90/100
issue の種類
ドキュメント
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python
領域
documentation

調査の方向性

docs/agents.md を開き、'Forcing tool use' セクションを探してください。説明の通り、tool_choice の値のリストの後に、提案された警告の段落を挿入してください。Done とは、required が状態を変更するツールを選択しているという注意書きが docs に存在することを意味します。

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

説明

Please read this first
  • Have you read the docs? Yes, Forcing tool use.
  • Have you searched for related issues? Yes, I found none on this.
Describe the feature

This is a documentation request. The docs say that required lets the model "intelligently decide which tool". When the tool a request needs is not among the tools shown, it often decides on a tool that changes state.

Proposed text for docs/agents.md, after the list of tool_choice values in "Forcing tool use":

With required, the model must call one of the tools it is shown. If the tool
a request needs is not among them, for example because a tool filter, a router
or tool search chose a subset, the model may call a tool that changes state
instead. reset_tool_choice does not prevent this, because it acts after the
first call. When an agent has tools that change state, force only over the
tools the request may use (for MCP servers, a tool filter), or leave
tool_choice at auto.

Evidence. Measured on 68 read-only requests of this kind inside the SDK (0.3.3, unmodified, mock tools): four hosted models called a write in 471 of 815 trials under required, against 9 of 815 with the defaults, and the write was always the first call. Restricting the forced call to the tools the request authorises removed these writes.

Version. Measured with openai-agents 0.3.3. The current release, v0.24.0, has the same "Forcing tool use" text and the same reset_tool_choice behaviour (default True, reset only after a tool call), so the first forced call works as it did in 0.3.3. I have not rerun the full measurement on v0.24.0.

主要言語
Python
スター
30.4k
フォーク
4.9k
平均マージ
16時間 21分
マージ済み PR(30日)
86

環境構築

はじめの一歩

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

openai/openai-agents-python のほかの issue

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

似ている issue

Python の issue をもっと見る

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

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