Skip to main content

@nuclia/core / Exports

@nuclia/core

Table of contents

Namespaces

Enumerations

Classes

Interfaces

Type Aliases

Variables

Functions

Type Aliases

AccountRoles

Ƭ AccountRoles: "AOWNER" | "AMEMBER"

Defined in

libs/sdk-core/src/lib/models.ts:256


AccountTypes

Ƭ AccountTypes: "stash-trial" | "v3starter" | "v3fly" | "v3growth" | "v3enterprise" | "stash-basic" | "stash-team" | "stash-startup" | "stash-starter" | "stash-growth" | "stash-enterprise" | "stash-developer" | "stash-business"

Defined in

libs/sdk-core/src/lib/db/db.models.ts:1


Answer

Ƭ Answer: Question

Defined in

libs/sdk-core/src/lib/db/resource/resource.models.ts:331


ApplyOption

Ƭ ApplyOption: "ALL" | "EXISTING" | "NEW"

Defined in

libs/sdk-core/src/lib/db/task/task.models.ts:2


DownloadFormat

Ƭ DownloadFormat: "application/x-ndjson" | "text/csv"

Defined in

libs/sdk-core/src/lib/db/kb/activity/activity.models.ts:68


Event

Ƭ Event: Object

Index signature

▪ [key: string]: any

Defined in

libs/sdk-core/src/lib/db/kb/kb.models.ts:405


Filter

Ƭ Filter: { [operator in FilterOperator]?: string[] }

Defined in

libs/sdk-core/src/lib/db/search/search.models.ts:36


KBRoles

Ƭ KBRoles: "SOWNER" | "SCONTRIBUTOR" | "SMEMBER"

Defined in

libs/sdk-core/src/lib/db/kb/kb.models.ts:13


KBStates

Ƭ KBStates: "PUBLISHED" | "PRIVATE"

Defined in

libs/sdk-core/src/lib/db/kb/kb.models.ts:12


Language

Ƭ Language: "CA" | "ES" | "EN"

Defined in

libs/sdk-core/src/lib/db/db.models.ts:210


LearningConfigurationSet

Ƭ LearningConfigurationSet: { data: LearningConfiguration ; id: string }[]

Defined in

libs/sdk-core/src/lib/db/db.models.ts:294


NotificationOperation

Ƭ NotificationOperation: "created" | "modified" | "deleted"

Defined in

libs/sdk-core/src/lib/db/notifications/notification.models.ts:2


NotificationType

Ƭ NotificationType: "resource_written" | "resource_processed" | "resource_indexed"

Defined in

libs/sdk-core/src/lib/db/notifications/notification.models.ts:1


NucliaDBRole

Ƭ NucliaDBRole: "READER" | "WRITER" | "MANAGER"

Defined in

libs/sdk-core/src/lib/auth/auth.models.ts:6


NullableUploadLimits

Ƭ NullableUploadLimits: { [key in UploadLimitsEntries]: number | null }

Defined in

libs/sdk-core/src/lib/db/db.models.ts:52


NullableUsageLimits

Ƭ NullableUsageLimits: { [key in UsageLimitsEntries]: number | null }

Defined in

libs/sdk-core/src/lib/db/db.models.ts:67


PINECONE_REGIONS

Ƭ PINECONE_REGIONS: "aws_us_east_1" | "aws_us_west_2" | "aws_eu_west_1" | "gcp_us_central1" | "azure_eastus2"

Defined in

libs/sdk-core/src/lib/db/kb/kb.models.ts:243


PromiseMapper

Ƭ PromiseMapper<T>: { [K in keyof T]: T[K] extends Function ? Function : T[K] }

Type parameters

Name
T

Defined in

libs/sdk-core/src/lib/models.ts:245


RAGImageStrategy

Ƭ RAGImageStrategy: PageImageStrategy | ParagraphImageStrategy

Defined in

libs/sdk-core/src/lib/db/kb/kb.models.ts:379


RAGStrategy

