Class: abstract
BaseNode<T>
Generic abstract class for retrievable nodes
Extended by
Type parameters
• T extends Metadata
= Metadata
Constructors
new BaseNode()
new BaseNode<
T
>(init
?):BaseNode
<T
>
Parameters
• init?: Partial
<BaseNode
<T
>>
Returns
BaseNode
<T
>
Source
Properties
embedding?
optional
embedding:number
[]
Source
excludedEmbedMetadataKeys
excludedEmbedMetadataKeys:
string
[] =[]
Source
excludedLlmMetadataKeys
excludedLlmMetadataKeys:
string
[] =[]
Source
hash
hash:
string
=""
Source
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.
Source
metadata
metadata:
T
Source
relationships
relationships:
Partial
<Record
<NodeRelationship
,RelatedNodeType
<T
>>> ={}
Source
Accessors
childNodes
get
childNodes():undefined
|RelatedNodeInfo
<T
>[]
Returns
undefined
| RelatedNodeInfo
<T
>[]
Source
nextNode
get
nextNode():undefined
|RelatedNodeInfo
<T
>
Returns
undefined
| RelatedNodeInfo
<T
>
Source
parentNode
get
parentNode():undefined
|RelatedNodeInfo
<T
>
Returns
undefined
| RelatedNodeInfo
<T
>
Source
prevNode
get
prevNode():undefined
|RelatedNodeInfo
<T
>
Returns
undefined
| RelatedNodeInfo
<T
>
Source
sourceNode
get
sourceNode():undefined
|RelatedNodeInfo
<T
>
Returns
undefined
| RelatedNodeInfo
<T
>
Source
Methods
asRelatedNodeInfo()
asRelatedNodeInfo():
RelatedNodeInfo
<T
>
Returns
Source
clone()
Returns
Source
generateHash()
abstract
generateHash():string
Returns
string
Source
getContent()
abstract
getContent(metadataMode
):string
Parameters
• metadataMode: MetadataMode
Returns
string
Source
getEmbedding()
getEmbedding():
number
[]
Returns
number
[]
Source
getMetadataStr()
abstract
getMetadataStr(metadataMode
):string
Parameters
• metadataMode: MetadataMode
Returns
string
Source
getType()
abstract
getType():ObjectType
Returns
Source
setContent()
abstract
setContent(value
):void
Parameters
• value: unknown
Returns
void
Source
toJSON()
toJSON():
Record
<string
,any
>
Called by built in JSON.stringify (see https://javascript.info/json) Properties are read-only as they are not deep-cloned (not necessary for stringification).
Returns
Record
<string
, any
>
See
toMutableJSON - use to return a mutable JSON instead
Source
toMutableJSON()
toMutableJSON():
Record
<string
,any
>
Converts the object to a JSON representation. Properties can be safely modified as a deep clone of the properties are created.
Returns
Record
<string
, any
>
- The JSON representation of the object.