Feat: Delete useless knowledge base, chat, and search files. #10427 (#11568)

### What problem does this PR solve?

Feat: Delete useless knowledge base, chat, and search files.  #10427
### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2025-11-27 17:54:27 +08:00
committed by GitHub
parent c71d25f744
commit 89d82ff031
171 changed files with 161 additions and 11112 deletions

View File

@ -1,4 +1,3 @@
import { IConversation, IReference, Message } from '@/interfaces/database/chat';
import { FormInstance } from 'antd';
export interface ISegmentedContentProps {
@ -22,12 +21,3 @@ export interface VariableTableDataType {
}
export type IPromptConfigParameters = Omit<VariableTableDataType, 'variable'>;
export interface IMessage extends Message {
id: string;
reference?: IReference; // the latest news has reference
}
export interface IClientConversation extends IConversation {
message: IMessage[];
}

View File

@ -10,13 +10,12 @@ import {
useFetchConversation,
useGetChatSearchParams,
} from '@/hooks/use-chat-request';
import { Message } from '@/interfaces/database/chat';
import { IMessage, Message } from '@/interfaces/database/chat';
import api from '@/utils/api';
import { trim } from 'lodash';
import { useCallback, useEffect } from 'react';
import { useParams } from 'umi';
import { v4 as uuid } from 'uuid';
import { IMessage } from '../chat/interface';
import { useFindPrologueFromDialogList } from './use-select-conversation-list';
import { useSetChatRouteParams } from './use-set-chat-route';
import { useSetConversation } from './use-set-conversation';

View File

@ -5,13 +5,12 @@ import {
useSendMessageWithSse,
} from '@/hooks/logic-hooks';
import { useGetChatSearchParams } from '@/hooks/use-chat-request';
import { IAnswer, Message } from '@/interfaces/database/chat';
import { IAnswer, IMessage, Message } from '@/interfaces/database/chat';
import api from '@/utils/api';
import { buildMessageUuid } from '@/utils/chat';
import { trim } from 'lodash';
import { useCallback, useEffect, useState } from 'react';
import { v4 as uuid } from 'uuid';
import { IMessage } from '../chat/interface';
import { useBuildFormRefs } from './use-build-form-refs';
import { useUploadFile } from './use-upload-file';

View File

@ -8,9 +8,9 @@ import { useFetchNextConversationSSE } from '@/hooks/chat-hooks';
import { useFetchFlowSSE } from '@/hooks/flow-hooks';
import { useFetchExternalChatInfo } from '@/hooks/use-chat-request';
import i18n from '@/locales/config';
import { useSendButtonDisabled } from '@/pages/chat/hooks';
import { buildMessageUuidWithRole } from '@/utils/chat';
import React, { forwardRef, useMemo } from 'react';
import { useSendButtonDisabled } from '../hooks/use-button-disabled';
import {
useGetSharedChatSearchParams,
useSendSharedMessage,

View File

@ -1,7 +1,10 @@
import { EmptyConversationId, MessageType } from '@/constants/chat';
import { IConversation, IReference } from '@/interfaces/database/chat';
import {
IConversation,
IMessage,
IReference,
} from '@/interfaces/database/chat';
import { isEmpty } from 'lodash';
import { IMessage } from '../chat/interface';
export const isConversationIdExist = (conversationId: string) => {
return conversationId !== EmptyConversationId && conversationId !== '';
@ -40,13 +43,3 @@ export const buildMessageItemReference = (
return reference ?? { doc_aggs: [], chunks: [], total: 0 };
};
const oldReg = /(#{2}\d+\${2})/g;
export const currentReg = /\[ID:(\d+)\]/g;
// To be compatible with the old index matching mode
export const replaceTextByOldReg = (text: string) => {
return text?.replace(oldReg, (substring: string) => {
return `[ID:${substring.slice(2, -2)}]`;
});
};