Class: BaseNode<T>
Generic abstract class for retrievable nodes
Type parameters
Name | Type |
---|---|
T | extends Metadata = Metadata |
Hierarchy
-
BaseNode
↳
TextNode
Constructors
constructor
• new BaseNode<T
>(init?
): BaseNode
<T
>
Type parameters
Name | Type |
---|---|
T | extends Metadata = Metadata |
Parameters
Name | Type |
---|---|
init? | Partial <BaseNode <T >> |
Returns
BaseNode
<T
>
Defined in
Properties
embedding
• Optional
embedding: number
[]
Defined in
excludedEmbedMetadataKeys
• excludedEmbedMetadataKeys: string
[] = []
Defined in
excludedLlmMetadataKeys
• excludedLlmMetadataKeys: string
[] = []
Defined in
hash
• hash: string
= ""
Defined in
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
metadata
• metadata: T
Defined in
relationships
• relationships: Partial
<Record
<NodeRelationship
, RelatedNodeType
<T
>>> = {}
Defined in
Accessors
childNodes
• get
childNodes(): undefined
| RelatedNodeInfo
<T
>[]
Returns
undefined
| RelatedNodeInfo
<T
>[]
Defined in
nextNode
• get
nextNode(): undefined
| RelatedNodeInfo
<T
>
Returns
undefined
| RelatedNodeInfo
<T
>
Defined in
parentNode
• get
parentNode(): undefined
| RelatedNodeInfo
<T
>
Returns
undefined
| RelatedNodeInfo
<T
>
Defined in
prevNode
• get
prevNode(): undefined
| RelatedNodeInfo
<T
>
Returns
undefined
| RelatedNodeInfo
<T
>
Defined in
sourceNode
• get
sourceNode(): undefined
| RelatedNodeInfo
<T
>
Returns
undefined
| RelatedNodeInfo
<T
>
Defined in
Methods
asRelatedNodeInfo
▸ asRelatedNodeInfo(): RelatedNodeInfo
<T
>
Returns
Defined in
clone
Returns
Defined in
generateHash
▸ generateHash(): string
Returns
string
Defined in
getContent
▸ getContent(metadataMode
): string
Parameters
Name | Type |
---|---|
metadataMode | MetadataMode |
Returns
string
Defined in
getEmbedding
▸ getEmbedding(): number
[]
Returns
number
[]
Defined in
getMetadataStr
▸ getMetadataStr(metadataMode
): string
Parameters
Name | Type |
---|---|
metadataMode | MetadataMode |
Returns
string
Defined in
getType
▸ getType(): ObjectType
Returns
Defined in
setContent
▸ setContent(value
): void
Parameters
Name | Type |
---|---|
value | any |
Returns
void
Defined in
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