forked from Yara724/api
Added AI damage estimation
This commit is contained in:
@@ -18,6 +18,15 @@ export function validate(config: Record<string, unknown>) {
|
||||
skipMissingProperties: false,
|
||||
});
|
||||
|
||||
if (
|
||||
validatedConfig.OPENAI_PRICE_ESTIMATION_ENABLED === "true" &&
|
||||
!validatedConfig.OPENAI_PRICE_ESTIMATION_API_KEY?.trim()
|
||||
) {
|
||||
throw new Error(
|
||||
"OPENAI_PRICE_ESTIMATION_API_KEY is required when OPENAI_PRICE_ESTIMATION_ENABLED=true",
|
||||
);
|
||||
}
|
||||
|
||||
if (errors.length > 0) {
|
||||
const messages = errors
|
||||
.flatMap((error) => Object.values(error.constraints ?? {}))
|
||||
|
||||
Reference in New Issue
Block a user