mirror of
https://github.com/Wei-Shaw/claude-relay-service.git
synced 2026-01-22 16:43:35 +00:00
fix: 修复droid claude的temperature参数问题
This commit is contained in:
@@ -1012,24 +1012,19 @@ class DroidRelayService {
|
||||
if ('thinking' in processedBody) {
|
||||
delete processedBody.thinking
|
||||
}
|
||||
} else if (
|
||||
processedBody.thinking &&
|
||||
processedBody.thinking.type === 'enabled' &&
|
||||
hasTemperatureField
|
||||
) {
|
||||
const parsedTemperature =
|
||||
typeof processedBody.temperature === 'string'
|
||||
? parseFloat(processedBody.temperature)
|
||||
: processedBody.temperature
|
||||
} else if (processedBody.thinking && processedBody.thinking.type === 'enabled') {
|
||||
if (hasTemperatureField) {
|
||||
const parsedTemperature =
|
||||
typeof processedBody.temperature === 'string'
|
||||
? parseFloat(processedBody.temperature)
|
||||
: processedBody.temperature
|
||||
|
||||
if (typeof parsedTemperature === 'number' && !Number.isNaN(parsedTemperature)) {
|
||||
if (parsedTemperature <= 0) {
|
||||
// 当开启 thinking 时,temperature 不允许为 0
|
||||
processedBody.temperature = 1
|
||||
if (typeof parsedTemperature !== 'number' || Number.isNaN(parsedTemperature)) {
|
||||
delete processedBody.temperature
|
||||
}
|
||||
} else {
|
||||
delete processedBody.temperature
|
||||
}
|
||||
|
||||
processedBody.temperature = 1
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user