You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs-website/docs/concepts/components.mdx
+9-1Lines changed: 9 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,9 +45,17 @@ Returns a list of Documents ranked by their similarity to the given query.
45
45
46
46
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()`:
47
47
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
+
48
54
```python
49
55
from haystack import Document
50
-
from haystack.components.embedders import SentenceTransformersDocumentEmbedder
56
+
from haystack_integrations.components.embedders.sentence_transformers import (
Copy file name to clipboardExpand all lines: docs-website/docs/concepts/components/supercomponents.mdx
+10-2Lines changed: 10 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,12 +19,20 @@ With this decorator, the `to_dict` and `from_dict` serialization is optional, as
19
19
20
20
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.
21
21
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:
Copy file name to clipboardExpand all lines: docs-website/docs/concepts/pipelines/asyncpipeline.mdx
+7-2Lines changed: 7 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -50,12 +50,18 @@ You can find more details in our [API Reference](/reference/pipeline-api#asyncpi
50
50
51
51
## Example
52
52
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
+
53
59
```python
54
60
import asyncio
55
61
56
62
from haystack import AsyncPipeline, Document
57
63
from haystack.components.builders import ChatPromptBuilder
For example, to create a semantic document search pipelines, you need the `Document` object, the pipeline, the Document Store, Embedders, and a Retriever:
28
28
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
+
29
35
```python
30
36
from haystack import Document, Pipeline
31
37
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
+
)
33
41
from haystack.components.retrievers.in_memory import InMemoryEmbeddingRetriever
Copy file name to clipboardExpand all lines: docs-website/docs/document-stores/oracledocumentstore.mdx
+7-2Lines changed: 7 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,6 +25,12 @@ It stores documents alongside dense vector embeddings in a native `VECTOR` colum
25
25
pip install oracle-haystack
26
26
```
27
27
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
+
28
34
## Connection
29
35
30
36
`OracleDocumentStore` connects to Oracle using the `OracleConnectionConfig` dataclass, which supports two connection modes:
Copy file name to clipboardExpand all lines: docs-website/docs/document-stores/supabasedocumentstore.mdx
+7-1Lines changed: 7 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,6 +27,12 @@ description: "Use Supabase as a document store in Haystack, with vector search (
27
27
pip install supabase-haystack
28
28
```
29
29
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
+
30
36
## SupabasePgvectorDocumentStore
31
37
32
38
`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
70
76
```python
71
77
from haystack import Document, Pipeline
72
78
from haystack.document_stores.types.policy import DuplicatePolicy
Copy file name to clipboardExpand all lines: docs-website/docs/document-stores/valkeydocumentstore.mdx
+12-2Lines changed: 12 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,6 +28,12 @@ You can install the Valkey Haystack integration with:
28
28
pip install valkey-haystack
29
29
```
30
30
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
+
31
37
## Initialization
32
38
33
39
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
65
71
from haystack import Pipeline
66
72
from haystack.components.converters import MarkdownToDocument
67
73
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
+
)
69
77
from haystack.components.preprocessors import DocumentSplitter
70
78
from haystack_integrations.document_stores.valkey import ValkeyDocumentStore
71
79
@@ -99,7 +107,9 @@ Once documents are in your `ValkeyDocumentStore`, you can use [`ValkeyEmbeddingR
99
107
from haystack import Pipeline
100
108
from haystack.utils import Secret
101
109
from haystack.dataclasses import ChatMessage
102
-
from haystack.components.embedders import SentenceTransformersTextEmbedder
110
+
from haystack_integrations.components.embedders.sentence_transformers import (
111
+
SentenceTransformersTextEmbedder,
112
+
)
103
113
from haystack.components.builders import ChatPromptBuilder
104
114
from haystack.components.generators.chat import OpenAIChatGenerator
105
115
from haystack_integrations.document_stores.valkey import ValkeyDocumentStore
Copy file name to clipboardExpand all lines: docs-website/docs/optimization/advanced-rag-techniques/hypothetical-document-embeddings-hyde.mdx
+9-2Lines changed: 9 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,6 +28,12 @@ Many embedding retrievers generalize poorly to new, unseen domains. This approac
28
28
29
29
First, prepare all the components that you would need:
30
30
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
+
31
37
```python
32
38
import os
33
39
from numpy import array, mean
@@ -37,7 +43,9 @@ from haystack.components.generators.chat import OpenAIChatGenerator
37
43
from haystack.components.builders import ChatPromptBuilder
38
44
from haystack import component, Document
39
45
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
+
)
41
49
from haystack.dataclasses import ChatMessage
42
50
43
51
# We need to ensure we have the OpenAI API key in our environment variables
@@ -69,7 +77,6 @@ adapter = OutputAdapter(
69
77
embedder = SentenceTransformersDocumentEmbedder(
70
78
model="sentence-transformers/all-MiniLM-L6-v2",
71
79
)
72
-
embedder.warm_up()
73
80
74
81
75
82
# Adding one custom component that returns one, "average" embedding from multiple (hypothetical) document embeddings
0 commit comments