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
| Parameter | Type | Default | Description |
|---|---|---|---|
| text | str | The text to embed. |
Outputs
| Parameter | Type | Default | Description |
|---|---|---|---|
| embedding | List[float] | A dictionary with the following keys and values: - embedding - Embedding of the text. - meta - Metadata on usage statistics, etc. | |
| meta | Dict[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:
| Parameter | Type | Default | Description |
|---|---|---|---|
| model | Optional[str] | None | Embedding 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_key | Optional[Secret] | Secret.from_env_var('NVIDIA_API_KEY') | API key for the NVIDIA NIM. |
| api_url | str | os.getenv('NVIDIA_API_URL', DEFAULT_API_URL) | Custom API URL for the NVIDIA NIM. Format for API URL is http://host:port |
| prefix | str | A string to add to the beginning of each text. | |
| suffix | str | A string to add to the end of each text. | |
| truncate | Optional[Union[EmbeddingTruncateMode, str]] | None | Specifies 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. |
| timeout | Optional[float] | None | Timeout 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.
| Parameter | Type | Default | Description |
|---|---|---|---|
| text | str | The text to embed. |
Was this page helpful?