diff --git a/web/app/components/datasets/hit-testing/components/chunk-detail-modal.tsx b/web/app/components/datasets/hit-testing/components/chunk-detail-modal.tsx index 4fd62bb22d..71c5edb21a 100644 --- a/web/app/components/datasets/hit-testing/components/chunk-detail-modal.tsx +++ b/web/app/components/datasets/hit-testing/components/chunk-detail-modal.tsx @@ -27,10 +27,11 @@ const ChunkDetailModal: FC = ({ }) => { const { t } = useTranslation() const { segment, score, child_chunks } = payload - const { position, content, sign_content, keywords, document } = segment + const { position, content, sign_content, keywords, document, answer } = segment const isParentChildRetrieval = !!(child_chunks && child_chunks.length > 0) const extension = document.name.split('.').slice(-1)[0] as FileAppearanceTypeEnum const heighClassName = isParentChildRetrieval ? 'h-[min(627px,_80vh)] overflow-y-auto' : 'h-[min(539px,_80vh)] overflow-y-auto' + const labelPrefix = isParentChildRetrieval ? t('datasetDocuments.segment.parentChunk') : t('datasetDocuments.segment.chunk') return ( = ({
@@ -57,11 +58,29 @@ const ChunkDetailModal: FC = ({
- + {!answer && ( + + )} + {answer && ( +
+
+
Q
+
+ {content} +
+
+
+
A
+
+ {answer} +
+
+
+ )} {!isParentChildRetrieval && keywords && keywords.length > 0 && (
{t(`${i18nPrefix}.keyword`)}
diff --git a/web/models/datasets.ts b/web/models/datasets.ts index 12ea4972ca..bc00bf3f78 100644 --- a/web/models/datasets.ts +++ b/web/models/datasets.ts @@ -545,6 +545,7 @@ export type Segment = { keywords: string[] hit_count: number index_node_hash: string + answer: string } export type Document = {