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:
@ -47,9 +47,9 @@ const storage = {
|
||||
};
|
||||
|
||||
export const getAuthorization = () => {
|
||||
const sharedId = getSearchValue('shared_id');
|
||||
const authorization = sharedId
|
||||
? 'Bearer ' + sharedId
|
||||
const auth = getSearchValue('auth');
|
||||
const authorization = auth
|
||||
? 'Bearer ' + auth
|
||||
: storage.getAuthorization() || '';
|
||||
|
||||
return authorization;
|
||||
|
||||
@ -1,10 +1,12 @@
|
||||
import { Images, SupportedPreviewDocumentTypes } from '@/constants/common';
|
||||
import { IReferenceChunk } from '@/interfaces/database/chat';
|
||||
import { IChunk } from '@/interfaces/database/knowledge';
|
||||
import { UploadFile } from 'antd';
|
||||
import { get } from 'lodash';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
|
||||
export const buildChunkHighlights = (
|
||||
selectedChunk: IChunk,
|
||||
selectedChunk: IChunk | IReferenceChunk,
|
||||
size: { width: number; height: number },
|
||||
) => {
|
||||
return Array.isArray(selectedChunk?.positions) &&
|
||||
@ -24,7 +26,11 @@ export const buildChunkHighlights = (
|
||||
text: '',
|
||||
emoji: '',
|
||||
},
|
||||
content: { text: selectedChunk.content_with_weight },
|
||||
content: {
|
||||
text:
|
||||
get(selectedChunk, 'content_with_weight') ||
|
||||
get(selectedChunk, 'content', ''),
|
||||
},
|
||||
position: {
|
||||
boundingRect: boundingRect,
|
||||
rects: [boundingRect],
|
||||
|
||||
Reference in New Issue
Block a user