feat: support bool type variable frontend (#24437)
Co-authored-by: QuantumGhost <obelisk.reg+git@gmail.com>
This commit is contained in:
parent
b5c2756261
commit
dac72b078d
126 changed files with 3832 additions and 512 deletions
|
|
@ -21,6 +21,7 @@ import { TEXT_GENERATION_TIMEOUT_MS } from '@/config'
|
|||
import {
|
||||
getFilesInLogs,
|
||||
} from '@/app/components/base/file-uploader/utils'
|
||||
import { formatBooleanInputs } from '@/utils/model-config'
|
||||
|
||||
export type IResultProps = {
|
||||
isWorkflow: boolean
|
||||
|
|
@ -124,7 +125,9 @@ const Result: FC<IResultProps> = ({
|
|||
}
|
||||
|
||||
let hasEmptyInput = ''
|
||||
const requiredVars = prompt_variables?.filter(({ key, name, required }) => {
|
||||
const requiredVars = prompt_variables?.filter(({ key, name, required, type }) => {
|
||||
if(type === 'boolean')
|
||||
return false // boolean input is not required
|
||||
const res = (!key || !key.trim()) || (!name || !name.trim()) || (required || required === undefined || required === null)
|
||||
return res
|
||||
}) || [] // compatible with old version
|
||||
|
|
@ -158,7 +161,7 @@ const Result: FC<IResultProps> = ({
|
|||
return
|
||||
|
||||
const data: Record<string, any> = {
|
||||
inputs,
|
||||
inputs: formatBooleanInputs(promptConfig?.prompt_variables, inputs),
|
||||
}
|
||||
if (visionConfig.enabled && completionFiles && completionFiles?.length > 0) {
|
||||
data.files = completionFiles.map((item) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue