weaviate-haystack 2.1.2__tar.gz → 2.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {weaviate_haystack-2.1.2 → weaviate_haystack-2.2.0}/CHANGELOG.md +5 -0
- {weaviate_haystack-2.1.2 → weaviate_haystack-2.2.0}/PKG-INFO +1 -1
- {weaviate_haystack-2.1.2 → weaviate_haystack-2.2.0}/src/haystack_integrations/components/retrievers/weaviate/bm25_retriever.py +5 -1
- {weaviate_haystack-2.1.2 → weaviate_haystack-2.2.0}/src/haystack_integrations/components/retrievers/weaviate/embedding_retriever.py +5 -1
- {weaviate_haystack-2.1.2 → weaviate_haystack-2.2.0}/src/haystack_integrations/document_stores/weaviate/document_store.py +1 -1
- {weaviate_haystack-2.1.2 → weaviate_haystack-2.2.0}/tests/test_bm25_retriever.py +39 -0
- {weaviate_haystack-2.1.2 → weaviate_haystack-2.2.0}/tests/test_embedding_retriever.py +43 -0
- {weaviate_haystack-2.1.2 → weaviate_haystack-2.2.0}/.gitignore +0 -0
- {weaviate_haystack-2.1.2 → weaviate_haystack-2.2.0}/LICENSE.txt +0 -0
- {weaviate_haystack-2.1.2 → weaviate_haystack-2.2.0}/README.md +0 -0
- {weaviate_haystack-2.1.2 → weaviate_haystack-2.2.0}/docker-compose.yml +0 -0
- {weaviate_haystack-2.1.2 → weaviate_haystack-2.2.0}/pydoc/config.yml +0 -0
- {weaviate_haystack-2.1.2 → weaviate_haystack-2.2.0}/pyproject.toml +0 -0
- {weaviate_haystack-2.1.2 → weaviate_haystack-2.2.0}/src/haystack_integrations/components/retrievers/weaviate/__init__.py +0 -0
- {weaviate_haystack-2.1.2 → weaviate_haystack-2.2.0}/src/haystack_integrations/document_stores/weaviate/__init__.py +0 -0
- {weaviate_haystack-2.1.2 → weaviate_haystack-2.2.0}/src/haystack_integrations/document_stores/weaviate/_filters.py +0 -0
- {weaviate_haystack-2.1.2 → weaviate_haystack-2.2.0}/src/haystack_integrations/document_stores/weaviate/auth.py +0 -0
- {weaviate_haystack-2.1.2 → weaviate_haystack-2.2.0}/tests/__init__.py +0 -0
- {weaviate_haystack-2.1.2 → weaviate_haystack-2.2.0}/tests/conftest.py +0 -0
- {weaviate_haystack-2.1.2 → weaviate_haystack-2.2.0}/tests/test_auth.py +0 -0
- {weaviate_haystack-2.1.2 → weaviate_haystack-2.2.0}/tests/test_document_store.py +0 -0
- {weaviate_haystack-2.1.2 → weaviate_haystack-2.2.0}/tests/test_files/robot1.jpg +0 -0
- {weaviate_haystack-2.1.2 → weaviate_haystack-2.2.0}/tests/test_filters.py +0 -0
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
## [unreleased]
|
|
4
4
|
|
|
5
|
+
### 🚀 Features
|
|
6
|
+
|
|
7
|
+
- Add filter_policy to weaviate integration (#824)
|
|
8
|
+
|
|
5
9
|
### 🐛 Bug Fixes
|
|
6
10
|
|
|
7
11
|
- Weaviate filter error (#811)
|
|
@@ -10,6 +14,7 @@
|
|
|
10
14
|
### ⚙️ Miscellaneous Tasks
|
|
11
15
|
|
|
12
16
|
- Retry tests to reduce flakyness (#836)
|
|
17
|
+
- Update ruff invocation to include check parameter (#853)
|
|
13
18
|
|
|
14
19
|
## [integrations/weaviate-v2.1.0] - 2024-06-10
|
|
15
20
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: weaviate-haystack
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.2.0
|
|
4
4
|
Summary: An integration of Weaviate vector database with Haystack
|
|
5
5
|
Project-URL: Source, https://github.com/deepset-ai/haystack-core-integrations
|
|
6
6
|
Project-URL: Documentation, https://github.com/deepset-ai/haystack-core-integrations/blob/main/integrations/weaviate/README.md
|
|
@@ -80,7 +80,11 @@ class WeaviateBM25Retriever:
|
|
|
80
80
|
data["init_parameters"]["document_store"] = WeaviateDocumentStore.from_dict(
|
|
81
81
|
data["init_parameters"]["document_store"]
|
|
82
82
|
)
|
|
83
|
-
|
|
83
|
+
# Pipelines serialized with old versions of the component might not
|
|
84
|
+
# have the filter_policy field.
|
|
85
|
+
if filter_policy := data["init_parameters"].get("filter_policy"):
|
|
86
|
+
data["init_parameters"]["filter_policy"] = FilterPolicy.from_str(filter_policy)
|
|
87
|
+
|
|
84
88
|
return default_from_dict(cls, data)
|
|
85
89
|
|
|
86
90
|
@component.output_types(documents=List[Document])
|
|
@@ -90,7 +90,11 @@ class WeaviateEmbeddingRetriever:
|
|
|
90
90
|
data["init_parameters"]["document_store"]
|
|
91
91
|
)
|
|
92
92
|
|
|
93
|
-
|
|
93
|
+
# Pipelines serialized with old versions of the component might not
|
|
94
|
+
# have the filter_policy field.
|
|
95
|
+
if filter_policy := data["init_parameters"].get("filter_policy"):
|
|
96
|
+
data["init_parameters"]["filter_policy"] = FilterPolicy.from_str(filter_policy)
|
|
97
|
+
|
|
94
98
|
return default_from_dict(cls, data)
|
|
95
99
|
|
|
96
100
|
@component.output_types(documents=List[Document])
|
|
@@ -203,7 +203,7 @@ class WeaviateDocumentStore:
|
|
|
203
203
|
self._client.connect()
|
|
204
204
|
|
|
205
205
|
# Test connection, it will raise an exception if it fails.
|
|
206
|
-
self._client.collections.
|
|
206
|
+
self._client.collections.list_all(simple=True)
|
|
207
207
|
if not self._client.collections.exists(self._collection_settings["class"]):
|
|
208
208
|
self._client.collections.create_from_dict(self._collection_settings)
|
|
209
209
|
|
|
@@ -100,6 +100,45 @@ def test_from_dict(_mock_weaviate):
|
|
|
100
100
|
assert retriever._top_k == 10
|
|
101
101
|
|
|
102
102
|
|
|
103
|
+
@patch("haystack_integrations.document_stores.weaviate.document_store.weaviate")
|
|
104
|
+
def test_from_dict_no_filter_policy(_mock_weaviate):
|
|
105
|
+
retriever = WeaviateBM25Retriever.from_dict(
|
|
106
|
+
{
|
|
107
|
+
"type": "haystack_integrations.components.retrievers.weaviate.bm25_retriever.WeaviateBM25Retriever",
|
|
108
|
+
"init_parameters": {
|
|
109
|
+
"filters": {},
|
|
110
|
+
"top_k": 10,
|
|
111
|
+
"document_store": {
|
|
112
|
+
"type": "haystack_integrations.document_stores.weaviate.document_store.WeaviateDocumentStore",
|
|
113
|
+
"init_parameters": {
|
|
114
|
+
"url": None,
|
|
115
|
+
"collection_settings": {
|
|
116
|
+
"class": "Default",
|
|
117
|
+
"invertedIndexConfig": {"indexNullState": True},
|
|
118
|
+
"properties": [
|
|
119
|
+
{"name": "_original_id", "dataType": ["text"]},
|
|
120
|
+
{"name": "content", "dataType": ["text"]},
|
|
121
|
+
{"name": "dataframe", "dataType": ["text"]},
|
|
122
|
+
{"name": "blob_data", "dataType": ["blob"]},
|
|
123
|
+
{"name": "blob_mime_type", "dataType": ["text"]},
|
|
124
|
+
{"name": "score", "dataType": ["number"]},
|
|
125
|
+
],
|
|
126
|
+
},
|
|
127
|
+
"auth_client_secret": None,
|
|
128
|
+
"additional_headers": None,
|
|
129
|
+
"embedded_options": None,
|
|
130
|
+
"additional_config": None,
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
}
|
|
135
|
+
)
|
|
136
|
+
assert retriever._document_store
|
|
137
|
+
assert retriever._filters == {}
|
|
138
|
+
assert retriever._top_k == 10
|
|
139
|
+
assert retriever._filter_policy == FilterPolicy.REPLACE
|
|
140
|
+
|
|
141
|
+
|
|
103
142
|
@patch("haystack_integrations.components.retrievers.weaviate.bm25_retriever.WeaviateDocumentStore")
|
|
104
143
|
def test_run(mock_document_store):
|
|
105
144
|
retriever = WeaviateBM25Retriever(document_store=mock_document_store)
|
|
@@ -114,6 +114,49 @@ def test_from_dict(_mock_weaviate):
|
|
|
114
114
|
assert retriever._certainty is None
|
|
115
115
|
|
|
116
116
|
|
|
117
|
+
@patch("haystack_integrations.document_stores.weaviate.document_store.weaviate")
|
|
118
|
+
def test_from_dict_no_filter_policy(_mock_weaviate):
|
|
119
|
+
retriever = WeaviateEmbeddingRetriever.from_dict(
|
|
120
|
+
{
|
|
121
|
+
"type": "haystack_integrations.components.retrievers.weaviate.embedding_retriever.WeaviateEmbeddingRetriever", # noqa: E501
|
|
122
|
+
"init_parameters": {
|
|
123
|
+
"filters": {},
|
|
124
|
+
"top_k": 10,
|
|
125
|
+
"distance": None,
|
|
126
|
+
"certainty": None,
|
|
127
|
+
"document_store": {
|
|
128
|
+
"type": "haystack_integrations.document_stores.weaviate.document_store.WeaviateDocumentStore",
|
|
129
|
+
"init_parameters": {
|
|
130
|
+
"url": None,
|
|
131
|
+
"collection_settings": {
|
|
132
|
+
"class": "Default",
|
|
133
|
+
"invertedIndexConfig": {"indexNullState": True},
|
|
134
|
+
"properties": [
|
|
135
|
+
{"name": "_original_id", "dataType": ["text"]},
|
|
136
|
+
{"name": "content", "dataType": ["text"]},
|
|
137
|
+
{"name": "dataframe", "dataType": ["text"]},
|
|
138
|
+
{"name": "blob_data", "dataType": ["blob"]},
|
|
139
|
+
{"name": "blob_mime_type", "dataType": ["text"]},
|
|
140
|
+
{"name": "score", "dataType": ["number"]},
|
|
141
|
+
],
|
|
142
|
+
},
|
|
143
|
+
"auth_client_secret": None,
|
|
144
|
+
"additional_headers": None,
|
|
145
|
+
"embedded_options": None,
|
|
146
|
+
"additional_config": None,
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
}
|
|
151
|
+
)
|
|
152
|
+
assert retriever._document_store
|
|
153
|
+
assert retriever._filters == {}
|
|
154
|
+
assert retriever._top_k == 10
|
|
155
|
+
assert retriever._distance is None
|
|
156
|
+
assert retriever._certainty is None
|
|
157
|
+
assert retriever._filter_policy == FilterPolicy.REPLACE # defaults to REPLACE
|
|
158
|
+
|
|
159
|
+
|
|
117
160
|
@patch("haystack_integrations.components.retrievers.weaviate.bm25_retriever.WeaviateDocumentStore")
|
|
118
161
|
def test_run(mock_document_store):
|
|
119
162
|
retriever = WeaviateEmbeddingRetriever(document_store=mock_document_store)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|