STACKITTextEmbedder
Embed strings using STACKIT as the model provider. Use this component in query pipelines when you want to perform semantic search.
Key Features
- Embeds text strings (queries) using STACKIT embedding models.
- Outputs the embedding for use with embedding-based retrievers.
- Configurable prefix and suffix for text preprocessing.
Configuration
- Drag the
STACKITTextEmbeddercomponent onto the canvas from the Component Library. - Click on the component to open the configuration panel.
- On the General tab:
- Connect Haystack Platform to your STACKIT account by creating a secret called
STACKIT_API_KEY. For more information about secrets, see Secrets. - Select the embedding model to use.
- Connect Haystack Platform to your STACKIT account by creating a secret called
- Go to the Advanced tab to configure
timeout,max_retries,http_client_kwargs,prefix, andsuffix.
Connections
STACKITTextEmbedder receives text to embed from the Input component. It sends the embedding to embedding-based retrievers.
Source Code
To check this component's source code, open text_embedder.py in the Haystack Core Integrations repository.
Usage Examples
Basic Configuration
STACKITTextEmbedder:
type: stackit.src.haystack_integrations.components.embedders.stackit.text_embedder.STACKITTextEmbedder
init_parameters: {}
Use this component in query pipelines for semantic search. Connect its embedding output to an embedding retriever.
components:
STACKITTextEmbedder:
type: stackit.src.haystack_integrations.components.embedders.stackit.text_embedder.STACKITTextEmbedder
init_parameters:
Parameters
Inputs
| Parameter | Type | Description |
|---|---|---|
text | str | The text to embed. |
Outputs
| Parameter | Type | Description |
|---|---|---|
embedding | List[float] | The embedding of the input text. |
meta | Dict[str, Any] | Information about the embedding operation. |
Init Parameters
These are the parameters you can configure in Pipeline Builder:
| Parameter | Type | Default | Description |
|---|---|---|---|
| api_key | Secret | Secret.from_env_var('STACKIT_API_KEY') | The STACKIT API key. |
| model | str | The name of the STACKIT embedding model to be used. | |
| api_base_url | Optional[str] | https://api.openai-compat.model-serving.eu01.onstackit.cloud/v1 | The STACKIT API Base url. For more details, see STACKIT docs. |
| prefix | str | A string to add to the beginning of each text. | |
| suffix | str | A string to add to the end of each text. | |
| timeout | Optional[float] | None | Timeout for STACKIT client calls. If not set, it defaults to either the OPENAI_TIMEOUT environment variable, or 30 seconds. |
| max_retries | Optional[int] | None | Maximum number of retries to contact STACKIT after an internal error. If not set, it defaults to either the OPENAI_MAX_RETRIES environment variable, or set to 5. |
| http_client_kwargs | Optional[Dict[str, Any]] | None | A dictionary of keyword arguments to configure a custom httpx.Clientor httpx.AsyncClient. For more information, see the HTTPX documentation. |
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.
This component has no run() method parameters.
Related Information
Was this page helpful?