Skip to main content

Class: BaseNode

Generic abstract class for retrievable nodes

Hierarchy

Constructors

constructor

new BaseNode(init?)

Parameters

NameType
init?Partial<BaseNode>

Defined in

Node.ts:55

Properties

embedding

Optional embedding: number[]

Defined in

Node.ts:46


excludedEmbedMetadataKeys

excludedEmbedMetadataKeys: string[] = []

Defined in

Node.ts:50


excludedLlmMetadataKeys

excludedLlmMetadataKeys: string[] = []

Defined in

Node.ts:51


hash

hash: string = ""

Defined in

Node.ts:53


id_

id_: string

The unique ID of the Node/Document. The trailing underscore is here to avoid collisions with the id keyword in Python.

Set to a UUID by default.

Defined in

Node.ts:45


metadata

metadata: Record<string, any> = {}

Defined in

Node.ts:49


relationships

relationships: Partial<Record<NodeRelationship, RelatedNodeType>> = {}

Defined in

Node.ts:52

Accessors

childNodes

get childNodes(): undefined | RelatedNodeInfo[]

Returns

undefined | RelatedNodeInfo[]

Defined in

Node.ts:107


nextNode

get nextNode(): undefined | RelatedNodeInfo

Returns

undefined | RelatedNodeInfo

Defined in

Node.ts:87


parentNode

get parentNode(): undefined | RelatedNodeInfo

Returns

undefined | RelatedNodeInfo

Defined in

Node.ts:97


prevNode

get prevNode(): undefined | RelatedNodeInfo

Returns

undefined | RelatedNodeInfo

Defined in

Node.ts:75


sourceNode

get sourceNode(): undefined | RelatedNodeInfo

Returns

undefined | RelatedNodeInfo

Defined in

Node.ts:65

Methods

asRelatedNodeInfo

asRelatedNodeInfo(): RelatedNodeInfo

Returns

RelatedNodeInfo

Defined in

Node.ts:129


generateHash

Abstract generateHash(): string

Returns

string

Defined in

Node.ts:119


getContent

Abstract getContent(metadataMode): string

Parameters

NameType
metadataModeMetadataMode

Returns

string

Defined in

Node.ts:61


getEmbedding

getEmbedding(): number[]

Returns

number[]

Defined in

Node.ts:121


getMetadataStr

Abstract getMetadataStr(metadataMode): string

Parameters

NameType
metadataModeMetadataMode

Returns

string

Defined in

Node.ts:62


getType

Abstract getType(): ObjectType

Returns

ObjectType

Defined in

Node.ts:59


setContent

Abstract setContent(value): void

Parameters

NameType
valueany

Returns

void

Defined in

Node.ts:63


toJSON

toJSON(): Record<string, any>

Used with built in JSON.stringify

Returns

Record<string, any>

Defined in

Node.ts:141