Files
WeFlow/electron/services/agentSamplingOptions.ts
T
Yi Zhan be0e564031 fix: omit temperature for gpt-6 under openai-responses
OpenAI Responses rejects temperature for gpt-6-* the same way it does
for gpt-5 and the o-series. Share one omitsTemperature() helper so
agent chat, title, and memory synthesis all skip it.

Signed-off-by: Yi Zhan <stevesough@gmail.com>
2026-10-15 09:43:49 +08:00

13 lines
447 B
TypeScript

export type AgentSamplingConfig = {
protocol?: string
model?: string
}
const OPENAI_RESPONSES_REASONING_MODEL = /^(?:gpt-(?:5|6)|o[1-4](?:-|$))/
export function omitsTemperature(config: AgentSamplingConfig): boolean {
if (config.protocol === 'anthropic') return true
const modelId = String(config.model || '').trim().toLocaleLowerCase()
return config.protocol === 'openai-responses' && OPENAI_RESPONSES_REASONING_MODEL.test(modelId)
}