-
Notifications
You must be signed in to change notification settings - Fork 784
feat(openai/azure): enable temperature when reasoning_effort=none for… #2829
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,4 +24,4 @@ resource: | |
| model: | ||
| enabled: false | ||
| type: plugin | ||
| version: 0.0.49 | ||
| version: 0.0.50 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| version: 0.3.4 | ||
| version: 0.3.5 | ||
| type: plugin | ||
| author: "langgenius" | ||
| name: "openai" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,6 +17,8 @@ parameter_rules: | |
| default: 8192 | ||
| min: 1 | ||
| max: 128000 | ||
| - name: temperature | ||
| use_template: temperature | ||
|
Comment on lines
+20
to
+21
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| - name: response_format | ||
| label: | ||
| zh_Hans: 回复格式 | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -776,7 +776,14 @@ def _chat_generate( | |||||||||||
| else: | ||||||||||||
| # chat model | ||||||||||||
| messages: Any = [self._convert_prompt_message_to_dict(m) for m in prompt_messages] | ||||||||||||
|
|
||||||||||||
|
|
||||||||||||
| # For models where temperature is only valid when reasoning_effort="none" | ||||||||||||
| # (e.g. gpt-5.1/5.2/5.4): strip temperature/top_p when reasoning is active | ||||||||||||
| _re = model_parameters.get("reasoning_effort") | ||||||||||||
| if _re and _re != "none": | ||||||||||||
| model_parameters.pop("temperature", None) | ||||||||||||
| model_parameters.pop("top_p", None) | ||||||||||||
|
Comment on lines
+784
to
+785
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The PR description mentions that
Suggested change
|
||||||||||||
|
|
||||||||||||
| try: | ||||||||||||
| response = client.chat.completions.create( | ||||||||||||
| messages=messages, | ||||||||||||
|
|
@@ -821,6 +828,10 @@ def _build_responses_api_params( | |||||||||||
| reasoning_effort = params.pop("reasoning_effort", None) | ||||||||||||
| if reasoning_effort and reasoning_effort != "none": | ||||||||||||
| params["reasoning"] = {"effort": reasoning_effort} | ||||||||||||
| # temperature/top_p/logprobs not supported when reasoning is active | ||||||||||||
| params.pop("temperature", None) | ||||||||||||
| params.pop("top_p", None) | ||||||||||||
| params.pop("logprobs", None) | ||||||||||||
|
|
||||||||||||
| # response_format -> text.format (Responses API uses different format) | ||||||||||||
| # response_format is incompatible with Responses API, convert to text.format | ||||||||||||
|
|
||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR description states that
top_pis also a valid parameter for GPT-5.1 whenreasoning_effortis set tonone. However, it is missing from theparameter_rulesfor thegpt-5.1model entry here, while it was correctly added (or already present) forgpt-5.2andgpt-5.4.