fix: remove hardcoded temperature in Z.AI provider #8287
Closed
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 #8286. Feedback and guidance are welcome.
Problem
The Z.AI provider had a hardcoded temperature value of 0, which is very low for an LLM and prevents the Z.AI API from using its model-specific default temperatures (e.g., 0.6 for glm-4.5).
Solution
ZAI_DEFAULT_TEMPERATUREconstant that was hardcoded to 0defaultTemperatureparameter from the ZAiHandler constructorChanges
ZAI_DEFAULT_TEMPERATUREconstant frompackages/types/src/providers/zai.tsdefaultTemperatureparameter from ZAiHandler constructor insrc/api/providers/zai.tsTesting
Notes
This change aligns with best practices of allowing upstream APIs to use their own defaults rather than overriding them with hardcoded values. Similar fix was already accepted in the Cline project.
Fixes #8286
Important
Remove hardcoded temperature in Z.AI provider to allow API default temperatures, updating
ZAiHandlerand tests accordingly.ZAI_DEFAULT_TEMPERATUREconstant fromzai.ts, allowing Z.AI to use its default temperature values.defaultTemperatureparameter fromZAiHandlerconstructor inzai.ts.zai.spec.tsto reflect removal of hardcoded temperature.This description was created by
for 88a473b. You can customize this summary. It will automatically update as commits are pushed.