mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
### What problem does this PR solve? Feat: Modify the data structure of the chunk in the conversation #3909 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -504,11 +504,17 @@ export const useCreateNextSharedConversation = () => {
|
||||
return { data, loading, createSharedConversation: mutateAsync };
|
||||
};
|
||||
|
||||
export const useFetchNextSharedConversation = (conversationId: string) => {
|
||||
// deprecated
|
||||
export const useFetchNextSharedConversation = (
|
||||
conversationId?: string | null,
|
||||
) => {
|
||||
const { data, isPending: loading } = useQuery({
|
||||
queryKey: ['fetchSharedConversation'],
|
||||
enabled: !!conversationId,
|
||||
queryFn: async () => {
|
||||
if (!conversationId) {
|
||||
return {};
|
||||
}
|
||||
const { data } = await chatService.getExternalConversation(
|
||||
null,
|
||||
conversationId,
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import { IReferenceChunk } from '@/interfaces/database/chat';
|
||||
import { IDocumentInfo } from '@/interfaces/database/document';
|
||||
import { IChunk } from '@/interfaces/database/knowledge';
|
||||
import { IChangeParserConfigRequestBody } from '@/interfaces/request/document';
|
||||
@ -32,7 +33,9 @@ export const useGetDocumentUrl = (documentId?: string) => {
|
||||
return getDocumentUrl;
|
||||
};
|
||||
|
||||
export const useGetChunkHighlights = (selectedChunk: IChunk) => {
|
||||
export const useGetChunkHighlights = (
|
||||
selectedChunk: IChunk | IReferenceChunk,
|
||||
) => {
|
||||
const [size, setSize] = useState({ width: 849, height: 1200 });
|
||||
|
||||
const highlights: IHighlight[] = useMemo(() => {
|
||||
|
||||
@ -12,6 +12,7 @@ import { PaginationProps, message } from 'antd';
|
||||
import { FormInstance } from 'antd/lib';
|
||||
import axios from 'axios';
|
||||
import { EventSourceParserStream } from 'eventsource-parser/stream';
|
||||
import { omit } from 'lodash';
|
||||
import {
|
||||
ChangeEventHandler,
|
||||
useCallback,
|
||||
@ -336,6 +337,7 @@ export const useSelectDerivedMessages = () => {
|
||||
}),
|
||||
prompt: answer.prompt,
|
||||
audio_binary: answer.audio_binary,
|
||||
...omit(answer, 'reference'),
|
||||
},
|
||||
];
|
||||
});
|
||||
|
||||
@ -169,17 +169,34 @@ export const useFetchSystemStatus = () => {
|
||||
};
|
||||
};
|
||||
|
||||
export const useFetchSystemTokenList = (params: Record<string, any>) => {
|
||||
export const useFetchManualSystemTokenList = () => {
|
||||
const {
|
||||
data,
|
||||
isPending: loading,
|
||||
mutateAsync,
|
||||
} = useMutation({
|
||||
mutationKey: ['fetchManualSystemTokenList'],
|
||||
mutationFn: async () => {
|
||||
const { data } = await userService.listToken();
|
||||
|
||||
return data?.data ?? [];
|
||||
},
|
||||
});
|
||||
|
||||
return { data, loading, fetchSystemTokenList: mutateAsync };
|
||||
};
|
||||
|
||||
export const useFetchSystemTokenList = () => {
|
||||
const {
|
||||
data,
|
||||
isFetching: loading,
|
||||
refetch,
|
||||
} = useQuery<IToken[]>({
|
||||
queryKey: ['fetchSystemTokenList', params],
|
||||
queryKey: ['fetchSystemTokenList'],
|
||||
initialData: [],
|
||||
gcTime: 0,
|
||||
queryFn: async () => {
|
||||
const { data } = await userService.listToken(params);
|
||||
const { data } = await userService.listToken();
|
||||
|
||||
return data?.data ?? [];
|
||||
},
|
||||
@ -213,6 +230,7 @@ export const useRemoveSystemToken = () => {
|
||||
|
||||
export const useCreateSystemToken = () => {
|
||||
const queryClient = useQueryClient();
|
||||
|
||||
const {
|
||||
data,
|
||||
isPending: loading,
|
||||
|
||||
Reference in New Issue
Block a user