メインコンテンツまでスキップ

Class: BaseNode<T>

Generic abstract class for retrievable nodes

Type parameters

NameType
Textends Metadata = Metadata

Hierarchy

Constructors

constructor

new BaseNode<T>(init?)

Type parameters

NameType
Textends Metadata = Metadata

Parameters

NameType
init?Partial<BaseNode<T>>

Defined in

packages/core/src/Node.ts:60

Properties

embedding

Optional embedding: number[]

Defined in

packages/core/src/Node.ts:51


excludedEmbedMetadataKeys

excludedEmbedMetadataKeys: string[] = []

Defined in

packages/core/src/Node.ts:55


excludedLlmMetadataKeys

excludedLlmMetadataKeys: string[] = []

Defined in

packages/core/src/Node.ts:56


hash

hash: string = ""

Defined in

packages/core/src/Node.ts:58


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

packages/core/src/Node.ts:50


metadata

metadata: T

Defined in

packages/core/src/Node.ts:54


relationships

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

Defined in

packages/core/src/Node.ts:57

Accessors

childNodes

get childNodes(): undefined | RelatedNodeInfo<T>[]

Returns

undefined | RelatedNodeInfo<T>[]

Defined in

packages/core/src/Node.ts:112


nextNode

get nextNode(): undefined | RelatedNodeInfo<T>

Returns

undefined | RelatedNodeInfo<T>

Defined in

packages/core/src/Node.ts:92


parentNode

get parentNode(): undefined | RelatedNodeInfo<T>

Returns

undefined | RelatedNodeInfo<T>

Defined in

packages/core/src/Node.ts:102


prevNode

get prevNode(): undefined | RelatedNodeInfo<T>

Returns

undefined | RelatedNodeInfo<T>

Defined in

packages/core/src/Node.ts:80


sourceNode

get sourceNode(): undefined | RelatedNodeInfo<T>

Returns

undefined | RelatedNodeInfo<T>

Defined in

packages/core/src/Node.ts:70

Methods

asRelatedNodeInfo

asRelatedNodeInfo(): RelatedNodeInfo<T>

Returns

RelatedNodeInfo<T>

Defined in

packages/core/src/Node.ts:134


generateHash

Abstract generateHash(): string

Returns

string

Defined in

packages/core/src/Node.ts:124


getContent

Abstract getContent(metadataMode): string

Parameters

NameType
metadataModeMetadataMode

Returns

string

Defined in

packages/core/src/Node.ts:66


getEmbedding

getEmbedding(): number[]

Returns

number[]

Defined in

packages/core/src/Node.ts:126


getMetadataStr

Abstract getMetadataStr(metadataMode): string

Parameters

NameType
metadataModeMetadataMode

Returns

string

Defined in

packages/core/src/Node.ts:67


getType

Abstract getType(): ObjectType

Returns

ObjectType

Defined in

packages/core/src/Node.ts:64


setContent

Abstract setContent(value): void

Parameters

NameType
valueany

Returns

void

Defined in

packages/core/src/Node.ts:68


toJSON

toJSON(): Record<string, any>

Used with built in JSON.stringify

Returns

Record<string, any>

Defined in

packages/core/src/Node.ts:146