Ga naar hoofdinhoud

Class: ImageDocument<T>

TextNode is the default node type for text. Most common node type in LlamaIndex.TS

Extends

Type parameters

T extends Metadata = Metadata

Constructors

new ImageDocument()

new ImageDocument<T>(init): ImageDocument<T>

Parameters

init: ImageNodeParams<T>

Returns

ImageDocument<T>

Overrides

ImageNode . constructor

Source

packages/core/src/Node.ts:403

Properties

embedding?

optional embedding: number[]

Inherited from

ImageNode . embedding

Source

packages/core/src/Node.ts:61


endCharIdx?

optional endCharIdx: number

Inherited from

ImageNode . endCharIdx

Source

packages/core/src/Node.ts:214


excludedEmbedMetadataKeys

excludedEmbedMetadataKeys: string[]

Inherited from

ImageNode . excludedEmbedMetadataKeys

Source

packages/core/src/Node.ts:65


excludedLlmMetadataKeys

excludedLlmMetadataKeys: string[]

Inherited from

ImageNode . excludedLlmMetadataKeys

Source

packages/core/src/Node.ts:66


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.

Inherited from

ImageNode . id_

Source

packages/core/src/Node.ts:60


image

image: ImageType

Inherited from

ImageNode . image

Source

packages/core/src/Node.ts:352


metadata

metadata: T

Inherited from

ImageNode . metadata

Source

packages/core/src/Node.ts:64


metadataSeparator

metadataSeparator: string

Inherited from

ImageNode . metadataSeparator

Source

packages/core/src/Node.ts:217


relationships

relationships: Partial<Record <NodeRelationship, RelatedNodeType<T>>>

Inherited from

ImageNode . relationships

Source

packages/core/src/Node.ts:67


startCharIdx?

optional startCharIdx: number

Inherited from

ImageNode . startCharIdx

Source

packages/core/src/Node.ts:213


text

text: string

Inherited from

ImageNode . text

Source

packages/core/src/Node.ts:210


textTemplate

textTemplate: string

Inherited from

ImageNode . textTemplate

Source

packages/core/src/Node.ts:211

Accessors

childNodes

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

Returns

undefined | RelatedNodeInfo<T>[]

Source

packages/core/src/Node.ts:139


hash


nextNode

get nextNode(): undefined | RelatedNodeInfo<T>

Returns

undefined | RelatedNodeInfo<T>

Source

packages/core/src/Node.ts:119


parentNode

get parentNode(): undefined | RelatedNodeInfo<T>

Returns

undefined | RelatedNodeInfo<T>

Source

packages/core/src/Node.ts:129


prevNode

get prevNode(): undefined | RelatedNodeInfo<T>

Returns

undefined | RelatedNodeInfo<T>

Source

packages/core/src/Node.ts:107


sourceNode

get sourceNode(): undefined | RelatedNodeInfo<T>

Returns

undefined | RelatedNodeInfo<T>

Source

packages/core/src/Node.ts:97


type

get type(): ObjectType

Returns

ObjectType

Source

packages/core/src/Node.ts:407

Methods

asRelatedNodeInfo()

asRelatedNodeInfo(): RelatedNodeInfo<T>

Returns

RelatedNodeInfo<T>

Inherited from

ImageNode . asRelatedNodeInfo

Source

packages/core/src/Node.ts:161


clone()

clone(): BaseNode <Metadata>

Returns

BaseNode <Metadata>

Inherited from

ImageNode . clone

Source

packages/core/src/Node.ts:183


generateHash()

generateHash(): string

Generate a hash of the text node. The ID is not part of the hash as it can change independent of content.

Returns

string

Inherited from

ImageNode . generateHash

Source

packages/core/src/Node.ts:392


getContent()

getContent(metadataMode): string

Parameters

metadataMode: MetadataMode= MetadataMode.NONE

Returns

string

Inherited from

ImageNode . getContent

Source

packages/core/src/Node.ts:252


getEmbedding()

getEmbedding(): number[]

Returns

number[]

Inherited from

ImageNode . getEmbedding

Source

packages/core/src/Node.ts:153


getMetadataStr()

getMetadataStr(metadataMode): string

Parameters

metadataMode: MetadataMode

Returns

string

Inherited from

ImageNode . getMetadataStr

Source

packages/core/src/Node.ts:257


getNodeInfo()

getNodeInfo(): object

Returns

object

end

end: undefined | number

start

start: undefined | number

Inherited from

ImageNode . getNodeInfo

Source

packages/core/src/Node.ts:283


getText()

getText(): string

Returns

string

Inherited from

ImageNode . getText

Source

packages/core/src/Node.ts:287


getUrl()

getUrl(): URL

Returns

URL

Inherited from

ImageNode . getUrl

Source

packages/core/src/Node.ts:364


setContent()

setContent(value): void

Parameters

value: string

Returns

void

Inherited from

ImageNode . setContent

Source

packages/core/src/Node.ts:278


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>

Inherited from

ImageNode . toJSON

See

toMutableJSON - use to return a mutable JSON instead

Source

packages/core/src/Node.ts:174


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.

Inherited from

ImageNode . toMutableJSON

Source

packages/core/src/Node.ts:192