Skip to content

Commit 4dd5af9

Browse files
julian-rischclaude
andauthored
docs: replace migrated component imports with haystack_integrations paths (#11860)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
1 parent 68e32b7 commit 4dd5af9

68 files changed

Lines changed: 493 additions & 141 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs-website/docs/concepts/agents.mdx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,17 @@ export OPENAI_API_KEY=<your-openai-key>
7676
export SERPERDEV_API_KEY=<your-serperdev-key>
7777
```
7878

79+
The examples on this page use SerperDev web search component that have moved to the `serperdev-haystack` package. Install it to run the examples:
80+
81+
```shell
82+
pip install serperdev-haystack
83+
```
84+
7985
```python
8086
from haystack.components.agents import Agent
8187
from haystack.components.generators.chat import OpenAIChatGenerator
8288
from haystack.components.generators.utils import print_streaming_chunk
83-
from haystack.components.websearch import SerperDevWebSearch
89+
from haystack_integrations.components.websearch.serperdev import SerperDevWebSearch
8490
from haystack.dataclasses import ChatMessage
8591
from haystack.tools import ComponentTool
8692

docs-website/docs/concepts/agents/multi-agent-systems.mdx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,20 @@ Wrapping an agent inside a `@tool` function gives you full control over what the
3131
This approach works better with smaller LLMs because the tool has a clean, minimal signature.
3232
The coordinator only needs to provide a query string - all the `ChatMessage` construction and result unpacking is hidden inside the function.
3333

34+
The examples on this page use SerperDev web search component that have moved to the `serperdev-haystack` package. Install it to run the examples:
35+
36+
```shell
37+
pip install serperdev-haystack
38+
```
39+
3440
```python
3541
from typing import Annotated
3642
from haystack.components.agents import Agent
3743
from haystack.components.generators.chat import OpenAIChatGenerator
3844
from haystack.components.generators.utils import print_streaming_chunk
3945
from haystack.dataclasses import ChatMessage
4046
from haystack.tools import ComponentTool, tool
41-
from haystack.components.websearch import SerperDevWebSearch
47+
from haystack_integrations.components.websearch.serperdev import SerperDevWebSearch
4248
from haystack.utils import Secret
4349

4450

@@ -198,7 +204,7 @@ components:
198204
exclude_subdomains: false
199205
search_params: {}
200206
top_k: 3
201-
type: haystack.components.websearch.serper_dev.SerperDevWebSearch
207+
type: haystack_integrations.components.websearch.serperdev.websearch.SerperDevWebSearch
202208
description: Search the web for current information on any topic
203209
inputs_from_state: null
204210
name: web_search
@@ -254,7 +260,7 @@ from haystack.components.converters import HTMLToDocument
254260
from haystack.components.fetchers.link_content import LinkContentFetcher
255261
from haystack.components.generators.chat import OpenAIChatGenerator
256262
from haystack.components.generators.utils import print_streaming_chunk
257-
from haystack.components.websearch import SerperDevWebSearch
263+
from haystack_integrations.components.websearch.serperdev import SerperDevWebSearch
258264
from haystack.dataclasses import ChatMessage
259265
from haystack.tools import ComponentTool, tool
260266
from haystack.utils import Secret

docs-website/docs/concepts/components.mdx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,17 @@ Returns a list of Documents ranked by their similarity to the given query.
4545

4646
Components that use heavy resources, like LLMs or embedding models, have a `warm_up()` method that loads the necessary resources (such as models) into memory. This method is automatically called the first time the component runs, so you can use components directly without explicitly calling `warm_up()`:
4747

48+
The examples on this page use Sentence Transformers embedders that have moved to the `sentence-transformers-haystack` package. Install it to run the examples:
49+
50+
```shell
51+
pip install sentence-transformers-haystack
52+
```
53+
4854
```python
4955
from haystack import Document
50-
from haystack.components.embedders import SentenceTransformersDocumentEmbedder
56+
from haystack_integrations.components.embedders.sentence_transformers import (
57+
SentenceTransformersDocumentEmbedder,
58+
)
5159

5260
doc = Document(content="I love pizza!")
5361
doc_embedder = SentenceTransformersDocumentEmbedder()

docs-website/docs/concepts/components/supercomponents.mdx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,20 @@ With this decorator, the `to_dict` and `from_dict` serialization is optional, as
1919

2020
The custom HybridRetriever example SuperComponent below turns your query into embeddings, then runs both a BM25 search and an embedding-based search at the same time. It finally merges those two result sets and returns the combined documents.
2121

22+
The examples on this page use Sentence Transformers embedders that have moved to the `sentence-transformers-haystack` package. Install it to run the examples:
23+
24+
```shell
25+
pip install sentence-transformers-haystack
26+
```
27+
2228
```python
23-
# pip install haystack-ai datasets "sentence-transformers>=3.0.0"
29+
# pip install haystack-ai datasets sentence-transformers-haystack
2430

2531
from haystack import Document, Pipeline, super_component
2632
from haystack.components.joiners import DocumentJoiner
27-
from haystack.components.embedders import SentenceTransformersTextEmbedder
33+
from haystack_integrations.components.embedders.sentence_transformers import (
34+
SentenceTransformersTextEmbedder,
35+
)
2836
from haystack.components.retrievers import (
2937
InMemoryBM25Retriever,
3038
InMemoryEmbeddingRetriever,

docs-website/docs/concepts/pipelines/asyncpipeline.mdx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,18 @@ You can find more details in our [API Reference](/reference/pipeline-api#asyncpi
5050

5151
## Example
5252

53+
The examples on this page use Sentence Transformers embedders that have moved to the `sentence-transformers-haystack` package. Install it to run the examples:
54+
55+
```shell
56+
pip install sentence-transformers-haystack
57+
```
58+
5359
```python
5460
import asyncio
5561

5662
from haystack import AsyncPipeline, Document
5763
from haystack.components.builders import ChatPromptBuilder
58-
from haystack.components.embedders import (
64+
from haystack_integrations.components.embedders.sentence_transformers import (
5965
SentenceTransformersDocumentEmbedder,
6066
SentenceTransformersTextEmbedder,
6167
)
@@ -75,7 +81,6 @@ documents = [
7581
]
7682

7783
docs_embedder = SentenceTransformersDocumentEmbedder()
78-
docs_embedder.warm_up()
7984

8085
document_store = InMemoryDocumentStore()
8186
document_store.write_documents(docs_embedder.run(documents=documents)["documents"])

docs-website/docs/concepts/pipelines/creating-pipelines.mdx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,18 @@ For each component you want to use in your pipeline, you must know the names of
2626
Import all the dependencies, like pipeline, documents, Document Store, and all the components you want to use in your pipeline.
2727
For example, to create a semantic document search pipelines, you need the `Document` object, the pipeline, the Document Store, Embedders, and a Retriever:
2828

29+
The examples on this page use Sentence Transformers embedders that have moved to the `sentence-transformers-haystack` package. Install it to run the examples:
30+
31+
```shell
32+
pip install sentence-transformers-haystack
33+
```
34+
2935
```python
3036
from haystack import Document, Pipeline
3137
from haystack.document_stores.in_memory import InMemoryDocumentStore
32-
from haystack.components.embedders import SentenceTransformersTextEmbedder
38+
from haystack_integrations.components.embedders.sentence_transformers import (
39+
SentenceTransformersTextEmbedder,
40+
)
3341
from haystack.components.retrievers.in_memory import InMemoryEmbeddingRetriever
3442
```
3543

docs-website/docs/document-stores/oracledocumentstore.mdx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ It stores documents alongside dense vector embeddings in a native `VECTOR` colum
2525
pip install oracle-haystack
2626
```
2727

28+
The examples on this page use Sentence Transformers embedders that have moved to the `sentence-transformers-haystack` package. Install it to run the examples:
29+
30+
```shell
31+
pip install sentence-transformers-haystack
32+
```
33+
2834
## Connection
2935

3036
`OracleDocumentStore` connects to Oracle using the `OracleConnectionConfig` dataclass, which supports two connection modes:
@@ -108,7 +114,7 @@ document_store = OracleDocumentStore(
108114
```python
109115
from haystack import Document, Pipeline
110116
from haystack.document_stores.types import DuplicatePolicy
111-
from haystack.components.embedders import (
117+
from haystack_integrations.components.embedders.sentence_transformers import (
112118
SentenceTransformersDocumentEmbedder,
113119
SentenceTransformersTextEmbedder,
114120
)
@@ -146,7 +152,6 @@ documents = [
146152
doc_embedder = SentenceTransformersDocumentEmbedder(
147153
model="sentence-transformers/all-MiniLM-L6-v2",
148154
)
149-
doc_embedder.warm_up()
150155
embedded_docs = doc_embedder.run(documents)["documents"]
151156
document_store.write_documents(embedded_docs, policy=DuplicatePolicy.OVERWRITE)
152157

docs-website/docs/document-stores/supabasedocumentstore.mdx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ description: "Use Supabase as a document store in Haystack, with vector search (
2727
pip install supabase-haystack
2828
```
2929

30+
The examples on this page use Sentence Transformers embedders that have moved to the `sentence-transformers-haystack` package. Install it to run the examples:
31+
32+
```shell
33+
pip install sentence-transformers-haystack
34+
```
35+
3036
## SupabasePgvectorDocumentStore
3137

3238
`SupabasePgvectorDocumentStore` is a thin wrapper around [`PgvectorDocumentStore`](./pgvectordocumentstore.mdx) with Supabase-specific defaults:
@@ -70,7 +76,7 @@ To learn more about the initialization parameters, see the [API docs](/reference
7076
```python
7177
from haystack import Document, Pipeline
7278
from haystack.document_stores.types.policy import DuplicatePolicy
73-
from haystack.components.embedders import (
79+
from haystack_integrations.components.embedders.sentence_transformers import (
7480
SentenceTransformersTextEmbedder,
7581
SentenceTransformersDocumentEmbedder,
7682
)

docs-website/docs/document-stores/valkeydocumentstore.mdx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ You can install the Valkey Haystack integration with:
2828
pip install valkey-haystack
2929
```
3030

31+
The examples on this page use Sentence Transformers embedders that have moved to the `sentence-transformers-haystack` package. Install it to run the examples:
32+
33+
```shell
34+
pip install sentence-transformers-haystack
35+
```
36+
3137
## Initialization
3238

3339
To use Valkey as your data storage for Haystack pipelines, you need a Valkey server with the search module running. Initialize a `ValkeyDocumentStore` like this:
@@ -65,7 +71,9 @@ To write documents to your `ValkeyDocumentStore`, create an indexing pipeline or
6571
from haystack import Pipeline
6672
from haystack.components.converters import MarkdownToDocument
6773
from haystack.components.writers import DocumentWriter
68-
from haystack.components.embedders import SentenceTransformersDocumentEmbedder
74+
from haystack_integrations.components.embedders.sentence_transformers import (
75+
SentenceTransformersDocumentEmbedder,
76+
)
6977
from haystack.components.preprocessors import DocumentSplitter
7078
from haystack_integrations.document_stores.valkey import ValkeyDocumentStore
7179

@@ -99,7 +107,9 @@ Once documents are in your `ValkeyDocumentStore`, you can use [`ValkeyEmbeddingR
99107
from haystack import Pipeline
100108
from haystack.utils import Secret
101109
from haystack.dataclasses import ChatMessage
102-
from haystack.components.embedders import SentenceTransformersTextEmbedder
110+
from haystack_integrations.components.embedders.sentence_transformers import (
111+
SentenceTransformersTextEmbedder,
112+
)
103113
from haystack.components.builders import ChatPromptBuilder
104114
from haystack.components.generators.chat import OpenAIChatGenerator
105115
from haystack_integrations.document_stores.valkey import ValkeyDocumentStore

docs-website/docs/optimization/advanced-rag-techniques/hypothetical-document-embeddings-hyde.mdx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ Many embedding retrievers generalize poorly to new, unseen domains. This approac
2828

2929
First, prepare all the components that you would need:
3030

31+
The examples on this page use Sentence Transformers embedders that have moved to the `sentence-transformers-haystack` package. Install it to run the examples:
32+
33+
```shell
34+
pip install sentence-transformers-haystack
35+
```
36+
3137
```python
3238
import os
3339
from numpy import array, mean
@@ -37,7 +43,9 @@ from haystack.components.generators.chat import OpenAIChatGenerator
3743
from haystack.components.builders import ChatPromptBuilder
3844
from haystack import component, Document
3945
from haystack.components.converters import OutputAdapter
40-
from haystack.components.embedders import SentenceTransformersDocumentEmbedder
46+
from haystack_integrations.components.embedders.sentence_transformers import (
47+
SentenceTransformersDocumentEmbedder,
48+
)
4149
from haystack.dataclasses import ChatMessage
4250

4351
# We need to ensure we have the OpenAI API key in our environment variables
@@ -69,7 +77,6 @@ adapter = OutputAdapter(
6977
embedder = SentenceTransformersDocumentEmbedder(
7078
model="sentence-transformers/all-MiniLM-L6-v2",
7179
)
72-
embedder.warm_up()
7380

7481

7582
# Adding one custom component that returns one, "average" embedding from multiple (hypothetical) document embeddings

0 commit comments

Comments
 (0)