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:
@@ -3,7 +3,8 @@ import type {
|
||||
FunctionModelItemType,
|
||||
LLMModelItemType,
|
||||
VectorModelItemType
|
||||
} from '@/types/model';
|
||||
} from '@fastgpt/global/core/ai/model.d';
|
||||
|
||||
import type { FeConfigsType } from '@fastgpt/global/common/system/types/index.d';
|
||||
|
||||
export type InitDateResponse = {
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/* Only the token of gpt-3.5-turbo is used */
|
||||
import { ChatItemType } from '@/types/chat';
|
||||
import type { ChatItemType } from '@fastgpt/global/core/chat/type';
|
||||
import { Tiktoken } from 'js-tiktoken/lite';
|
||||
import { adaptChat2GptMessages } from '@/utils/common/adapt/message';
|
||||
import { ChatCompletionRequestMessageRoleEnum } from '@fastgpt/global/core/ai/constant';
|
||||
|
6
projects/app/src/global/core/ai/api.d.ts
vendored
Normal file
6
projects/app/src/global/core/ai/api.d.ts
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
import { ChatMessageItemType } from '@fastgpt/global/core/ai/type.d';
|
||||
|
||||
export type CreateQuestionGuideParams = {
|
||||
messages: ChatMessageItemType[];
|
||||
shareId?: string;
|
||||
};
|
6
projects/app/src/global/core/api/aiReq.d.ts
vendored
6
projects/app/src/global/core/api/aiReq.d.ts
vendored
@@ -1,6 +0,0 @@
|
||||
import { ChatCompletionRequestMessage } from '@fastgpt/global/core/ai/type.d';
|
||||
|
||||
export type CreateQuestionGuideParams = {
|
||||
messages: ChatCompletionRequestMessage[];
|
||||
shareId?: string;
|
||||
};
|
6
projects/app/src/global/core/api/appRes.d.ts
vendored
6
projects/app/src/global/core/api/appRes.d.ts
vendored
@@ -1,6 +0,0 @@
|
||||
import { AppListItemType } from '@/types/app';
|
||||
|
||||
export type AppListResponse = {
|
||||
myApps: AppListItemType[];
|
||||
myCollectionApps: AppListItemType[];
|
||||
};
|
@@ -1,5 +0,0 @@
|
||||
import { MarkDataType } from '../dataset/type';
|
||||
|
||||
export type AdminUpdateFeedbackParams = MarkDataType & {
|
||||
chatItemId: string;
|
||||
};
|
20
projects/app/src/global/core/api/chatRes.d.ts
vendored
20
projects/app/src/global/core/api/chatRes.d.ts
vendored
@@ -1,20 +0,0 @@
|
||||
import type { AppSchema } from '@/types/mongoSchema';
|
||||
import type { ChatItemType } from '@/types/chat';
|
||||
import { VariableItemType } from '@/types/app';
|
||||
import type { ModuleItemType } from '@fastgpt/global/core/module/type';
|
||||
|
||||
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[];
|
||||
};
|
@@ -4,6 +4,7 @@ import { TrainingModeEnum } from '@fastgpt/global/core/dataset/constant';
|
||||
import type { SearchTestItemType } from '@/types/core/dataset';
|
||||
import { DatasetChunkItemType, UploadChunkItemType } from '@fastgpt/global/core/dataset/type';
|
||||
import { DatasetCollectionSchemaType } from '@fastgpt/global/core/dataset/type';
|
||||
import { PermissionTypeEnum } from '@fastgpt/global/support/permission/constant';
|
||||
|
||||
/* ===== dataset ===== */
|
||||
export type DatasetUpdateParams = {
|
||||
@@ -12,11 +13,12 @@ export type DatasetUpdateParams = {
|
||||
tags?: string;
|
||||
name?: string;
|
||||
avatar?: string;
|
||||
permission?: `${PermissionTypeEnum}`;
|
||||
};
|
||||
export type CreateDatasetParams = {
|
||||
parentId?: string;
|
||||
name: string;
|
||||
tags: string[];
|
||||
tags: string;
|
||||
avatar: string;
|
||||
vectorModel?: string;
|
||||
type: `${DatasetTypeEnum}`;
|
||||
@@ -25,6 +27,7 @@ export type CreateDatasetParams = {
|
||||
export type SearchTestProps = {
|
||||
datasetId: string;
|
||||
text: string;
|
||||
limit?: number;
|
||||
};
|
||||
|
||||
/* ======= collections =========== */
|
||||
@@ -53,7 +56,6 @@ export type UpdateDatasetCollectionParams = {
|
||||
/* ==== data ===== */
|
||||
export type SetOneDatasetDataProps = {
|
||||
id?: string;
|
||||
datasetId: string;
|
||||
collectionId: string;
|
||||
q?: string; // embedding content
|
||||
a?: string; // bonus content
|
||||
|
@@ -1,7 +1,6 @@
|
||||
import type { RequestPaging } from '@/types';
|
||||
import { TrainingModeEnum } from '@/constants/plugin';
|
||||
import type { SearchTestItemType } from '@/types/core/dataset';
|
||||
import { DatasetDataItemType } from '@/types/core/dataset/data';
|
||||
import { DatasetCollectionSchemaType } from '@fastgpt/global/core/dataset/type';
|
||||
|
||||
/* ===== dataset ===== */
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import { SystemInputEnum } from '@/constants/app';
|
||||
import { FlowNodeTypeEnum } from '@fastgpt/global/core/module/node/constant';
|
||||
import { VariableItemType } from '@/types/app';
|
||||
import { AppTTSConfigType, VariableItemType } from '@/types/app';
|
||||
import type { ModuleItemType } from '@fastgpt/global/core/module/type';
|
||||
|
||||
export const getGuideModule = (modules: ModuleItemType[]) =>
|
||||
@@ -17,9 +17,14 @@ export const splitGuideModule = (guideModules?: ModuleItemType) => {
|
||||
guideModules?.inputs?.find((item) => item.key === SystemInputEnum.questionGuide)?.value ||
|
||||
false;
|
||||
|
||||
const ttsConfig: AppTTSConfigType = guideModules?.inputs?.find(
|
||||
(item) => item.key === SystemInputEnum.tts
|
||||
)?.value || { type: 'web' };
|
||||
|
||||
return {
|
||||
welcomeText,
|
||||
variableModules,
|
||||
questionGuide
|
||||
questionGuide,
|
||||
ttsConfig
|
||||
};
|
||||
};
|
||||
|
7
projects/app/src/global/core/chat/api.d.ts
vendored
Normal file
7
projects/app/src/global/core/chat/api.d.ts
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import type { AppTTSConfigType } from '@/types/app';
|
||||
|
||||
export type GetChatSpeechProps = {
|
||||
chatItemId?: string;
|
||||
ttsConfig: AppTTSConfigType;
|
||||
input: string;
|
||||
};
|
@@ -7,12 +7,14 @@ import { DatasetCollectionSchemaType } from '@fastgpt/global/core/dataset/type.d
|
||||
export type DatasetCollectionsListItemType = {
|
||||
_id: string;
|
||||
parentId?: string;
|
||||
tmbId: string;
|
||||
name: string;
|
||||
type: DatasetCollectionSchemaType['type'];
|
||||
updateTime: Date;
|
||||
dataAmount?: number;
|
||||
trainingAmount: number;
|
||||
metadata: DatasetCollectionSchemaType['metadata'];
|
||||
canWrite: boolean;
|
||||
};
|
||||
|
||||
/* ================= data ===================== */
|
||||
|
@@ -1,7 +0,0 @@
|
||||
export type MarkDataType = {
|
||||
dataId: string;
|
||||
datasetId: string;
|
||||
collectionId: string;
|
||||
q: string;
|
||||
a?: string;
|
||||
};
|
@@ -1,6 +0,0 @@
|
||||
import type { InitChatResponse } from '@/global/core/api/chatRes.d';
|
||||
|
||||
export type InitShareChatResponse = {
|
||||
userAvatar: string;
|
||||
app: InitChatResponse['app'];
|
||||
};
|
@@ -1,4 +1,4 @@
|
||||
import type { UserType } from '@/types/user';
|
||||
import type { UserTypee } from '@fastgpt/global/support/user/type.d';
|
||||
import type { PromotionRecordSchema } from '@fastgpt/global/support/activity/type.d';
|
||||
export interface ResLogin {
|
||||
user: UserType;
|
||||
|
Reference in New Issue
Block a user