Skip to content

Commit

Permalink
feat: add new table kb doc type (COR-1183) (#505)
Browse files Browse the repository at this point in the history
### Brief description. What is this change?

Add new _**table**_ kb doc type and new _**KnowledgeBaseTable**_ data object
  • Loading branch information
abuyak-vf committed Mar 11, 2024
1 parent 14334e3 commit a0bcf90
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions packages/base-types/src/models/project/knowledgeBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export enum KnowledgeBaseDocumentType {
TEXT = 'text',
URL = 'url',
DOCX = 'docx',
TABLE = 'table',
}

export enum KnowledgeBaseDocumentRefreshRate {
Expand Down Expand Up @@ -42,23 +43,19 @@ export interface KnowledgeBaseData {

export interface KnowledgeBasePDF extends KnowledgeBaseData {
type: KnowledgeBaseDocumentType.PDF;
name: string;
}

export interface KnowledgeBaseDocx extends KnowledgeBaseData {
type: KnowledgeBaseDocumentType.DOCX;
name: string;
}

export interface KnowledgeBaseText extends KnowledgeBaseData {
type: KnowledgeBaseDocumentType.TEXT;
name: string;
canEdit?: boolean;
}

export interface KnowledgeBaseURL extends KnowledgeBaseData {
type: KnowledgeBaseDocumentType.URL;
name: string;
url: string;
refreshRate?: KnowledgeBaseDocumentRefreshRate;
lastSuccessUpdate?: string;
Expand All @@ -69,6 +66,11 @@ export interface KnowledgeBaseURL extends KnowledgeBaseData {
source?: IntegrationTypes; // type of integration
}

export interface KnowledgeBaseTable extends KnowledgeBaseData {
type: KnowledgeBaseDocumentType.TABLE;
rowsCount: number;
}

export enum KnowledgeBaseDocumentStatus {
ERROR = 'ERROR',
SUCCESS = 'SUCCESS',
Expand All @@ -82,7 +84,7 @@ export interface KBTag {
}

export interface KnowledgeBaseDocument {
data: KnowledgeBasePDF | KnowledgeBaseText | KnowledgeBaseURL | KnowledgeBaseDocx;
data: KnowledgeBasePDF | KnowledgeBaseText | KnowledgeBaseURL | KnowledgeBaseDocx | KnowledgeBaseTable;
status: {
type: KnowledgeBaseDocumentStatus;
data?: unknown;
Expand Down

0 comments on commit a0bcf90

Please sign in to comment.