feat(web): app citation features add allow_download
This commit is contained in:
@@ -272,14 +272,22 @@ const ChatContent: FC<ChatContentProps> = ({
|
||||
<Flex vertical gap={4} className="rb:mt-1! rb:pt-3! rb-border-t rb:mb-2!">
|
||||
<div className="rb:font-medium">{t('memoryConversation.citations')}</div>
|
||||
{item.meta_data?.citations?.map((citation, idx) => (
|
||||
<div
|
||||
key={idx}
|
||||
className="rb:text-[#155EEF] rb:leading-5 rb:underline rb:cursor-pointer"
|
||||
onClick={() => {
|
||||
const params = new URLSearchParams({ documentId: citation.document_id, parentId: citation.knowledge_id });
|
||||
window.open(`/#/knowledge-base/${citation.knowledge_id}/DocumentDetails?${params}`, '_blank');
|
||||
}}
|
||||
>{citation.file_name}</div>
|
||||
<Flex align="center" gap={12}>
|
||||
<div
|
||||
key={idx}
|
||||
className="rb:text-[#155EEF] rb:leading-5 rb:underline rb:cursor-pointer"
|
||||
onClick={() => {
|
||||
const params = new URLSearchParams({ documentId: citation.document_id, parentId: citation.knowledge_id });
|
||||
window.open(`/#/knowledge-base/${citation.knowledge_id}/DocumentDetails?${params}`, '_blank');
|
||||
}}
|
||||
>{citation.file_name}</div>
|
||||
|
||||
{citation.download_url &&
|
||||
<div className="rb:size-4 rb:cursor-pointer rb:bg-cover rb:bg-[url('@/assets/images/application/export.svg')]"
|
||||
onClick={() => handleDownload({ url: citation.download_url })}
|
||||
></div>
|
||||
}
|
||||
</Flex>
|
||||
))}
|
||||
</Flex>
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ export interface ChatItem {
|
||||
subContent?: Record<string, any>[];
|
||||
error?: string;
|
||||
meta_data?: {
|
||||
audio_url?: string;
|
||||
audio_url?: string | null;
|
||||
audio_status?: string;
|
||||
files?: any[];
|
||||
suggested_questions?: string[];
|
||||
@@ -33,6 +33,7 @@ export interface ChatItem {
|
||||
file_name: string;
|
||||
knowledge_id: string;
|
||||
score: string;
|
||||
download_url?: string;
|
||||
}[];
|
||||
reasoning_content?: string;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user