Merge pull request #4106 from HynoR/feat/fix

feat(playground): enhance max_tokens handling and input sanitization
This commit is contained in:
Calcium-Ion
2026-04-06 16:01:28 +08:00
committed by GitHub
4 changed files with 37 additions and 9 deletions
+12 -1
View File
@@ -150,7 +150,18 @@ export const buildApiPayload = (
const value = inputs[param];
const hasValue = value !== undefined && value !== null;
if (enabled && hasValue) {
if (!enabled) {
return;
}
if (param === 'max_tokens') {
if (typeof value === 'number') {
payload[param] = value;
}
return;
}
if (hasValue) {
payload[param] = value;
}
});