Add convenience methods for detecting model parameter support (temperature, reasoning)
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 38/100
Hướng nghiên cứu
Issue không nêu tên các tệp triển khai, bài kiểm thử hoặc điểm vào. Trước tiên, hãy xác định API công khai liên quan đến model của thư viện Python và metadata model hiện có, sau đó xác định cách biểu diễn các kiểm tra khả năng và các giá trị reasoning-effort hợp lệ; được xem là hoàn thành khi hành vi đối với các họ model được liệt kê đã được ghi lại và có độ bao phủ cho các tham số được hỗ trợ và không được hỗ trợ.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Confirm this is a feature request for the Python library and not the underlying OpenAI API.
- This is a feature request for the Python library
Describe the feature or improvement you're requesting
Feature request
When building applications that support multiple OpenAI models (e.g., gpt-4.1-mini, gpt-5, gpt-5.1, gpt-5.4), developers need to know which parameters each model supports. Currently this requires maintaining hardcoded model lists or prefix checks, which break as new models are released.
The problem
Different model families have different parameter constraints:
temperature: Supported by gpt-4.x but rejected by gpt-5.x reasoning models when reasoning_effort != nonereasoning: Only supported by gpt-5 family models, not gpt-4.xreasoning.effortvalues: Vary by model — gpt-5 supportsminimal/low/medium/high, gpt-5.1+ addsnone, gpt-5.4+ addsxhigh
Today, developers must write code like:
def is_reasoning_model(model: str) -> bool:
return model.startswith("gpt-5")
def get_reasoning_effort_options(model: str) -> list[str]:
if not is_reasoning_model(model):
return []
if model.startswith("gpt-5."):
minor = int(model[6:].split("-")[0])
options = ["none", "low", "medium", "high"]
if minor >= 4:
options.append("xhigh")
return options
return ["minimal", "low", "medium", "high"]
This is fragile — it breaks whenever a new model family is released, and the version-based logic for effort levels is reverse-engineered from documentation rather than provided by the SDK.
Proposed solution
Add model capability metadata to the SDK in some way, for example:
# Check if a parameter is supported
openai.models.supports(model="gpt-5.4", parameter="temperature") # False
openai.models.supports(model="gpt-5.4", parameter="reasoning") # True
# Get valid values for an enum parameter
openai.models.valid_values(model="gpt-5.4", parameter="reasoning.effort")
# ["none", "low", "medium", "high", "xhigh"]
openai.models.valid_values(model="gpt-5", parameter="reasoning.effort")
# ["minimal", "low", "medium", "high"]
Or alternatively, expose it as model metadata:
from openai.models import get_model_capabilities
caps = get_model_capabilities("gpt-5.4")
caps.supports_temperature # False
caps.supports_reasoning # True
caps.reasoning_effort_options # ["none", "low", "medium", "high", "xhigh"]
Use case
This came up while migrating azure-search-openai-demo from Chat Completions to the Responses API. The app supports multiple model deployments and needs to dynamically adjust which parameters it sends and presents in the UI for users. I imagine there are many similar apps that provide users with model options and parameters.
Additional context
No response
- Ngôn ngữ chính
- Python
- Star
- 31.8k
- Fork
- 7.3k
- Merge trung bình
- 1 ngày 3 giờ
- Pull request đã merge (30 ngày)
- 131
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của openai/openai-python
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
openai/openai-python#4022 · 19 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
fix(auth): SubjectTokenProviderError drops response and duplicates error message in workload identity providersCó thể đã có người làm @mohmedmm đã nhận 10 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
openai/openai-python#4017 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Querystring drops explicit empty-string scalar valuesCó thể đã có người làm @sylvesterkaczmarek đã nhận 32 ngày trước. Đang mởsdk-breaking-change v4
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
openai/openai-python#3837 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Define + export `ServiceTiers` string literalCó thể đã có người làm @SparshGarg999 đã nhận 58 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
openai/openai-python#3556 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Empty OPENAI_BASE_URL prevents fallback to default API endpointCó thể đã có người làm @Sehastrajit-S đã nhận 25 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
openai/openai-python#2927 · 6 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của openai/openai-python
Issue tương tự
-
🐛 Bug: Calendar work items cannot be opened on mobileCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Status: Triage Type: Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
-
Objects.List treats versions=false (and similar flags) as trueCó thể đã có người làm @andaaron đã nhận hôm nay. Đang mởpriority: p2 type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
googleapis/storage-testbench#829 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
[Bug]: memory provider treats 1:1 DMs as shared surfaces, so DM turns never receive reviewed recordsĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
rlaope/oh-my-hermes#2088 ·
Maintainer thường phản hồi trong vòng 1 ngày