{"record":{"id":"f2b86aac041402cf","repo":"alibaba/page-agent","slug":"pageagent-llmconfig-temperature-is-deprecated-an","errorCode":null,"errorMessage":"[PageAgent] LLMConfig.temperature is deprecated and will be removed in a future version. Use transformRequestBody to set it only for models you have verified accept it.","messagePattern":"\\[PageAgent\\] LLMConfig\\.temperature is deprecated and will be removed in a future version\\. Use transformRequestBody to set it only for models you have verified accept it\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/llms/src/index.ts","lineNumber":93,"sourceCode":"\t\t\tconsole.debug('[LLM] retryable failure, will retry:', error)\n\t\t\tsettings.onRetry(attempt, error as Error)\n\n\t\t\tawait new Promise((resolve) => setTimeout(resolve, 100))\n\t\t}\n\t}\n}\n\nexport function parseLLMConfig(config: LLMConfig): ResolvedLLMConfig {\n\t// Runtime validation as defensive programming (types already guarantee these)\n\tif (!config.baseURL || !config.model) {\n\t\tthrow new Error(\n\t\t\t'[PageAgent] LLM configuration required. Please provide: baseURL, model. ' +\n\t\t\t\t'See: https://alibaba.github.io/page-agent/docs/features/models'\n\t\t)\n\t}\n\n\tif (config.temperature !== undefined) {\n\t\tconsole.warn(\n\t\t\t'[PageAgent] LLMConfig.temperature is deprecated and will be removed in a future version. ' +\n\t\t\t\t'Use transformRequestBody to set it only for models you have verified accept it.'\n\t\t)\n\t}\n\n\treturn {\n\t\tbaseURL: config.baseURL,\n\t\tmodel: config.model,\n\t\tapiKey: config.apiKey || '',\n\t\ttemperature: config.temperature,\n\t\tmaxRetries: config.maxRetries ?? 2,\n\t\ttransformRequestBody: config.transformRequestBody ?? ((requestBody) => requestBody),\n\t\tdisableNamedToolChoice: config.disableNamedToolChoice ?? false,\n\t\tcustomFetch: (config.customFetch ?? fetch).bind(globalThis), // fetch will be illegal unless bound\n\t}\n}\n","sourceCodeStart":75,"sourceCodeEnd":110,"githubUrl":"https://github.com/alibaba/page-agent/blob/d02db1ee7c41f5315beda88bab2fe935c580f662/packages/llms/src/index.ts#L75-L110","documentation":"This is a deprecation console.warn from parseLLMConfig: setting LLMConfig.temperature is deprecated because many OpenAI-compatible providers reject or mishandle the temperature field, causing hard-to-diagnose 4xx errors. The library wants temperature set selectively via transformRequestBody only for models verified to accept it. It is informational, not a thrown error.","triggerScenarios":"Constructing LLM or PageAgent with a config object containing temperature (even temperature: undefined is fine, but any explicit value warns); migrating older configs where temperature was a normal field; provider endpoints that 400 on temperature (some reasoning models).","commonSituations":"Upgrading @page-agent/llms to a version where temperature was deprecated; users of gateways/proxies that reject temperature for certain models; copy-pasted configs from older examples.","solutions":["Remove temperature from LLMConfig and set it per-model via transformRequestBody: (body) => ({ ...body, temperature: 0 })","If you need temperature for all requests, centralize it in one transformRequestBody helper","Audit for provider compatibility: only set temperature where the endpoint accepts it","Ignore the warning only if temporary, but plan migration before removal"],"exampleFix":"// before\nconst llm = new LLM({ baseURL, model, apiKey, temperature: 0 })\n\n// after\nconst llm = new LLM({\n  baseURL, model, apiKey,\n  transformRequestBody: (body) => ({ ...body, temperature: 0 }),\n})","handlingStrategy":"validation","validationCode":"if ('temperature' in config) delete config.temperature // and move it to transformRequestBody before constructing LLM","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep request-body tweaks in transformRequestBody instead of top-level config fields","Check release notes/deprecation messages when upgrading @page-agent/llms","Only set temperature for models whose endpoint you verified accepts it"],"tags":["deprecation","llm","config","temperature"],"backgroundTag":"deprecated-config-option","analyzedSha":"d02db1ee7c41f5315beda88bab2fe935c580f662","analyzedAt":"2026-08-28T19:39:48.634Z","schemaVersion":2},"datasetVersion":"2026-08-28T21:17:43.275Z"}