mirror of
https://github.com/IT4Change/gradido.git
synced 2026-02-06 01:46:07 +00:00
next try
This commit is contained in:
parent
d97bf921ef
commit
f6c9d81049
@ -328,22 +328,14 @@ export const schema = Joi.object({
|
||||
|
||||
OPENAI_API_KEY: Joi.string()
|
||||
.pattern(/^sk-[A-Za-z0-9-_]{20,}$/)
|
||||
.when(Joi.ref('OPENAI_ACTIVE', { adjust: (v) => Boolean(v) }), {
|
||||
is: true,
|
||||
then: Joi.required(),
|
||||
otherwise: Joi.optional(),
|
||||
})
|
||||
.when('OPENAI_ACTIVE', { is: true, then: Joi.required(), otherwise: Joi.optional() })
|
||||
.description(
|
||||
'API key for OpenAI, must be at least 20 characters long and contain only alphanumeric characters, dashes, or underscores',
|
||||
),
|
||||
|
||||
OPENAI_ASSISTANT_ID: Joi.string()
|
||||
.pattern(/^asst_[A-Za-z0-9-]{20,}$/)
|
||||
.when(Joi.ref('OPENAI_ACTIVE', { adjust: (v) => Boolean(v) }), {
|
||||
is: true,
|
||||
then: Joi.required(),
|
||||
otherwise: Joi.optional(),
|
||||
})
|
||||
.when('OPENAI_ACTIVE', { is: true, then: Joi.required(), otherwise: Joi.optional() })
|
||||
.description('Assistant ID for OpenAI'),
|
||||
|
||||
USE_CRYPTO_WORKER: Joi.boolean()
|
||||
|
||||
@ -153,6 +153,7 @@ export const LOGIN_SERVER_KEY = Joi.string()
|
||||
export const OPENAI_ACTIVE = Joi.boolean()
|
||||
.default(false)
|
||||
.description('Flag to enable or disable OpenAI API')
|
||||
.required()
|
||||
|
||||
export const TYPEORM_LOGGING_RELATIVE_PATH = Joi.string()
|
||||
.pattern(new RegExp('^[a-zA-Z0-9-_\./]+\.log$'))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user