Ƭ RAGStrategy: FieldExtensionStrategy | FullResourceStrategy | HierarchyStrategy | MetadatasStrategy | NeighbouringParagraphsStrategy | PrequeriesStrategy | ConversationalStrategy

Defined in

libs/sdk-core/src/lib/db/kb/kb.models.ts:359


RelationEntityType

Ƭ RelationEntityType: "entity" | "label" | "resource" | "user"

Defined in

libs/sdk-core/src/lib/db/resource/resource.models.ts:81


RelationType

Ƭ RelationType: "ABOUT" | "CHILD" | "COLAB" | "ENTITY" | "OTHER" | "SYNONYM"

Defined in

libs/sdk-core/src/lib/db/resource/resource.models.ts:80


RemiAnswerStatus

Ƭ RemiAnswerStatus: "SUCCESS" | "ERROR" | "NO_CONTEXT"

NO_CONTEXT means there was no answer to the query

Defined in

libs/sdk-core/src/lib/db/kb/activity/activity.models.ts:38


ResourceData

Ƭ ResourceData: Object

Type declaration

NameType
conversations?{ [key: string]: ConversationFieldData; }
files?{ [key: string]: FileFieldData; }
links?{ [key: string]: LinkFieldData; }
texts?{ [key: string]: TextFieldData; }

Defined in

libs/sdk-core/src/lib/db/resource/resource.models.ts:25


ResourceProcessingNotification

Ƭ ResourceProcessingNotification: ResourceBaseNotification

Defined in

libs/sdk-core/src/lib/db/kb/kb.models.ts:471


ResourceStatus

Ƭ ResourceStatus: "PENDING" | "PROCESSED" | "ERROR"

Defined in

libs/sdk-core/src/lib/db/search/search.models.ts:13


SortOrder

Ƭ SortOrder: "asc" | "desc"

Defined in

libs/sdk-core/src/lib/db/search/search.models.ts:15


TaskName

Ƭ TaskName: "labeler" | "llm-graph" | "synthetic-questions" | "ask" | "llama-guard" | "prompt-guard"

Defined in

libs/sdk-core/src/lib/db/task/task.models.ts:1


TextFieldFormat

Ƭ TextFieldFormat: TextFormat | "JSON"

Defined in

libs/sdk-core/src/lib/db/resource/resource.models.ts:249


TextFormat

Ƭ TextFormat: "PLAIN" | "MARKDOWN" | "KEEP_MARKDOWN" | "HTML" | "RST"

Defined in

libs/sdk-core/src/lib/db/resource/resource.models.ts:247


TypeParagraph

Ƭ TypeParagraph: "TEXT" | "OCR" | "INCEPTION" | "DESCRIPTION" | "TRANSCRIPT" | "TABLE"

Defined in

libs/sdk-core/src/lib/db/resource/resource.models.ts:377


UploadLimits

Ƭ UploadLimits: { [key in UploadLimitsEntries]: number }

Defined in

libs/sdk-core/src/lib/db/db.models.ts:51


UploadLimitsEntries

Ƭ UploadLimitsEntries: "upload_limit_max_media_file_size" | "upload_limit_max_non_media_file_size"

Defined in

libs/sdk-core/src/lib/db/db.models.ts:50


UsageAggregation

Ƭ UsageAggregation: "hour" | "day" | "week" | "month" | "quarter" | "year" | "millennium"

Defined in

libs/sdk-core/src/lib/db/db.models.ts:119


UsageLimits

Ƭ UsageLimits: { [key in UsageLimitsEntries]: number }

Defined in

libs/sdk-core/src/lib/db/db.models.ts:66


UsageLimitsEntries

Ƭ UsageLimitsEntries: "monthly_limit_docs_no_media_processed" | "monthly_limit_hosted_answers_generated" | "monthly_limit_hosted_searches_performed" | "monthly_limit_media_seconds_processed" | "monthly_limit_paragraphs_processed" | "monthly_limit_paragraphs_stored" | "monthly_limit_self_hosted_answers_generated" | "monthly_limit_self_hosted_searches_performed" | "storage_limit_max_bytes_per_kb" | "storage_limit_max_resources_per_kb"

