fix: add GLM-4.6 reasoning support for OpenAI Compatible provider #9013
+111
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR attempts to address Issue #9012. Feedback and guidance are welcome.
Problem
GLM-4.6 model reasoning was not working correctly in v3.30.0:
Solution
Added GLM-4.6-specific reasoning support by detecting when:
enableReasoningEffort: true)supportsReasoningBinary: true)When these conditions are met, the
thinking: { type: "enabled" }parameter is added to the API request, which is the vendor-specific format required by Z AI's GLM models.Changes
thinkingparameter for both streaming and non-streaming modesTesting
Fixes #9012
Important
Adds GLM-4.6 reasoning support to OpenAI Compatible provider by introducing
thinkingparameter inOpenAiHandler.OpenAiHandlerby checking forglm-4.6in model ID,enableReasoningEffort: true, andsupportsReasoningBinary: true.thinking: { type: "enabled" }parameter to API requests when conditions are met.openai.spec.tsfor GLM-4.6 reasoning scenarios, covering both streaming and non-streaming modes.thinkingparameter is not added for non-GLM-4.6 models even with reasoning enabled.This description was created by
for c0d0e13. You can customize this summary. It will automatically update as commits are pushed.