mirror of
https://github.com/labring/FastGPT.git
synced 2025-08-01 20:27:45 +00:00
v4.6 -1 (#459)
This commit is contained in:
@@ -1,4 +1,32 @@
|
||||
/* app */
|
||||
import { AppDetailType } from '@fastgpt/global/core/app/type.d';
|
||||
import type { OutLinkEditType } from '@fastgpt/global/support/outLink/type.d';
|
||||
|
||||
export const defaultApp: AppDetailType = {
|
||||
_id: '',
|
||||
userId: 'userId',
|
||||
name: '模型加载中',
|
||||
type: 'basic',
|
||||
avatar: '/icon/logo.svg',
|
||||
intro: '',
|
||||
updateTime: Date.now(),
|
||||
modules: [],
|
||||
teamId: '',
|
||||
tmbId: '',
|
||||
permission: 'private',
|
||||
isOwner: false,
|
||||
canWrite: false
|
||||
};
|
||||
|
||||
export const defaultOutLinkForm: OutLinkEditType = {
|
||||
name: '',
|
||||
responseDetail: false,
|
||||
limit: {
|
||||
QPM: 100,
|
||||
credit: -1
|
||||
}
|
||||
};
|
||||
|
||||
/* module special */
|
||||
export enum SystemInputEnum {
|
||||
'welcomeText' = 'welcomeText',
|
||||
'variables' = 'variables',
|
||||
@@ -6,6 +34,7 @@ export enum SystemInputEnum {
|
||||
'history' = 'history',
|
||||
'userChatInput' = 'userChatInput',
|
||||
'questionGuide' = 'questionGuide',
|
||||
'tts' = 'tts',
|
||||
isResponseAnswerText = 'isResponseAnswerText'
|
||||
}
|
||||
export enum SystemOutputEnum {
|
||||
@@ -17,7 +46,8 @@ export enum VariableInputEnum {
|
||||
select = 'select'
|
||||
}
|
||||
|
||||
export enum AppTypeEnum {
|
||||
basic = 'basic',
|
||||
advanced = 'advanced'
|
||||
export enum TTSTypeEnum {
|
||||
none = 'none',
|
||||
web = 'web',
|
||||
model = 'model'
|
||||
}
|
||||
|
@@ -1,57 +0,0 @@
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
export enum sseResponseEventEnum {
|
||||
error = 'error',
|
||||
answer = 'answer',
|
||||
moduleStatus = 'moduleStatus',
|
||||
appStreamResponse = 'appStreamResponse' // sse response request
|
||||
}
|
||||
|
||||
export enum ChatRoleEnum {
|
||||
System = 'System',
|
||||
Human = 'Human',
|
||||
AI = 'AI'
|
||||
}
|
||||
|
||||
export enum TaskResponseKeyEnum {
|
||||
'answerText' = 'answerText', // answer module text key
|
||||
'responseData' = 'responseData',
|
||||
'history' = 'history'
|
||||
}
|
||||
|
||||
export const ChatRoleMap = {
|
||||
[ChatRoleEnum.System]: {
|
||||
name: '系统提示词'
|
||||
},
|
||||
[ChatRoleEnum.Human]: {
|
||||
name: '用户'
|
||||
},
|
||||
[ChatRoleEnum.AI]: {
|
||||
name: 'AI'
|
||||
}
|
||||
};
|
||||
|
||||
export enum ChatSourceEnum {
|
||||
test = 'test',
|
||||
online = 'online',
|
||||
share = 'share',
|
||||
api = 'api'
|
||||
}
|
||||
|
||||
export const ChatSourceMap = {
|
||||
[ChatSourceEnum.test]: {
|
||||
name: 'chat.logs.test'
|
||||
},
|
||||
[ChatSourceEnum.online]: {
|
||||
name: 'chat.logs.online'
|
||||
},
|
||||
[ChatSourceEnum.share]: {
|
||||
name: 'chat.logs.share'
|
||||
},
|
||||
[ChatSourceEnum.api]: {
|
||||
name: 'chat.logs.api'
|
||||
}
|
||||
};
|
||||
|
||||
export const HUMAN_ICON = `/icon/human.svg`;
|
||||
export const LOGO_ICON = `/icon/logo.svg`;
|
@@ -1,11 +1,19 @@
|
||||
import type { DatasetItemType } from '@/types/core/dataset';
|
||||
|
||||
export const defaultKbDetail: DatasetItemType = {
|
||||
export const defaultDatasetDetail: DatasetItemType = {
|
||||
_id: '',
|
||||
parentId: '',
|
||||
userId: '',
|
||||
teamId: '',
|
||||
tmbId: '',
|
||||
updateTime: new Date(),
|
||||
type: 'dataset',
|
||||
avatar: '/icon/logo.svg',
|
||||
name: '',
|
||||
tags: '',
|
||||
permission: 'private',
|
||||
isOwner: false,
|
||||
canWrite: false,
|
||||
vectorModel: {
|
||||
model: 'text-embedding-ada-002',
|
||||
name: 'Embedding-2',
|
||||
|
@@ -1,5 +1,6 @@
|
||||
import { AppTypeEnum, SystemInputEnum } from '../app';
|
||||
import { TaskResponseKeyEnum } from '../chat';
|
||||
import { SystemInputEnum } from '../app';
|
||||
import { AppTypeEnum } from '@fastgpt/global/core/app/constants';
|
||||
import { TaskResponseKeyEnum } from '@fastgpt/global/core/chat/constants';
|
||||
import {
|
||||
FlowNodeTypeEnum,
|
||||
FlowNodeInputTypeEnum,
|
||||
@@ -27,7 +28,6 @@ export const welcomeTextTip =
|
||||
'每次对话开始前,发送一个初始内容。支持标准 Markdown 语法,可使用的额外标记:\n[快捷按键]: 用户点击后可以直接发送该问题';
|
||||
export const variableTip =
|
||||
'可以在对话开始前,要求用户填写一些内容作为本轮对话的特定变量。该模块位于开场引导之后。\n变量可以通过 {{变量key}} 的形式注入到其他模块 string 类型的输入中,例如:提示词、限定词等';
|
||||
export const questionGuideTip = `对话结束后,会为生成 3 个引导性问题。`;
|
||||
|
||||
export const VariableModule: FlowModuleTemplateType = {
|
||||
id: FlowNodeTypeEnum.variable,
|
||||
@@ -69,6 +69,11 @@ export const UserGuideModule: FlowModuleTemplateType = {
|
||||
key: SystemInputEnum.questionGuide,
|
||||
type: FlowNodeInputTypeEnum.switch,
|
||||
label: '问题引导'
|
||||
},
|
||||
{
|
||||
key: SystemInputEnum.tts,
|
||||
type: FlowNodeInputTypeEnum.hidden,
|
||||
label: '语音播报'
|
||||
}
|
||||
],
|
||||
outputs: []
|
||||
@@ -162,15 +167,15 @@ export const ChatModule: FlowModuleTemplateType = {
|
||||
key: 'maxToken',
|
||||
type: FlowNodeInputTypeEnum.hidden,
|
||||
label: '回复上限',
|
||||
value: chatModelList?.[0] ? chatModelList[0].maxToken / 2 : 2000,
|
||||
value: chatModelList?.[0] ? chatModelList[0].maxResponse / 2 : 2000,
|
||||
min: 100,
|
||||
max: chatModelList?.[0]?.maxToken || 4000,
|
||||
max: chatModelList?.[0]?.maxResponse || 4000,
|
||||
step: 50,
|
||||
markList: [
|
||||
{ label: '100', value: 100 },
|
||||
{
|
||||
label: `${chatModelList?.[0]?.maxToken || 4000}`,
|
||||
value: chatModelList?.[0]?.maxToken || 4000
|
||||
label: `${chatModelList?.[0]?.maxResponse || 4000}`,
|
||||
value: chatModelList?.[0]?.maxResponse || 4000
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@@ -1,120 +0,0 @@
|
||||
import type { AppSchema } from '@/types/mongoSchema';
|
||||
import type { OutLinkEditType } from '@fastgpt/global/support/outLink/type.d';
|
||||
import type {
|
||||
LLMModelItemType,
|
||||
ChatModelItemType,
|
||||
FunctionModelItemType,
|
||||
VectorModelItemType
|
||||
} from '@/types/model';
|
||||
|
||||
export const defaultChatModels: ChatModelItemType[] = [
|
||||
{
|
||||
model: 'gpt-3.5-turbo',
|
||||
name: 'GPT35-4k',
|
||||
price: 0,
|
||||
maxToken: 4000,
|
||||
quoteMaxToken: 2000,
|
||||
maxTemperature: 1.2,
|
||||
censor: false,
|
||||
defaultSystemChatPrompt: ''
|
||||
},
|
||||
{
|
||||
model: 'gpt-3.5-turbo-16k',
|
||||
name: 'GPT35-16k',
|
||||
maxToken: 16000,
|
||||
price: 0,
|
||||
quoteMaxToken: 8000,
|
||||
maxTemperature: 1.2,
|
||||
censor: false,
|
||||
defaultSystemChatPrompt: ''
|
||||
},
|
||||
{
|
||||
model: 'gpt-4',
|
||||
name: 'GPT4-8k',
|
||||
maxToken: 8000,
|
||||
price: 0,
|
||||
quoteMaxToken: 4000,
|
||||
maxTemperature: 1.2,
|
||||
censor: false,
|
||||
defaultSystemChatPrompt: ''
|
||||
}
|
||||
];
|
||||
export const defaultQAModels: LLMModelItemType[] = [
|
||||
{
|
||||
model: 'gpt-3.5-turbo-16k',
|
||||
name: 'GPT35-16k',
|
||||
maxToken: 16000,
|
||||
price: 0
|
||||
}
|
||||
];
|
||||
export const defaultCQModels: FunctionModelItemType[] = [
|
||||
{
|
||||
model: 'gpt-3.5-turbo-16k',
|
||||
name: 'GPT35-16k',
|
||||
maxToken: 16000,
|
||||
price: 0,
|
||||
functionCall: true,
|
||||
functionPrompt: ''
|
||||
},
|
||||
{
|
||||
model: 'gpt-4',
|
||||
name: 'GPT4-8k',
|
||||
maxToken: 8000,
|
||||
price: 0,
|
||||
functionCall: true,
|
||||
functionPrompt: ''
|
||||
}
|
||||
];
|
||||
export const defaultExtractModels: FunctionModelItemType[] = [
|
||||
{
|
||||
model: 'gpt-3.5-turbo-16k',
|
||||
name: 'GPT35-16k',
|
||||
maxToken: 16000,
|
||||
price: 0,
|
||||
functionCall: true,
|
||||
functionPrompt: ''
|
||||
}
|
||||
];
|
||||
export const defaultQGModels: LLMModelItemType[] = [
|
||||
{
|
||||
model: 'gpt-3.5-turbo',
|
||||
name: 'GPT35-4K',
|
||||
maxToken: 4000,
|
||||
price: 0
|
||||
}
|
||||
];
|
||||
|
||||
export const defaultVectorModels: VectorModelItemType[] = [
|
||||
{
|
||||
model: 'text-embedding-ada-002',
|
||||
name: 'Embedding-2',
|
||||
price: 0,
|
||||
defaultToken: 500,
|
||||
maxToken: 3000
|
||||
}
|
||||
];
|
||||
|
||||
export const defaultApp: AppSchema = {
|
||||
_id: '',
|
||||
userId: 'userId',
|
||||
name: '模型加载中',
|
||||
type: 'basic',
|
||||
avatar: '/icon/logo.svg',
|
||||
intro: '',
|
||||
updateTime: Date.now(),
|
||||
share: {
|
||||
isShare: false,
|
||||
isShareDetail: false,
|
||||
collection: 0
|
||||
},
|
||||
modules: []
|
||||
};
|
||||
|
||||
export const defaultOutLinkForm: OutLinkEditType = {
|
||||
name: '',
|
||||
responseDetail: false,
|
||||
limit: {
|
||||
QPM: 100,
|
||||
credit: -1
|
||||
}
|
||||
};
|
@@ -1 +0,0 @@
|
||||
export const PgDatasetTableName = 'modeldata';
|
@@ -1,26 +1,9 @@
|
||||
export enum OAuthEnum {
|
||||
github = 'github',
|
||||
google = 'google'
|
||||
}
|
||||
export enum BillSourceEnum {
|
||||
fastgpt = 'fastgpt',
|
||||
api = 'api',
|
||||
shareLink = 'shareLink',
|
||||
training = 'training'
|
||||
}
|
||||
export enum PageTypeEnum {
|
||||
login = 'login',
|
||||
register = 'register',
|
||||
forgetPassword = 'forgetPassword'
|
||||
}
|
||||
|
||||
export const BillSourceMap: Record<`${BillSourceEnum}`, string> = {
|
||||
[BillSourceEnum.fastgpt]: '在线使用',
|
||||
[BillSourceEnum.api]: 'Api',
|
||||
[BillSourceEnum.shareLink]: '免登录链接',
|
||||
[BillSourceEnum.training]: '数据训练'
|
||||
};
|
||||
|
||||
export enum PromotionEnum {
|
||||
register = 'register',
|
||||
pay = 'pay'
|
||||
|
Reference in New Issue
Block a user