Merge pull request #4106 from HynoR/feat/fix
feat(playground): enhance max_tokens handling and input sanitization
This commit is contained in:
Vendored
+12
-1
@@ -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;
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user