chat box
This commit is contained in:
@@ -2,12 +2,15 @@ import type { AppItemType } from '@/types/app';
|
||||
|
||||
/* app */
|
||||
export enum AppModuleItemTypeEnum {
|
||||
'userGuide' = 'userGuide', // default chat input: userChatInput, history
|
||||
'initInput' = 'initInput', // default chat input: userChatInput, history
|
||||
'http' = 'http', // send a http request
|
||||
'switch' = 'switch', // one input and two outputs
|
||||
'answer' = 'answer' // redirect response
|
||||
}
|
||||
export enum SystemInputEnum {
|
||||
'welcomeText' = 'welcomeText',
|
||||
'variables' = 'variables',
|
||||
'switch' = 'switch', // a trigger switch
|
||||
'history' = 'history',
|
||||
'userChatInput' = 'userChatInput'
|
||||
@@ -15,6 +18,10 @@ export enum SystemInputEnum {
|
||||
export enum SpecificInputEnum {
|
||||
'answerText' = 'answerText' // answer module text key
|
||||
}
|
||||
export enum VariableInputEnum {
|
||||
input = 'input',
|
||||
select = 'select'
|
||||
}
|
||||
|
||||
// template
|
||||
export const appTemplates: (AppItemType & { avatar: string; intro: string })[] = [
|
||||
|
||||
@@ -8,6 +8,27 @@ import {
|
||||
Input_Template_UserChatInput
|
||||
} from './inputTemplate';
|
||||
|
||||
export const VariableInputModule: AppModuleTemplateItemType = {
|
||||
logo: '/imgs/module/userGuide.png',
|
||||
name: '开场引导',
|
||||
intro: '可以在每个新对话开始前,给用户发送一段开场白,或要求用户填写一些内容作为本轮对话的变量。',
|
||||
type: AppModuleItemTypeEnum.userGuide,
|
||||
flowType: FlowModuleTypeEnum.userGuide,
|
||||
inputs: [
|
||||
{
|
||||
key: SystemInputEnum.welcomeText,
|
||||
type: FlowInputItemTypeEnum.input,
|
||||
label: '开场白'
|
||||
},
|
||||
{
|
||||
key: SystemInputEnum.variables,
|
||||
type: FlowInputItemTypeEnum.systemInput,
|
||||
label: '变量输入',
|
||||
value: []
|
||||
}
|
||||
],
|
||||
outputs: []
|
||||
};
|
||||
export const UserInputModule: AppModuleTemplateItemType = {
|
||||
logo: '/imgs/module/userChatInput.png',
|
||||
name: '用户问题',
|
||||
@@ -311,7 +332,7 @@ export const ClassifyQuestionModule: AppModuleTemplateItemType = {
|
||||
export const ModuleTemplates = [
|
||||
{
|
||||
label: '输入模块',
|
||||
list: [UserInputModule, HistoryModule]
|
||||
list: [UserInputModule, HistoryModule, VariableInputModule]
|
||||
},
|
||||
{
|
||||
label: '对话模块',
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
export enum FlowInputItemTypeEnum {
|
||||
systemInput = 'systemInput', // history, userChatInput
|
||||
systemInput = 'systemInput', // history, userChatInput, variableInput
|
||||
input = 'input',
|
||||
textarea = 'textarea',
|
||||
numberInput = 'numberInput',
|
||||
@@ -19,6 +19,7 @@ export enum FlowOutputItemTypeEnum {
|
||||
}
|
||||
|
||||
export enum FlowModuleTypeEnum {
|
||||
userGuide = 'userGuide',
|
||||
questionInputNode = 'questionInput',
|
||||
historyNode = 'historyNode',
|
||||
chatNode = 'chatNode',
|
||||
|
||||
@@ -165,7 +165,8 @@ const Textarea: ComponentStyleConfig = {
|
||||
borderColor: 'myGray.200',
|
||||
_focus: {
|
||||
borderColor: 'myBlue.600',
|
||||
boxShadow: '0px 0px 4px #A8DBFF'
|
||||
boxShadow: '0px 0px 4px #A8DBFF',
|
||||
bg: 'white'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user