Feat: Modify the data structure of the chunk in the conversation #3909 (#3955)

### 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:
balibabu
2024-12-10 16:36:16 +08:00
committed by GitHub
parent 03f00c9e6f
commit fc4e644e5f
27 changed files with 304 additions and 202 deletions

View File

@ -1,5 +1,4 @@
import { MessageType } from '@/constants/chat';
import { IChunk } from './knowledge';
export interface PromptConfig {
empty_response: string;
@ -35,7 +34,7 @@ export interface IDialog {
description: string;
icon: string;
id: string;
dialog_id?: string;
dialog_id: string;
kb_ids: string[];
kb_names: string[];
language: string;
@ -75,8 +74,21 @@ export interface Message {
audio_binary?: string;
}
export interface IReferenceChunk {
id: string;
content: null;
document_id: string;
document_name: string;
dataset_id: string;
image_id: string;
similarity: number;
vector_similarity: number;
term_similarity: number;
positions: number[];
}
export interface IReference {
chunks: IChunk[];
chunks: IReferenceChunk[];
doc_aggs: Docagg[];
total: number;
}
@ -117,6 +129,7 @@ export interface IToken {
token: string;
update_date?: any;
update_time?: any;
beta: string;
}
export interface IStats {