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) {
|
if ('thinking' in processedBody) {
|
||||||
delete processedBody.thinking
|
delete processedBody.thinking
|
||||||
}
|
}
|
||||||
} else if (
|
} else if (processedBody.thinking && processedBody.thinking.type === 'enabled') {
|
||||||
processedBody.thinking &&
|
if (hasTemperatureField) {
|
||||||
processedBody.thinking.type === 'enabled' &&
|
const parsedTemperature =
|
||||||
hasTemperatureField
|
typeof processedBody.temperature === 'string'
|
||||||
) {
|
? parseFloat(processedBody.temperature)
|
||||||
const parsedTemperature =
|
: processedBody.temperature
|
||||||
typeof processedBody.temperature === 'string'
|
|
||||||
? parseFloat(processedBody.temperature)
|
|
||||||
: processedBody.temperature
|
|
||||||
|
|
||||||
if (typeof parsedTemperature === 'number' && !Number.isNaN(parsedTemperature)) {
|
if (typeof parsedTemperature !== 'number' || Number.isNaN(parsedTemperature)) {
|
||||||
if (parsedTemperature <= 0) {
|
delete processedBody.temperature
|
||||||
// 当开启 thinking 时,temperature 不允许为 0
|
|
||||||
processedBody.temperature = 1
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
delete processedBody.temperature
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
processedBody.temperature = 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user