mirror of
https://github.com/DayuanJiang/next-ai-draw-io.git
synced 2026-10-09 11:17:04 +08:00
fix: address self-review findings
This commit is contained in:
@@ -1440,6 +1440,15 @@ export function supportsPromptCaching(modelId: string): boolean {
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a model supports the temperature sampling parameter.
|
||||
* Claude Opus 4.7 and 4.8 reject sampling parameters entirely.
|
||||
*/
|
||||
export function supportsTemperature(modelId: string): boolean {
|
||||
// Match plain, Bedrock inference-profile, and version-suffixed model IDs.
|
||||
return !/claude-opus-4[.-](?:7|8)(?=$|[-.:])/i.test(modelId)
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the AI model for diagram validation.
|
||||
* Uses VALIDATION_MODEL env var if set, otherwise falls back to AI_MODEL.
|
||||
|
||||
Reference in New Issue
Block a user