Merge remote-tracking branch 'origin/dev'
This commit is contained in:
+11
-2
@@ -65,6 +65,15 @@ export const configValidators = {
|
||||
},
|
||||
|
||||
[CONFIG_KEYS.OPENAI_MAX_TOKENS](value: any) {
|
||||
// If the value is a string, convert it to a number.
|
||||
if (typeof value === 'string') {
|
||||
value = parseInt(value);
|
||||
validateConfig(
|
||||
CONFIG_KEYS.OPENAI_MAX_TOKENS,
|
||||
!isNaN(value),
|
||||
'Must be a number'
|
||||
);
|
||||
}
|
||||
validateConfig(
|
||||
CONFIG_KEYS.OPENAI_MAX_TOKENS,
|
||||
typeof value === 'number',
|
||||
@@ -96,8 +105,8 @@ export const configValidators = {
|
||||
[CONFIG_KEYS.OPENAI_BASE_PATH](value: any) {
|
||||
validateConfig(
|
||||
CONFIG_KEYS.OPENAI_BASE_PATH,
|
||||
typeof value == 'string',
|
||||
`${value} is not supported yet`
|
||||
typeof value === 'string',
|
||||
'Must be string'
|
||||
);
|
||||
return value;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user