Class: BaseNode
Generic abstract class for retrievable nodes
Hierarchy
BaseNode
↳
TextNode
Constructors
constructor
• new BaseNode(init?
)
Parameters
Name | Type |
---|---|
init? | Partial <BaseNode > |
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: Record
<string
, any
> = {}
Defined in
relationships
• relationships: Partial
<Record
<NodeRelationship
, RelatedNodeType
>> = {}
Defined in
Accessors
childNodes
• get
childNodes(): undefined
| RelatedNodeInfo
[]
Returns
undefined
| RelatedNodeInfo
[]
Defined in
nextNode
• get
nextNode(): undefined
| RelatedNodeInfo
Returns
undefined
| RelatedNodeInfo
Defined in
parentNode
• get
parentNode(): undefined
| RelatedNodeInfo
Returns
undefined
| RelatedNodeInfo
Defined in
prevNode
• get
prevNode(): undefined
| RelatedNodeInfo
Returns
undefined
| RelatedNodeInfo
Defined in
sourceNode
• get
sourceNode(): undefined
| RelatedNodeInfo
Returns
undefined
| RelatedNodeInfo
Defined in
Methods
asRelatedNodeInfo
▸ asRelatedNodeInfo(): RelatedNodeInfo
Returns
Defined in
generateHash
▸ Abstract
generateHash(): string
Returns
string
Defined in
getContent
▸ Abstract
getContent(metadataMode
): string
Parameters
Name | Type |
---|---|
metadataMode | MetadataMode |
Returns
string
Defined in
getEmbedding
▸ getEmbedding(): number
[]
Returns
number
[]
Defined in
getMetadataStr
▸ Abstract
getMetadataStr(metadataMode
): string
Parameters
Name | Type |
---|---|
metadataMode | MetadataMode |
Returns
string
Defined in
getType
▸ Abstract
getType(): ObjectType
Returns
Defined in
setContent
▸ Abstract
setContent(value
): void
Parameters
Name | Type |
---|---|
value | any |
Returns
void
Defined in
toJSON
▸ toJSON(): Record
<string
, any
>
Used with built in JSON.stringify
Returns
Record
<string
, any
>