mirror of
https://github.com/hicccc77/WeFlow.git
synced 2026-10-25 17:36:32 +08:00
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>
13 lines
447 B
TypeScript
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)
|
|
}
|