mirror of
https://github.com/DayuanJiang/next-ai-draw-io.git
synced 2026-01-02 14:22:28 +08:00
fix: Remove hardcoded temperature parameter to support models that don't support it (#133)
* Fix: remove hardcoded temperature parameter to support reasoning models * feat: make temperature configurable via AI_TEMPERATURE env var - Instead of removing temperature entirely, make it optional via env var - Set AI_TEMPERATURE=0 for deterministic output (recommended for diagrams) - Leave unset for models that don't support temperature (e.g., GPT-5.1 reasoning) * docs: add AI_TEMPERATURE env var documentation - Update env.example with AI_TEMPERATURE option - Update README.md configuration section - Add Temperature Setting section in ai-providers.md * docs: add TEMPERATURE env var documentation - Update env.example with TEMPERATURE option - Update README.md, README_CN.md, README_JA.md configuration sections - Add Temperature Setting section in ai-providers.md - Update route.ts to use TEMPERATURE env var --------- Co-authored-by: dayuan.jiang <jiangdy@amazon.co.jp>
This commit is contained in:
@@ -418,7 +418,9 @@ IMPORTANT: Keep edits concise:
|
||||
}),
|
||||
},
|
||||
},
|
||||
temperature: 0,
|
||||
...(process.env.TEMPERATURE !== undefined && {
|
||||
temperature: parseFloat(process.env.TEMPERATURE),
|
||||
}),
|
||||
})
|
||||
|
||||
return result.toUIMessageStreamResponse()
|
||||
|
||||
Reference in New Issue
Block a user