File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ const validateConfig = (
4545} ;
4646
4747export const configValidators = {
48- [ CONFIG_KEYS . OCO_OPENAI_API_KEY ] ( value : any ) {
48+ [ CONFIG_KEYS . OCO_OPENAI_API_KEY ] ( value : any , config ?: any ) {
4949 validateConfig ( CONFIG_KEYS . OCO_OPENAI_API_KEY , value , 'Cannot be empty' ) ;
5050 validateConfig (
5151 CONFIG_KEYS . OCO_OPENAI_API_KEY ,
@@ -54,7 +54,7 @@ export const configValidators = {
5454 ) ;
5555 validateConfig (
5656 CONFIG_KEYS . OCO_OPENAI_API_KEY ,
57- value . length === 51 ,
57+ config [ CONFIG_KEYS . OCO_OPENAI_BASE_PATH ] || value . length === 51 ,
5858 'Must be 51 characters long'
5959 ) ;
6060
@@ -179,7 +179,7 @@ export const getConfig = (): ConfigType | null => {
179179 try {
180180 const validator = configValidators [ configKey as CONFIG_KEYS ] ;
181181 const validValue = validator (
182- config [ configKey ] ?? configFromEnv [ configKey as CONFIG_KEYS ]
182+ config [ configKey ] ?? configFromEnv [ configKey as CONFIG_KEYS ] , config
183183 ) ;
184184
185185 config [ configKey ] = validValue ;
You can’t perform that action at this time.
0 commit comments