Feat: Add Tavily Api Key to chat configuration modal. #5198 (#5347)

### What problem does this PR solve?

Feat: Add Tavily Api Key to chat configuration modal. #5198

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2025-02-26 10:20:40 +08:00
committed by GitHub
parent 150ab9c6a4
commit e5e9ca0015
7 changed files with 47 additions and 9 deletions

View File

@ -59,12 +59,22 @@ const MarkdownContent = ({
}, [reference, setDocumentIds]);
const handleDocumentButtonClick = useCallback(
(documentId: string, chunk: IReferenceChunk, isPdf: boolean) => () => {
if (!isPdf) {
return;
}
clickDocumentButton?.(documentId, chunk);
},
(
documentId: string,
chunk: IReferenceChunk,
isPdf: boolean,
documentUrl?: string,
) =>
() => {
if (!isPdf) {
if (!documentUrl) {
return;
}
window.open(documentUrl, '_blank');
} else {
clickDocumentButton?.(documentId, chunk);
}
},
[clickDocumentButton],
);
@ -93,6 +103,7 @@ const MarkdownContent = ({
(x) => x?.doc_id === chunkItem?.document_id,
);
const documentId = document?.doc_id;
const documentUrl = document?.url;
const fileThumbnail = documentId ? fileThumbnails[documentId] : '';
const fileExtension = documentId ? getExtension(document?.doc_name) : '';
const imageId = chunkItem?.image_id;
@ -146,6 +157,7 @@ const MarkdownContent = ({
documentId,
chunkItem,
fileExtension === 'pdf',
documentUrl,
)}
>
{document?.doc_name}