Skip to content

Commit

Permalink
feat: KB type models add KBTags (NLU-864) (#455)
Browse files Browse the repository at this point in the history
### Brief description. What is this change?

Add `KBTag` to KB models.
  • Loading branch information
abuyak-vf committed Oct 6, 2023
1 parent c9c2430 commit 39cf3f1
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions packages/base-types/src/models/project/knowledgeBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,23 @@ export enum KnowledgeBaseDocumentType {
DOCX = 'docx',
}

export declare enum KnowledgeBaseBooleanOperators {
AND = 'and',
OR = 'or',
}

export interface KnowledgeBaseTagsInclude {
items: string[];
operator?: KnowledgeBaseBooleanOperators;
}

export interface KnowledgeBaseTagsFilter {
include?: KnowledgeBaseTagsInclude;
exclude?: string[];
includeAllTagged?: boolean;
includeAllNonTagged?: boolean;
}

export interface KnowledgeBaseData {
type: KnowledgeBaseDocumentType;
name: string;
Expand Down Expand Up @@ -40,6 +57,11 @@ export enum KnowledgeBaseDocumentStatus {
INITIALIZED = 'INITIALIZED',
}

export interface KBTag {
tagID: string;
label: string;
}

export interface KnowledgeBaseDocument {
data: KnowledgeBasePDF | KnowledgeBaseText | KnowledgeBaseURL | KnowledgeBaseDocx;
status: {
Expand All @@ -51,6 +73,7 @@ export interface KnowledgeBaseDocument {
documentID: string;
s3ObjectRef: string;
version?: number;
tags?: string[];
}

export enum ChunkStrategyType {
Expand All @@ -75,4 +98,5 @@ export interface KnowledgeBaseSettings {
export interface KnowledgeBase {
settings?: KnowledgeBaseSettings;
documents: Record<string, KnowledgeBaseDocument>;
tags?: Record<string, KBTag>;
}

0 comments on commit 39cf3f1

Please sign in to comment.