Skip to main content

NvidiaTextEmbedder

A component for embedding strings using embedding models provided by

Basic Information

  • Type: haystack_integrations.nvidia.src.haystack_integrations.components.embedders.nvidia.text_embedder.NvidiaTextEmbedder

Inputs

ParameterTypeDefaultDescription
textstrThe text to embed.

Outputs

ParameterTypeDefaultDescription
embeddingList[float]A dictionary with the following keys and values: - embedding - Embedding of the text. - meta - Metadata on usage statistics, etc.
metaDict[str, Any]A dictionary with the following keys and values: - embedding - Embedding of the text. - meta - Metadata on usage statistics, etc.

Overview

Work in Progress

Bear with us while we're working on adding pipeline examples and most common components connections.

A component for embedding strings using embedding models provided by NVIDIA NIMs.

For models that differentiate between query and document inputs, this component embeds the input string as a query.

Usage Example

components:
NvidiaTextEmbedder:
type: nvidia.src.haystack_integrations.components.embedders.nvidia.text_embedder.NvidiaTextEmbedder
init_parameters:

Parameters

Init Parameters

These are the parameters you can configure in Pipeline Builder:

ParameterTypeDefaultDescription
modelOptional[str]NoneEmbedding model to use. If no specific model along with locally hosted API URL is provided, the system defaults to the available model found using /models API.
api_keyOptional[Secret]Secret.from_env_var('NVIDIA_API_KEY')API key for the NVIDIA NIM.
api_urlstros.getenv('NVIDIA_API_URL', DEFAULT_API_URL)Custom API URL for the NVIDIA NIM. Format for API URL is http://host:port
prefixstrA string to add to the beginning of each text.
suffixstrA string to add to the end of each text.
truncateOptional[Union[EmbeddingTruncateMode, str]]NoneSpecifies how inputs longer that the maximum token length should be truncated. If None the behavior is model-dependent, see the official documentation for more information.
timeoutOptional[float]NoneTimeout for request calls, if not set it is inferred from the NVIDIA_TIMEOUT environment variable or set to 60 by default.

Run Method Parameters

These are the parameters you can configure for the component's run() method. This means you can pass these parameters at query time through the API, in Playground, or when running a job. For details, see Modify Pipeline Parameters at Query Time.

ParameterTypeDefaultDescription
textstrThe text to embed.