Defined in

libs/sdk-core/src/lib/db/db.models.ts:54


UserType

Ƭ UserType: "ROOT" | "DEALER" | "USER"

Defined in

libs/sdk-core/src/lib/db/db.models.ts:209


WidgetFeedback

Ƭ WidgetFeedback: "none" | "answer" | "answerAndResults"

Defined in

libs/sdk-core/src/lib/db/search/utils.ts:119

Variables

ABORT_STREAMING_REASON

Const ABORT_STREAMING_REASON: "Stop listening to streaming"

Defined in

libs/sdk-core/src/lib/rest/rest.ts:6


DEFAULT_NER_KEY

Const DEFAULT_NER_KEY: "processor"

Defined in

libs/sdk-core/src/lib/db/resource/resource.models.ts:333


LABEL_FILTER_PREFIX

Const LABEL_FILTER_PREFIX: "classification.labels"

Defined in

libs/sdk-core/src/lib/db/search/filter.ts:3


NER_FILTER_PREFIX

Const NER_FILTER_PREFIX: "entities"

Defined in

libs/sdk-core/src/lib/db/search/filter.ts:4


NUA_KEY

Const NUA_KEY: "NUCLIA_NUA_KEY"

Defined in

libs/sdk-core/src/lib/db/db.models.ts:18


SUMMARY_PROMPT

Const SUMMARY_PROMPT: "summary_prompt"

Defined in

libs/sdk-core/src/lib/db/db.models.ts:274


USER_PROMPTS

Const USER_PROMPTS: "user_prompts"

Defined in

libs/sdk-core/src/lib/db/db.models.ts:273

Functions

TUSuploadFile

TUSuploadFile(nuclia, path, buffer, metadata?, creationPayload?, maxWaitOn429?): Observable<UploadResponse>

Parameters

NameTypeDefault value
nucliaINucliaundefined
pathstringundefined
bufferArrayBufferundefined
metadata?FileMetadataundefined
creationPayload?ICreateResourceundefined
maxWaitOn429number30000

Returns

Observable<UploadResponse>

Defined in

libs/sdk-core/src/lib/db/upload.ts:150


ask

ask(nuclia, kbid, path, query, context?, features?, options?): Observable<Answer | IErrorResponse>

Parameters

NameTypeDefault value
nucliaINucliaundefined
kbidstringundefined
pathstringundefined
querystringundefined
contextContextEntry[][]
featuresFeatures[]undefined
optionsChatOptions{}

Returns

Observable<Answer | IErrorResponse>

Defined in

libs/sdk-core/src/lib/db/search/ask.ts:8


batchUpload

batchUpload(nuclia, path, files, isResource?): Observable<UploadStatus>

Parameters

NameTypeDefault value
nucliaINucliaundefined
pathstringundefined
filesFileList | File[] | FileWithMetadata[]undefined
isResourcebooleanfalse

Returns

Observable<UploadStatus>

Defined in

libs/sdk-core/src/lib/db/upload.ts:244


catalog

catalog(nuclia, kbid, query, options?, useGet?): Observable<Results | IErrorResponse>

Parameters

NameType
nucliaINuclia
kbidstring
querystring
options?CatalogOptions
useGet?boolean

Returns

Observable<Results | IErrorResponse>

Defined in

libs/sdk-core/src/lib/db/search/search.ts:112


deDuplicateList

deDuplicateList(a): any[]

Parameters

NameType
aany[]

Returns

any[]

Defined in

libs/sdk-core/src/lib/db/resource/resource.helpers.ts:4


evaluateExpression

evaluateExpression<T>(expression, context): T | undefined

Type parameters

Name
T

Parameters

NameType
expressionstring
contextany

Returns

T | undefined

Defined in

libs/sdk-core/src/lib/db/search/agentic.ts:473


find

