Interface: TextEmbeddingsType<M>
Defined in: types/textEmbeddings.ts:123
React hook state and methods for a Text Embeddings model instance.
Type Parameters
M
M extends TextEmbeddingsModel = TextEmbeddingsModel
Properties
downloadProgress
downloadProgress:
number
Defined in: types/textEmbeddings.ts:141
Tracks the progress of the model download process (value between 0 and 1).
error
error:
RnExecutorchError|null
Defined in: types/textEmbeddings.ts:129
Contains the error message if the model failed to load or during inference.
forward
forward:
ForwardFn<M>
Defined in: types/textEmbeddings.ts:149
Runs the text embeddings model on the provided input string.
Param
The text string to embed.
Param
Optional role for models with asymmetric prompts. Required if the model has prompts.
Returns
A promise resolving to a Float32Array or EmbeddingResult containing the vector embeddings.
Throws
If the model is not loaded or is currently processing another request.
isGenerating
isGenerating:
boolean
Defined in: types/textEmbeddings.ts:137
Indicates whether the model is currently generating embeddings.
isReady
isReady:
boolean
Defined in: types/textEmbeddings.ts:133
Indicates whether the embeddings model has successfully loaded and is ready for inference.