feat: add DocumentPreviewer for chunk of chat reference and remove duplicate \n from record.progress_msg (#97)

* feat: Remove duplicate \n from record.progress_msg

* feat: add DocumentPreviewer for chunk of chat reference
This commit is contained in:
balibabu
2024-03-05 16:30:28 +08:00
committed by GitHub
parent 8a57f2afd5
commit 07d76ea18d
14 changed files with 333 additions and 104 deletions

View File

@ -1,4 +1,5 @@
import { MessageType } from '@/constants/chat';
import { IChunk } from './knowledge';
export interface PromptConfig {
empty_response: string;
@ -66,7 +67,7 @@ export interface Message {
}
export interface IReference {
chunks: Chunk[];
chunks: IChunk[];
doc_aggs: Docagg[];
total: number;
}
@ -77,16 +78,16 @@ export interface Docagg {
doc_name: string;
}
interface Chunk {
chunk_id: string;
content_ltks: string;
content_with_weight: string;
doc_id: string;
docnm_kwd: string;
img_id: string;
important_kwd: any[];
kb_id: string;
similarity: number;
term_similarity: number;
vector_similarity: number;
}
// interface Chunk {
// chunk_id: string;
// content_ltks: string;
// content_with_weight: string;
// doc_id: string;
// docnm_kwd: string;
// img_id: string;
// important_kwd: any[];
// kb_id: string;
// similarity: number;
// term_similarity: number;
// vector_similarity: number;
// }