mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-27 08:25:07 +00:00
4.6.4-alpha (#569)
This commit is contained in:
33
packages/global/core/chat/api.d.ts
vendored
33
packages/global/core/chat/api.d.ts
vendored
@@ -1,33 +0,0 @@
|
||||
import { ModuleItemType } from '../module/type';
|
||||
import { AdminFbkType, ChatItemType, moduleDispatchResType } from './type';
|
||||
|
||||
export type UpdateHistoryProps = {
|
||||
chatId: string;
|
||||
customTitle?: string;
|
||||
top?: boolean;
|
||||
};
|
||||
|
||||
export type AdminUpdateFeedbackParams = AdminFbkType & {
|
||||
chatItemId: string;
|
||||
};
|
||||
|
||||
export type InitChatResponse = {
|
||||
chatId: string;
|
||||
appId: string;
|
||||
app: {
|
||||
userGuideModule?: ModuleItemType;
|
||||
chatModels?: string[];
|
||||
name: string;
|
||||
avatar: string;
|
||||
intro: string;
|
||||
canUse?: boolean;
|
||||
};
|
||||
title: string;
|
||||
variables: Record<string, any>;
|
||||
history: ChatItemType[];
|
||||
};
|
||||
|
||||
export type ChatHistoryItemResType = moduleDispatchResType & {
|
||||
moduleType: `${FlowNodeTypeEnum}`;
|
||||
moduleName: string;
|
||||
};
|
@@ -44,6 +44,12 @@ export const ChatSourceMap = {
|
||||
}
|
||||
};
|
||||
|
||||
export enum ChatStatusEnum {
|
||||
loading = 'loading',
|
||||
running = 'running',
|
||||
finish = 'finish'
|
||||
}
|
||||
|
||||
export const HUMAN_ICON = `/icon/human.svg`;
|
||||
export const LOGO_ICON = `/icon/logo.svg`;
|
||||
|
||||
|
17
packages/global/core/chat/type.d.ts
vendored
17
packages/global/core/chat/type.d.ts
vendored
@@ -1,6 +1,6 @@
|
||||
import { ClassifyQuestionAgentItemType } from '../module/type';
|
||||
import { SearchDataResponseItemType } from '../dataset/type';
|
||||
import { ChatRoleEnum, ChatSourceEnum } from './constants';
|
||||
import { ChatRoleEnum, ChatSourceEnum, ChatStatusEnum } from './constants';
|
||||
import { FlowNodeTypeEnum } from '../module/node/constant';
|
||||
import { ModuleOutputKeyEnum } from '../module/constants';
|
||||
import { AppSchema } from '../app/type';
|
||||
@@ -20,7 +20,7 @@ export type ChatSchema = {
|
||||
variables: Record<string, any>;
|
||||
source: `${ChatSourceEnum}`;
|
||||
shareId?: string;
|
||||
isInit: boolean;
|
||||
outLinkUid?: string;
|
||||
content: ChatItemType[];
|
||||
};
|
||||
|
||||
@@ -51,6 +51,7 @@ export type AdminFbkType = {
|
||||
a?: string;
|
||||
};
|
||||
|
||||
/* --------- chat item ---------- */
|
||||
export type ChatItemType = {
|
||||
dataId?: string;
|
||||
obj: ChatItemSchema['obj'];
|
||||
@@ -61,11 +62,12 @@ export type ChatItemType = {
|
||||
};
|
||||
|
||||
export type ChatSiteItemType = ChatItemType & {
|
||||
status: 'loading' | 'running' | 'finish';
|
||||
status: `${ChatStatusEnum}`;
|
||||
moduleName?: string;
|
||||
ttsBuffer?: Uint8Array;
|
||||
};
|
||||
|
||||
/* ---------- history ------------- */
|
||||
export type HistoryItemType = {
|
||||
chatId: string;
|
||||
updateTime: Date;
|
||||
@@ -77,10 +79,10 @@ export type ChatHistoryItemType = HistoryItemType & {
|
||||
top: boolean;
|
||||
};
|
||||
|
||||
// response data
|
||||
/* ------- response data ------------ */
|
||||
export type moduleDispatchResType = {
|
||||
moduleLogo?: string;
|
||||
price: number;
|
||||
price?: number;
|
||||
runningTime?: number;
|
||||
tokens?: number;
|
||||
model?: string;
|
||||
@@ -112,3 +114,8 @@ export type moduleDispatchResType = {
|
||||
// plugin output
|
||||
pluginOutput?: Record<string, any>;
|
||||
};
|
||||
|
||||
export type ChatHistoryItemResType = moduleDispatchResType & {
|
||||
moduleType: `${FlowNodeTypeEnum}`;
|
||||
moduleName: string;
|
||||
};
|
||||
|
2
packages/global/core/dataset/api.d.ts
vendored
2
packages/global/core/dataset/api.d.ts
vendored
@@ -6,9 +6,9 @@ import type { LLMModelItemType } from '../ai/model.d';
|
||||
export type DatasetUpdateBody = {
|
||||
id: string;
|
||||
parentId?: string;
|
||||
tags?: string[];
|
||||
name?: string;
|
||||
avatar?: string;
|
||||
intro?: string;
|
||||
permission?: DatasetSchemaType['permission'];
|
||||
agentModel?: LLMModelItemType;
|
||||
websiteConfig?: DatasetSchemaType['websiteConfig'];
|
||||
|
Reference in New Issue
Block a user