find(nuclia, kbid, path, query, features?, options?, useGet?): Observable<FindResults | IErrorResponse>

Parameters

NameTypeDefault value
nucliaINucliaundefined
kbidstringundefined
pathstringundefined
querystringundefined
features(Features | ResourceFeatures)[][]
options?SearchOptionsundefined
useGet?booleanundefined

Returns

Observable<FindResults | IErrorResponse>

Defined in

libs/sdk-core/src/lib/db/search/search.ts:6


format

format(expression, context, skipMissing?): string | undefined

Parameters

NameTypeDefault value
expressionstringundefined
contextanyundefined
skipMissingbooleantrue

Returns

string | undefined

Defined in

libs/sdk-core/src/lib/db/search/agentic.ts:426


formatObject

formatObject(obj, context): any

Parameters

NameType
objany
contextany

Returns

any

Defined in

libs/sdk-core/src/lib/db/search/agentic.ts:447


getAllNotifications

getAllNotifications(nuclia, path, controller): Observable<NotificationMessage[]>

Parameters

NameType
nucliaINuclia
pathstring
controllerAbortController

Returns

Observable<NotificationMessage[]>

Defined in

libs/sdk-core/src/lib/db/notifications/notifications.ts:5


getDataKeyFromFieldType

getDataKeyFromFieldType(fieldType): null | keyof ResourceData

Currently in our models, there are more FIELD_TYPEs than ResourceData keys, so we need the switch for typing reason

Parameters

NameType
fieldTypeFIELD_TYPE

Returns

null | keyof ResourceData

Defined in

libs/sdk-core/src/lib/db/resource/resource.mapper.ts:7


getEntityFromFilter

getEntityFromFilter(filter): Object

Parameters

NameType
filterstring

Returns

Object

NameType
entitystring
familystring

Defined in

libs/sdk-core/src/lib/db/search/filter.ts:27


getFieldTypeFromString

getFieldTypeFromString(type): FIELD_TYPE | null

Parameters

NameType
typestring

Returns

FIELD_TYPE | null

Defined in

libs/sdk-core/src/lib/db/resource/resource.mapper.ts:40


getFileMetadata

getFileMetadata(metadata): Object

Parameters

NameType
metadataundefined | FileMetadata

Returns

Object

Defined in

libs/sdk-core/src/lib/db/upload.ts:327


getFilterFromEntity

getFilterFromEntity(entity): string

Parameters

NameType
entityObject
entity.entitystring
entity.familystring

Returns

string

Defined in

libs/sdk-core/src/lib/db/search/filter.ts:23


getFilterFromLabel

getFilterFromLabel(label): string

Parameters

NameType
labelClassification

Returns

string

Defined in

libs/sdk-core/src/lib/db/search/filter.ts:6


getFilterFromLabelSet

getFilterFromLabelSet(labelSet): string

Parameters

NameType
labelSetstring

Returns

string

Defined in

libs/sdk-core/src/lib/db/search/filter.ts:15


getLabelFromFilter

getLabelFromFilter(filter): Classification

Parameters

NameType
filterstring

Returns

Classification

Defined in

libs/sdk-core/src/lib/db/search/filter.ts:10


getLabelSetFromFilter

getLabelSetFromFilter(filter): string

Parameters

NameType
filterstring

Returns

string

Defined in

libs/sdk-core/src/lib/db/search/filter.ts:19


getObjectValue

getObjectValue(obj, path): any

Parameters

NameType
objobject
pathstring

Returns

any

Defined in

libs/sdk-core/src/lib/db/search/agentic.ts:377


getRAGImageStrategies

getRAGImageStrategies(ragImageStrategies): RAGImageStrategy[]

Parameters

NameType
ragImageStrategiesstring

Returns

RAGImageStrategy[]

Defined in

libs/sdk-core/src/lib/db/search/utils.ts:59


getRAGStrategies

getRAGStrategies(ragStrategies): RAGStrategy[]

Parameters

NameType
ragStrategiesstring

Returns

RAGStrategy[]

Defined in

