feat: converstation support bool

This commit is contained in:
Joel 2025-07-04 16:48:33 +08:00
parent 6ff18d13e6
commit 18941beb34
2 changed files with 12 additions and 0 deletions

View File

@ -17,6 +17,7 @@ import { CodeLanguage } from '@/app/components/workflow/nodes/code/types'
import { ChatVarType } from '@/app/components/workflow/panel/chat-variable-panel/type'
import cn from '@/utils/classnames'
import { checkKeys, replaceSpaceWithUnderscreInVarNameInput } from '@/utils/var'
import BoolValue from './bool-value'
export type ModalPropsType = {
chatVar?: ConversationVariable
@ -33,6 +34,7 @@ type ObjectValueItem = {
const typeList = [
ChatVarType.String,
ChatVarType.Number,
ChatVarType.Boolean,
ChatVarType.Object,
ChatVarType.ArrayString,
ChatVarType.ArrayNumber,
@ -157,6 +159,8 @@ const ChatVariableModal = ({
setEditInJSON(true)
if (v === ChatVarType.String || v === ChatVarType.Number || v === ChatVarType.Object)
setEditInJSON(false)
if(v === ChatVarType.Boolean)
setValue(true)
setType(v)
}
@ -345,6 +349,12 @@ const ChatVariableModal = ({
type='number'
/>
)}
{type === ChatVarType.Boolean && (
<BoolValue
value={value}
onChange={setValue}
/>
)}
{type === ChatVarType.Object && !editInJSON && (
<ObjectValueList
list={objectValue}

View File

@ -1,8 +1,10 @@
export enum ChatVarType {
Number = 'number',
String = 'string',
Boolean = 'boolean',
Object = 'object',
ArrayString = 'array[string]',
ArrayNumber = 'array[number]',
ArrayBoolean = 'array[boolean]',
ArrayObject = 'array[object]',
}