mirror of
https://github.com/labring/FastGPT.git
synced 2025-08-02 12:48:30 +00:00
perf: template
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import type { AppModuleInputItemType, AppModuleItemType, VariableItemType } from '@/types/app';
|
||||
import { chatModelList, vectorModelList } from '@/store/static';
|
||||
import { FlowModuleTypeEnum } from '@/constants/flow';
|
||||
import { FlowModuleTypeEnum, SpecialInputKeyEnum } from '@/constants/flow';
|
||||
import { SystemInputEnum } from '@/constants/app';
|
||||
import { TaskResponseKeyEnum } from '@/constants/chat';
|
||||
import type { SelectedKbType } from '@/types/plugin';
|
||||
|
||||
export type EditFormType = {
|
||||
@@ -128,7 +129,7 @@ export const appModules2Form = (modules: AppModuleItemType[]) => {
|
||||
if (emptyOutput) {
|
||||
const target = modules.find((item) => item.moduleId === emptyOutput.moduleId);
|
||||
defaultAppForm.kb.searchEmptyText =
|
||||
target?.inputs?.find((item) => item.key === 'answerText')?.value || '';
|
||||
target?.inputs?.find((item) => item.key === SpecialInputKeyEnum.answerText)?.value || '';
|
||||
}
|
||||
} else if (module.flowType === FlowModuleTypeEnum.userGuide) {
|
||||
const val =
|
||||
@@ -173,6 +174,10 @@ const chatModelInput = (formData: EditFormType): AppModuleInputItemType[] => [
|
||||
value: formData.chatModel.limitPrompt,
|
||||
connected: true
|
||||
},
|
||||
{
|
||||
key: 'switch',
|
||||
connected: formData.kb.list.length > 0
|
||||
},
|
||||
{
|
||||
key: 'quoteQA',
|
||||
connected: formData.kb.list.length > 0
|
||||
@@ -289,7 +294,7 @@ const simpleChatTemplate = (formData: EditFormType): AppModuleItemType[] => [
|
||||
inputs: chatModelInput(formData),
|
||||
outputs: [
|
||||
{
|
||||
key: 'answerText',
|
||||
key: TaskResponseKeyEnum.answerText,
|
||||
targets: []
|
||||
}
|
||||
],
|
||||
@@ -439,7 +444,7 @@ const kbTemplate = (formData: EditFormType): AppModuleItemType[] => [
|
||||
connected: true
|
||||
},
|
||||
{
|
||||
key: 'answerText',
|
||||
key: SpecialInputKeyEnum.answerText,
|
||||
value: formData.kb.searchEmptyText,
|
||||
connected: true
|
||||
}
|
||||
@@ -458,7 +463,7 @@ const kbTemplate = (formData: EditFormType): AppModuleItemType[] => [
|
||||
inputs: chatModelInput(formData),
|
||||
outputs: [
|
||||
{
|
||||
key: 'answerText',
|
||||
key: TaskResponseKeyEnum.answerText,
|
||||
targets: []
|
||||
}
|
||||
],
|
||||
|
Reference in New Issue
Block a user