Skip to content

Commit 88a473b

Browse files
committed
fix: remove hardcoded temperature in Z.AI provider
- Remove ZAI_DEFAULT_TEMPERATURE constant (was hardcoded to 0) - Allow Z.AI API to use its own default temperature (0.6 for glm-4.5) - Update tests to reflect the change Fixes #8286
1 parent 205f3e4 commit 88a473b

File tree

3 files changed

+1
-6
lines changed

3 files changed

+1
-6
lines changed

packages/types/src/providers/zai.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,6 @@ export const mainlandZAiModels = {
103103
},
104104
} as const satisfies Record<string, ModelInfo>
105105

106-
export const ZAI_DEFAULT_TEMPERATURE = 0
107-
108106
export const zaiApiLineConfigs = {
109107
international_coding: {
110108
name: "International Coding Plan",

src/api/providers/__tests__/zai.spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import {
1313
mainlandZAiDefaultModelId,
1414
internationalZAiModels,
1515
mainlandZAiModels,
16-
ZAI_DEFAULT_TEMPERATURE,
1716
} from "@roo-code/types"
1817

1918
import { ZAiHandler } from "../zai"
@@ -228,7 +227,7 @@ describe("ZAiHandler", () => {
228227
expect.objectContaining({
229228
model: modelId,
230229
max_tokens: modelInfo.maxTokens,
231-
temperature: ZAI_DEFAULT_TEMPERATURE,
230+
temperature: 0, // Default temperature from base provider when not specified
232231
messages: expect.arrayContaining([{ role: "system", content: systemPrompt }]),
233232
stream: true,
234233
stream_options: { include_usage: true },

src/api/providers/zai.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {
55
mainlandZAiDefaultModelId,
66
type InternationalZAiModelId,
77
type MainlandZAiModelId,
8-
ZAI_DEFAULT_TEMPERATURE,
98
zaiApiLineConfigs,
109
} from "@roo-code/types"
1110

@@ -26,7 +25,6 @@ export class ZAiHandler extends BaseOpenAiCompatibleProvider<InternationalZAiMod
2625
apiKey: options.zaiApiKey ?? "not-provided",
2726
defaultProviderModelId: defaultModelId,
2827
providerModels: models,
29-
defaultTemperature: ZAI_DEFAULT_TEMPERATURE,
3028
})
3129
}
3230
}

0 commit comments

Comments
 (0)