perf: bill
This commit is contained in:
@@ -965,8 +965,8 @@ export const appTemplates: (AppItemType & { avatar: string; intro: string })[] =
|
||||
name: '意图识别',
|
||||
intro: '可以判断用户问题属于哪方面问题,从而执行不同的操作。',
|
||||
type: 'http',
|
||||
url: '/openapi/modules/agent/classifyQuestion',
|
||||
flowType: 'classifyQuestionNode',
|
||||
url: '/openapi/modules/agent/recognizeIntention',
|
||||
flowType: 'recognizeIntention',
|
||||
inputs: [
|
||||
{
|
||||
key: 'systemPrompt',
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
export enum ChatModelEnum {
|
||||
'GPT35' = 'gpt-3.5-turbo',
|
||||
'GPT3516k' = 'gpt-3.5-turbo-16k',
|
||||
'GPT4' = 'gpt-4',
|
||||
'GPT432k' = 'gpt-4-32k'
|
||||
}
|
||||
|
||||
export const chatModelList = [
|
||||
{ label: 'Gpt35-16k', value: ChatModelEnum.GPT3516k },
|
||||
{ label: 'Gpt35-4k', value: ChatModelEnum.GPT35 },
|
||||
{ label: 'Gpt4-8k', value: ChatModelEnum.GPT4 }
|
||||
];
|
||||
@@ -1,7 +1,7 @@
|
||||
import { AppModuleItemTypeEnum, SystemInputEnum, SpecificInputEnum } from '../app';
|
||||
import { FlowModuleTypeEnum, FlowInputItemTypeEnum, FlowOutputItemTypeEnum } from './index';
|
||||
import type { AppModuleTemplateItemType } from '@/types/app';
|
||||
import { chatModelList } from '../data';
|
||||
import { chatModelList } from '@/store/static';
|
||||
import {
|
||||
Input_Template_History,
|
||||
Input_Template_TFSwitch,
|
||||
@@ -96,8 +96,8 @@ export const ChatModule: AppModuleTemplateItemType = {
|
||||
key: 'model',
|
||||
type: FlowInputItemTypeEnum.select,
|
||||
label: '对话模型',
|
||||
value: chatModelList[0].value,
|
||||
list: chatModelList
|
||||
value: chatModelList[0]?.model,
|
||||
list: chatModelList.map((item) => ({ label: item.name, value: item.model }))
|
||||
},
|
||||
{
|
||||
key: 'temperature',
|
||||
@@ -278,13 +278,13 @@ export const TFSwitchModule: AppModuleTemplateItemType = {
|
||||
}
|
||||
]
|
||||
};
|
||||
export const ClassifyQuestionModule: AppModuleTemplateItemType = {
|
||||
export const RecognizeIntentionModule: AppModuleTemplateItemType = {
|
||||
logo: '/imgs/module/cq.png',
|
||||
name: '意图识别',
|
||||
intro: '可以判断用户问题属于哪方面问题,从而执行不同的操作。',
|
||||
type: AppModuleItemTypeEnum.http,
|
||||
url: '/openapi/modules/agent/classifyQuestion',
|
||||
flowType: FlowModuleTypeEnum.classifyQuestionNode,
|
||||
url: '/openapi/modules/agent/recognizeIntention',
|
||||
flowType: FlowModuleTypeEnum.recognizeIntention,
|
||||
inputs: [
|
||||
{
|
||||
key: 'systemPrompt',
|
||||
@@ -348,6 +348,6 @@ export const ModuleTemplates = [
|
||||
},
|
||||
{
|
||||
label: 'Agent',
|
||||
list: [ClassifyQuestionModule]
|
||||
list: [RecognizeIntentionModule]
|
||||
}
|
||||
];
|
||||
|
||||
@@ -26,7 +26,7 @@ export enum FlowModuleTypeEnum {
|
||||
kbSearchNode = 'kbSearchNode',
|
||||
tfSwitchNode = 'tfSwitchNode',
|
||||
answerNode = 'answerNode',
|
||||
classifyQuestionNode = 'classifyQuestionNode'
|
||||
recognizeIntention = 'recognizeIntention'
|
||||
}
|
||||
|
||||
export const edgeOptions = {
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
import { getSystemModelList } from '@/api/system';
|
||||
import type { ShareChatEditType } from '@/types/app';
|
||||
import type { AppSchema } from '@/types/mongoSchema';
|
||||
|
||||
export const embeddingModel = 'text-embedding-ada-002';
|
||||
export const embeddingPrice = 0.1;
|
||||
export type EmbeddingModelType = 'text-embedding-ada-002';
|
||||
|
||||
export enum OpenAiChatEnum {
|
||||
'GPT35' = 'gpt-3.5-turbo',
|
||||
'GPT3516k' = 'gpt-3.5-turbo-16k',
|
||||
@@ -13,58 +8,6 @@ export enum OpenAiChatEnum {
|
||||
'GPT432k' = 'gpt-4-32k'
|
||||
}
|
||||
|
||||
export type ChatModelType = `${OpenAiChatEnum}`;
|
||||
|
||||
export type ChatModelItemType = {
|
||||
chatModel: ChatModelType;
|
||||
name: string;
|
||||
contextMaxToken: number;
|
||||
systemMaxToken: number;
|
||||
maxTemperature: number;
|
||||
price: number;
|
||||
};
|
||||
|
||||
export const ChatModelMap = {
|
||||
[OpenAiChatEnum.GPT35]: {
|
||||
chatModel: OpenAiChatEnum.GPT35,
|
||||
name: 'Gpt35-4k',
|
||||
contextMaxToken: 4000,
|
||||
systemMaxToken: 2400,
|
||||
maxTemperature: 1.2,
|
||||
price: 1.5
|
||||
},
|
||||
[OpenAiChatEnum.GPT3516k]: {
|
||||
chatModel: OpenAiChatEnum.GPT3516k,
|
||||
name: 'Gpt35-16k',
|
||||
contextMaxToken: 16000,
|
||||
systemMaxToken: 8000,
|
||||
maxTemperature: 1.2,
|
||||
price: 3
|
||||
},
|
||||
[OpenAiChatEnum.GPT4]: {
|
||||
chatModel: OpenAiChatEnum.GPT4,
|
||||
name: 'Gpt4',
|
||||
contextMaxToken: 8000,
|
||||
systemMaxToken: 4000,
|
||||
maxTemperature: 1.2,
|
||||
price: 45
|
||||
},
|
||||
[OpenAiChatEnum.GPT432k]: {
|
||||
chatModel: OpenAiChatEnum.GPT432k,
|
||||
name: 'Gpt4-32k',
|
||||
contextMaxToken: 32000,
|
||||
systemMaxToken: 8000,
|
||||
maxTemperature: 1.2,
|
||||
price: 90
|
||||
}
|
||||
};
|
||||
|
||||
export const chatModelList: ChatModelItemType[] = [
|
||||
ChatModelMap[OpenAiChatEnum.GPT3516k],
|
||||
ChatModelMap[OpenAiChatEnum.GPT35],
|
||||
ChatModelMap[OpenAiChatEnum.GPT4]
|
||||
];
|
||||
|
||||
export const defaultApp: AppSchema = {
|
||||
_id: '',
|
||||
userId: 'userId',
|
||||
@@ -72,17 +15,6 @@ export const defaultApp: AppSchema = {
|
||||
avatar: '/icon/logo.png',
|
||||
intro: '',
|
||||
updateTime: Date.now(),
|
||||
chat: {
|
||||
relatedKbs: [],
|
||||
searchSimilarity: 0.2,
|
||||
searchLimit: 5,
|
||||
searchEmptyText: '',
|
||||
systemPrompt: '',
|
||||
limitPrompt: '',
|
||||
temperature: 0,
|
||||
maxToken: 4000,
|
||||
chatModel: OpenAiChatEnum.GPT35
|
||||
},
|
||||
share: {
|
||||
isShare: false,
|
||||
isShareDetail: false,
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
export enum BillTypeEnum {
|
||||
chat = 'chat',
|
||||
openapiChat = 'openapiChat',
|
||||
QA = 'QA',
|
||||
vector = 'vector',
|
||||
return = 'return'
|
||||
export enum BillSourceEnum {
|
||||
fastgpt = 'fastgpt',
|
||||
api = 'api'
|
||||
}
|
||||
export enum PageTypeEnum {
|
||||
login = 'login',
|
||||
@@ -11,12 +8,9 @@ export enum PageTypeEnum {
|
||||
forgetPassword = 'forgetPassword'
|
||||
}
|
||||
|
||||
export const BillTypeMap: Record<`${BillTypeEnum}`, string> = {
|
||||
[BillTypeEnum.chat]: '对话',
|
||||
[BillTypeEnum.openapiChat]: 'api 对话',
|
||||
[BillTypeEnum.QA]: 'QA拆分',
|
||||
[BillTypeEnum.vector]: '索引生成',
|
||||
[BillTypeEnum.return]: '退款'
|
||||
export const BillSourceMap: Record<`${BillSourceEnum}`, string> = {
|
||||
[BillSourceEnum.fastgpt]: 'FastGpt 平台',
|
||||
[BillSourceEnum.api]: 'Api'
|
||||
};
|
||||
|
||||
export enum PromotionEnum {
|
||||
|
||||
Reference in New Issue
Block a user