Revert "sub plan page (#885)" (#886)

This reverts commit 443ad37b6a.
This commit is contained in:
Archer
2024-02-23 17:48:15 +08:00
committed by GitHub
parent 443ad37b6a
commit fd9b6291af
246 changed files with 4281 additions and 6286 deletions

View File

@@ -15,7 +15,6 @@ export const getMyApps = () => GET<AppListItemType[]>('/core/app/list');
*/
export const postCreateApp = (data: CreateAppParams) => POST<string>('/core/app/create', data);
export const getMyAppsByTags = (data: {}) => POST(`/proApi/core/chat/team/getApps`, data);
/**
* 根据 ID 删除模型
*/
@@ -31,12 +30,7 @@ export const getModelById = (id: string) => GET<AppDetailType>(`/core/app/detail
*/
export const putAppById = (id: string, data: AppUpdateParams) =>
PUT(`/core/app/update?appId=${id}`, data);
export const replaceAppById = (id: string, data: AppUpdateParams) =>
PUT(`/core/app/updateTeamTasg?appId=${id}`, data);
// updateTeamTasg
export const putAppTagsById = (id: string, data: AppUpdateParams) =>
PUT(`/core/app/updateTeamTasg?appId=${id}`, data);
/* 共享市场 */
/**
* 获取共享市场模型

View File

@@ -1,7 +1,7 @@
import { create } from 'zustand';
import { devtools, persist } from 'zustand/middleware';
import { immer } from 'zustand/middleware/immer';
import { getMyApps, getModelById, putAppById, replaceAppById } from '@/web/core/app/api';
import { getMyApps, getModelById, putAppById } from '@/web/core/app/api';
import { defaultApp } from '@/constants/app';
import type { AppUpdateParams } from '@fastgpt/global/core/app/api.d';
import { AppDetailType, AppListItemType } from '@fastgpt/global/core/app/type.d';
@@ -12,7 +12,6 @@ type State = {
appDetail: AppDetailType;
loadAppDetail: (id: string, init?: boolean) => Promise<AppDetailType>;
updateAppDetail(appId: string, data: AppUpdateParams): Promise<void>;
replaceAppDetail(appId: string, data: AppUpdateParams): Promise<void>;
clearAppModules(): void;
};
@@ -48,15 +47,6 @@ export const useAppStore = create<State>()(
};
});
},
async replaceAppDetail(appId: string, data: AppUpdateParams) {
await replaceAppById(appId, { ...get().appDetail, ...data });
set((state) => {
state.appDetail = {
...state.appDetail,
...data
};
});
},
clearAppModules() {
set((state) => {
state.appDetail = {

View File

@@ -121,7 +121,7 @@ export const appTemplates: (AppItemType & {
},
{
key: 'model',
type: 'selectLLMModel',
type: 'selectChatModel',
label: 'core.module.input.label.aiModel',
required: true,
valueType: 'string',
@@ -569,7 +569,7 @@ export const appTemplates: (AppItemType & {
},
{
key: 'model',
type: 'selectLLMModel',
type: 'selectChatModel',
label: 'core.module.input.label.aiModel',
required: true,
valueType: 'string',
@@ -882,7 +882,7 @@ export const appTemplates: (AppItemType & {
},
{
key: 'model',
type: 'selectLLMModel',
type: 'selectChatModel',
label: 'core.module.input.label.aiModel',
required: true,
valueType: 'string',
@@ -1115,7 +1115,7 @@ export const appTemplates: (AppItemType & {
},
{
key: 'model',
type: 'selectLLMModel',
type: 'selectCQModel',
valueType: 'string',
label: 'core.module.input.label.Classify model',
required: true,
@@ -1345,7 +1345,7 @@ export const appTemplates: (AppItemType & {
},
{
key: 'model',
type: 'selectLLMModel',
type: 'selectChatModel',
label: 'core.module.input.label.aiModel',
required: true,
valueType: 'string',

View File

@@ -1,6 +1,5 @@
import { GET, POST, DELETE, PUT } from '@/web/common/api/request';
import type { ChatHistoryItemType, chatAppListSchema } from '@fastgpt/global/core/chat/type.d';
import type { ChatHistoryItemType } from '@fastgpt/global/core/chat/type.d';
import type {
CloseCustomFeedbackParams,
InitChatProps,
@@ -17,31 +16,13 @@ import type {
} from '@/global/core/chat/api.d';
import { UpdateChatFeedbackProps } from '@fastgpt/global/core/chat/api';
/**
* 根据队伍ID和获取
*/
export const getChatListById = (data: { teamId: string; authToken: string }) =>
GET<chatAppListSchema>(`/proApi/core/chat/init`, data);
/**
* 获取团队分享的对话列表 initTeamChat
* @param data
* @returns
*/
export const getinitTeamChat = (data: { teamId: string; authToken: string; appId: string }) =>
GET(`/proApi/core/chat/initTeamChat`, data);
/**
* 获取初始化聊天内容
*/
export const getInitChatInfo = (data: InitChatProps) =>
GET<InitChatResponse>(`/core/chat/init`, data);
export const getInitChatInfoTeam = (data: InitChatProps) =>
GET<InitChatResponse>(`/core/chat/init`, data);
export const getInitOutLinkChatInfo = (data: InitOutLinkChatProps) =>
GET<InitChatResponse>(`/core/chat/outLink/init`, data);
export const getTeamChatInfo = (data: { appId: string; chatId: string; outLinkUid?: string }) =>
GET<InitChatResponse>(`/core/chat/team/init`, data);
/**
* get current window history(appid or shareId)

View File

@@ -1,42 +0,0 @@
import { create } from 'zustand';
import { devtools, persist } from 'zustand/middleware';
import { immer } from 'zustand/middleware/immer';
import type { ChatHistoryItemType } from '@fastgpt/global/core/chat/type.d';
import { customAlphabet } from 'nanoid';
const nanoid = customAlphabet(
'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWSYZ1234567890_',
24
);
type State = {
localUId: string;
teamShareChatHistory: (ChatHistoryItemType & { delete?: boolean })[];
clearLocalHistory: (shareId?: string) => void;
};
export const useTeamShareChatStore = create<State>()(
devtools(
persist(
immer((set, get) => ({
localUId: `shareChat-${Date.now()}-${nanoid()}`,
teamShareChatHistory: [], // old version field
clearLocalHistory() {
// abandon
set((state) => {
state.teamShareChatHistory = state.teamShareChatHistory.map((item) => ({
...item,
delete: true
}));
});
}
})),
{
name: 'shareChatStore',
partialize: (state) => ({
localUId: state.localUId,
shareChatHistory: state.teamShareChatHistory
})
}
)
)
);

View File

@@ -12,7 +12,7 @@ import {
import { defaultDatasetDetail } from '@/constants/dataset';
import type { DatasetUpdateBody } from '@fastgpt/global/core/dataset/api.d';
import { DatasetStatusEnum } from '@fastgpt/global/core/dataset/constants';
import { postCreateTrainingUsage } from '@/web/support/wallet/usage/api';
import { postCreateTrainingBill } from '@/web/support/wallet/bill/api';
import { checkTeamWebSyncLimit } from '@/web/support/user/team/api';
type State = {
@@ -89,17 +89,19 @@ export const useDatasetStore = create<State>()(
async startWebsiteSync() {
await checkTeamWebSyncLimit();
const billId = await postCreateTrainingUsage({
name: 'core.dataset.training.Website Sync',
datasetId: get().datasetDetail._id
});
return postWebsiteSync({ datasetId: get().datasetDetail._id, billId }).then(() => {
const [_, billId] = await Promise.all([
get().updateDataset({
id: get().datasetDetail._id,
status: DatasetStatusEnum.syncing
});
});
}),
postCreateTrainingBill({
name: 'core.dataset.training.Website Sync',
datasetId: get().datasetDetail._id
})
]);
try {
postWebsiteSync({ datasetId: get().datasetDetail._id, billId });
} catch (error) {}
}
})),
{

View File

@@ -68,6 +68,12 @@ export async function chunksUpload({
});
}
// add chunk index
chunks = chunks.map((chunk) => ({
...chunk,
chunkIndex: chunk.chunkIndex
}));
let successInsert = 0;
let retryTimes = 10;
for (let i = 0; i < chunks.length; i += rate) {

View File

@@ -13,7 +13,7 @@ import { RunAppModule } from '@fastgpt/global/core/module/template/system/runApp
import { PluginInputModule } from '@fastgpt/global/core/module/template/system/pluginInput';
import { PluginOutputModule } from '@fastgpt/global/core/module/template/system/pluginOutput';
import { RunPluginModule } from '@fastgpt/global/core/module/template/system/runPlugin';
import { AiQueryExtension } from '@fastgpt/global/core/module/template/system/queryExtension';
import { AiCFR } from '@fastgpt/global/core/module/template/system/coreferenceResolution';
import type {
FlowModuleTemplateType,
@@ -31,8 +31,7 @@ export const appSystemModuleTemplates: FlowModuleTemplateType[] = [
RunAppModule,
ClassifyQuestionModule,
ContextExtractModule,
HttpModule468,
AiQueryExtension
HttpModule468
];
export const pluginSystemModuleTemplates: FlowModuleTemplateType[] = [
PluginInputModule,
@@ -44,8 +43,7 @@ export const pluginSystemModuleTemplates: FlowModuleTemplateType[] = [
RunAppModule,
ClassifyQuestionModule,
ContextExtractModule,
HttpModule468,
AiQueryExtension
HttpModule468
];
export const moduleTemplatesFlat: FlowModuleTemplateType[] = [
@@ -63,7 +61,7 @@ export const moduleTemplatesFlat: FlowModuleTemplateType[] = [
PluginInputModule,
PluginOutputModule,
RunPluginModule,
AiQueryExtension
AiCFR
];
export const moduleTemplatesList: moduleTemplateListType = [