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

Đang mở Phù hợp với người mới
#5,461 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
1/5
Thời gian dự kiến
Dưới một giờ
Mức phù hợp với người mới
90/100
Loại issue
Tài liệu
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
documentation

Hướng nghiên cứu

Mở docs/agents.md và tìm phần 'Forcing tool use'. Chèn đoạn cảnh báo được đề xuất sau danh sách các giá trị tool_choice như được mô tả. Done nghĩa là ghi chú về required chọn các công cụ thay đổi trạng thái có mặt trong docs.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Python
Star
30.4k
Fork
4.9k
Merge trung bình
19 giờ 5 phút
Pull request đã merge (30 ngày)
90

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của openai/openai-agents-python

Tất cả issue của openai/openai-agents-python

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.