Parcourir la source

fix(web): number type prompt variable required validation not effective (#20898)

tags/1.5.0
yangzheli il y a 4 mois
Parent
révision
b69f952e3e
Aucun compte lié à l'adresse e-mail de l'auteur
1 fichiers modifiés avec 1 ajouts et 2 suppressions
  1. 1
    2
      web/app/components/app/configuration/debug/index.tsx

+ 1
- 2
web/app/components/app/configuration/debug/index.tsx Voir le fichier

@@ -156,12 +156,11 @@ const Debug: FC<IDebug> = ({
}
let hasEmptyInput = ''
const requiredVars = modelConfig.configs.prompt_variables.filter(({ key, name, required, type }) => {
if (type !== 'string' && type !== 'paragraph' && type !== 'select')
if (type !== 'string' && type !== 'paragraph' && type !== 'select' && type !== 'number')
return false
const res = (!key || !key.trim()) || (!name || !name.trim()) || (required || required === undefined || required === null)
return res
}) // compatible with old version
// debugger
requiredVars.forEach(({ key, name }) => {
if (hasEmptyInput)
return

Chargement…
Annuler
Enregistrer