libs/sdk-core/src/lib/db/search/utils.ts:3


lengthUnicode

lengthUnicode(str): number

Parameters

NameType
strundefined | string

Returns

number

Defined in

libs/sdk-core/src/lib/db/resource/resource.helpers.ts:72


longToShortFieldType

longToShortFieldType(fieldType): SHORT_FIELD_TYPE

Parameters

NameType
fieldTypeFIELD_TYPE

Returns

SHORT_FIELD_TYPE

Defined in

libs/sdk-core/src/lib/db/resource/resource.mapper.ts:19


normalizeSchemaProperty

normalizeSchemaProperty(config): LearningConfigurations

Parameters

NameType
configLearningConfigurations

Returns

LearningConfigurations

Defined in

libs/sdk-core/src/lib/db/db.models.ts:261


retry429Config

retry429Config(maxWaitOn429?): RetryConfig

Parameters

NameTypeDefault value
maxWaitOn429number30000

Returns

RetryConfig

Defined in

libs/sdk-core/src/lib/db/resource/resource.helpers.ts:79


search(nuclia, kbid, path, query, features?, options?, useGet?): Observable<Results | IErrorResponse>

Parameters

NameTypeDefault value
nucliaINucliaundefined
kbidstringundefined
pathstringundefined
querystringundefined
featuresFeatures[] | ResourceFeatures[][]
options?SearchOptionsundefined
useGet?booleanundefined

Returns

Observable<Results | IErrorResponse>

Defined in

libs/sdk-core/src/lib/db/search/search.ts:84


setLabels

setLabels(fieldId, fieldType, paragraphId, labels, allEntries): UserFieldMetadata[]

Parameters

NameType
fieldIdstring
fieldTypestring
paragraphIdstring
labelsClassification[]
allEntriesUserFieldMetadata[]

Returns

UserFieldMetadata[]

Defined in

libs/sdk-core/src/lib/db/resource/resource.helpers.ts:8


shortToLongFieldType

shortToLongFieldType(shortType): FIELD_TYPE | null

Parameters

NameType
shortTypeSHORT_FIELD_TYPE

Returns

FIELD_TYPE | null

Defined in

libs/sdk-core/src/lib/db/resource/resource.mapper.ts:23


sliceUnicode

sliceUnicode(str, start?, end?): string

Parameters

NameType
strundefined | string | string[]
start?number
end?number

Returns

string

Defined in

libs/sdk-core/src/lib/db/resource/resource.helpers.ts:58


suggest

suggest(nuclia, kbid, path, query, inTitleOnly, features): Observable<Suggestions | IErrorResponse>

Parameters

NameType
nucliaINuclia
kbidstring
pathstring
querystring
inTitleOnlyboolean
featuresSuggestionFeatures[]

Returns

Observable<Suggestions | IErrorResponse>

Defined in

libs/sdk-core/src/lib/db/search/search.ts:123


upload

upload(nuclia, path, data, TUS, metadata?): Observable<UploadResponse>

Parameters

NameType
nucliaINuclia
pathstring
dataFile | FileWithMetadata | ArrayBuffer
TUSboolean
metadataFileMetadata

Returns

Observable<UploadResponse>

Defined in

libs/sdk-core/src/lib/db/upload.ts:79


uploadFile

uploadFile(nuclia, path, buffer, metadata?, maxWaitOn429?): Observable<UploadResponse>

Parameters

NameTypeDefault value
nucliaINucliaundefined
pathstringundefined
bufferArrayBufferundefined
metadata?FileMetadataundefined
maxWaitOn429number30000

Returns

Observable<UploadResponse>

Defined in

libs/sdk-core/src/lib/db/upload.ts:107


uploadToProcess

uploadToProcess(nuclia, nuaKey, file, metadata?): Observable<string>

Parameters

NameType
nucliaINuclia
nuaKeystring
fileFile
metadata?FileMetadata

Returns

Observable<string>

Defined in

libs/sdk-core/src/lib/db/upload.ts:313