amazon-bedrock-haystack 5.3.1__tar.gz → 5.4.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.
- {amazon_bedrock_haystack-5.3.1 → amazon_bedrock_haystack-5.4.0}/CHANGELOG.md +7 -0
- {amazon_bedrock_haystack-5.3.1 → amazon_bedrock_haystack-5.4.0}/PKG-INFO +1 -1
- {amazon_bedrock_haystack-5.3.1 → amazon_bedrock_haystack-5.4.0}/pyproject.toml +1 -1
- {amazon_bedrock_haystack-5.3.1 → amazon_bedrock_haystack-5.4.0}/src/haystack_integrations/components/downloaders/s3/s3_downloader.py +1 -2
- {amazon_bedrock_haystack-5.3.1 → amazon_bedrock_haystack-5.4.0}/src/haystack_integrations/components/generators/amazon_bedrock/chat/chat_generator.py +1 -1
- {amazon_bedrock_haystack-5.3.1 → amazon_bedrock_haystack-5.4.0}/src/haystack_integrations/components/generators/amazon_bedrock/generator.py +1 -1
- {amazon_bedrock_haystack-5.3.1 → amazon_bedrock_haystack-5.4.0}/src/haystack_integrations/components/rankers/amazon_bedrock/ranker.py +1 -1
- {amazon_bedrock_haystack-5.3.1 → amazon_bedrock_haystack-5.4.0}/tests/test_s3_downloader.py +9 -29
- {amazon_bedrock_haystack-5.3.1 → amazon_bedrock_haystack-5.4.0}/.gitignore +0 -0
- {amazon_bedrock_haystack-5.3.1 → amazon_bedrock_haystack-5.4.0}/LICENSE.txt +0 -0
- {amazon_bedrock_haystack-5.3.1 → amazon_bedrock_haystack-5.4.0}/README.md +0 -0
- {amazon_bedrock_haystack-5.3.1 → amazon_bedrock_haystack-5.4.0}/examples/bedrock_ranker_example.py +0 -0
- {amazon_bedrock_haystack-5.3.1 → amazon_bedrock_haystack-5.4.0}/examples/chatgenerator_example.py +0 -0
- {amazon_bedrock_haystack-5.3.1 → amazon_bedrock_haystack-5.4.0}/examples/embedders_generator_with_rag_example.py +0 -0
- {amazon_bedrock_haystack-5.3.1 → amazon_bedrock_haystack-5.4.0}/examples/s3_downloader_example.py +0 -0
- {amazon_bedrock_haystack-5.3.1 → amazon_bedrock_haystack-5.4.0}/pydoc/config_docusaurus.yml +0 -0
- {amazon_bedrock_haystack-5.3.1 → amazon_bedrock_haystack-5.4.0}/src/haystack_integrations/common/amazon_bedrock/__init__.py +0 -0
- {amazon_bedrock_haystack-5.3.1 → amazon_bedrock_haystack-5.4.0}/src/haystack_integrations/common/amazon_bedrock/errors.py +0 -0
- {amazon_bedrock_haystack-5.3.1 → amazon_bedrock_haystack-5.4.0}/src/haystack_integrations/common/amazon_bedrock/utils.py +0 -0
- {amazon_bedrock_haystack-5.3.1 → amazon_bedrock_haystack-5.4.0}/src/haystack_integrations/common/py.typed +0 -0
- {amazon_bedrock_haystack-5.3.1 → amazon_bedrock_haystack-5.4.0}/src/haystack_integrations/common/s3/__init__.py +0 -0
- {amazon_bedrock_haystack-5.3.1 → amazon_bedrock_haystack-5.4.0}/src/haystack_integrations/common/s3/errors.py +0 -0
- {amazon_bedrock_haystack-5.3.1 → amazon_bedrock_haystack-5.4.0}/src/haystack_integrations/common/s3/utils.py +0 -0
- {amazon_bedrock_haystack-5.3.1 → amazon_bedrock_haystack-5.4.0}/src/haystack_integrations/components/downloaders/py.typed +0 -0
- {amazon_bedrock_haystack-5.3.1 → amazon_bedrock_haystack-5.4.0}/src/haystack_integrations/components/downloaders/s3/__init__.py +0 -0
- {amazon_bedrock_haystack-5.3.1 → amazon_bedrock_haystack-5.4.0}/src/haystack_integrations/components/embedders/amazon_bedrock/__init__.py +0 -0
- {amazon_bedrock_haystack-5.3.1 → amazon_bedrock_haystack-5.4.0}/src/haystack_integrations/components/embedders/amazon_bedrock/document_embedder.py +0 -0
- {amazon_bedrock_haystack-5.3.1 → amazon_bedrock_haystack-5.4.0}/src/haystack_integrations/components/embedders/amazon_bedrock/document_image_embedder.py +0 -0
- {amazon_bedrock_haystack-5.3.1 → amazon_bedrock_haystack-5.4.0}/src/haystack_integrations/components/embedders/amazon_bedrock/text_embedder.py +0 -0
- {amazon_bedrock_haystack-5.3.1 → amazon_bedrock_haystack-5.4.0}/src/haystack_integrations/components/embedders/py.typed +0 -0
- {amazon_bedrock_haystack-5.3.1 → amazon_bedrock_haystack-5.4.0}/src/haystack_integrations/components/generators/amazon_bedrock/__init__.py +0 -0
- {amazon_bedrock_haystack-5.3.1 → amazon_bedrock_haystack-5.4.0}/src/haystack_integrations/components/generators/amazon_bedrock/adapters.py +0 -0
- {amazon_bedrock_haystack-5.3.1 → amazon_bedrock_haystack-5.4.0}/src/haystack_integrations/components/generators/amazon_bedrock/chat/__init__.py +0 -0
- {amazon_bedrock_haystack-5.3.1 → amazon_bedrock_haystack-5.4.0}/src/haystack_integrations/components/generators/amazon_bedrock/chat/utils.py +0 -0
- {amazon_bedrock_haystack-5.3.1 → amazon_bedrock_haystack-5.4.0}/src/haystack_integrations/components/generators/py.typed +0 -0
- {amazon_bedrock_haystack-5.3.1 → amazon_bedrock_haystack-5.4.0}/src/haystack_integrations/components/rankers/amazon_bedrock/__init__.py +0 -0
- {amazon_bedrock_haystack-5.3.1 → amazon_bedrock_haystack-5.4.0}/src/haystack_integrations/components/rankers/py.typed +0 -0
- {amazon_bedrock_haystack-5.3.1 → amazon_bedrock_haystack-5.4.0}/tests/__init__.py +0 -0
- {amazon_bedrock_haystack-5.3.1 → amazon_bedrock_haystack-5.4.0}/tests/conftest.py +0 -0
- {amazon_bedrock_haystack-5.3.1 → amazon_bedrock_haystack-5.4.0}/tests/test_chat_generator.py +0 -0
- {amazon_bedrock_haystack-5.3.1 → amazon_bedrock_haystack-5.4.0}/tests/test_chat_generator_utils.py +0 -0
- {amazon_bedrock_haystack-5.3.1 → amazon_bedrock_haystack-5.4.0}/tests/test_document_embedder.py +0 -0
- {amazon_bedrock_haystack-5.3.1 → amazon_bedrock_haystack-5.4.0}/tests/test_document_image_embedder.py +0 -0
- {amazon_bedrock_haystack-5.3.1 → amazon_bedrock_haystack-5.4.0}/tests/test_files/apple.jpg +0 -0
- {amazon_bedrock_haystack-5.3.1 → amazon_bedrock_haystack-5.4.0}/tests/test_files/haystack-logo.png +0 -0
- {amazon_bedrock_haystack-5.3.1 → amazon_bedrock_haystack-5.4.0}/tests/test_files/sample_pdf_1.pdf +0 -0
- {amazon_bedrock_haystack-5.3.1 → amazon_bedrock_haystack-5.4.0}/tests/test_generator.py +0 -0
- {amazon_bedrock_haystack-5.3.1 → amazon_bedrock_haystack-5.4.0}/tests/test_ranker.py +0 -0
- {amazon_bedrock_haystack-5.3.1 → amazon_bedrock_haystack-5.4.0}/tests/test_text_embedder.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: amazon-bedrock-haystack
|
|
3
|
-
Version: 5.
|
|
3
|
+
Version: 5.4.0
|
|
4
4
|
Summary: An integration of AWS S3 and Bedrock as a Downloader and Generator components.
|
|
5
5
|
Project-URL: Documentation, https://github.com/deepset-ai/haystack-core-integrations/tree/main/integrations/amazon_bedrock#readme
|
|
6
6
|
Project-URL: Issues, https://github.com/deepset-ai/haystack-core-integrations/issues
|
|
@@ -47,7 +47,7 @@ dependencies = ["haystack-pydoc-tools", "ruff"]
|
|
|
47
47
|
|
|
48
48
|
[tool.hatch.envs.default.scripts]
|
|
49
49
|
docs = ["pydoc-markdown pydoc/config_docusaurus.yml"]
|
|
50
|
-
fmt = "ruff check --fix {args}
|
|
50
|
+
fmt = "ruff check --fix {args}; ruff format {args}"
|
|
51
51
|
fmt-check = "ruff check {args} && ruff format --check {args}"
|
|
52
52
|
|
|
53
53
|
[tool.hatch.envs.test]
|
|
@@ -142,8 +142,7 @@ class S3Downloader:
|
|
|
142
142
|
"""
|
|
143
143
|
|
|
144
144
|
if self._storage is None:
|
|
145
|
-
|
|
146
|
-
raise RuntimeError(msg)
|
|
145
|
+
self.warm_up()
|
|
147
146
|
|
|
148
147
|
filtered_documents = self._filter_documents_by_extensions(documents) if self.file_extensions else documents
|
|
149
148
|
|
|
@@ -140,7 +140,7 @@ class AmazonBedrockChatGenerator:
|
|
|
140
140
|
automatically from the environment or the AWS configuration file.
|
|
141
141
|
If the AWS environment is not configured, set `aws_access_key_id`, `aws_secret_access_key`,
|
|
142
142
|
and `aws_region_name` as environment variables or pass them as
|
|
143
|
-
[Secret](https://docs.haystack.deepset.ai/
|
|
143
|
+
[Secret](https://docs.haystack.deepset.ai/docs/secret-management) arguments. Make sure the region you set
|
|
144
144
|
supports Amazon Bedrock.
|
|
145
145
|
"""
|
|
146
146
|
|
|
@@ -58,7 +58,7 @@ class AmazonBedrockGenerator:
|
|
|
58
58
|
automatically from the environment or the AWS configuration file.
|
|
59
59
|
If the AWS environment is not configured, set `aws_access_key_id`, `aws_secret_access_key`,
|
|
60
60
|
`aws_session_token`, and `aws_region_name` as environment variables or pass them as
|
|
61
|
-
[Secret](https://docs.haystack.deepset.ai/
|
|
61
|
+
[Secret](https://docs.haystack.deepset.ai/docs/secret-management) arguments. Make sure the region you set
|
|
62
62
|
supports Amazon Bedrock.
|
|
63
63
|
"""
|
|
64
64
|
|
|
@@ -52,7 +52,7 @@ class AmazonBedrockRanker:
|
|
|
52
52
|
automatically from the environment or the AWS configuration file.
|
|
53
53
|
If the AWS environment is not configured, set `aws_access_key_id`, `aws_secret_access_key`,
|
|
54
54
|
and `aws_region_name` as environment variables or pass them as
|
|
55
|
-
[Secret](https://docs.haystack.deepset.ai/
|
|
55
|
+
[Secret](https://docs.haystack.deepset.ai/docs/secret-management) arguments. Make sure the region you set
|
|
56
56
|
supports Amazon Bedrock.
|
|
57
57
|
"""
|
|
58
58
|
|
|
@@ -129,7 +129,6 @@ class TestS3Downloader:
|
|
|
129
129
|
|
|
130
130
|
def test_run(self, tmp_path, mock_s3_storage, mock_boto3_session):
|
|
131
131
|
d = S3Downloader(file_root_path=str(tmp_path))
|
|
132
|
-
S3Downloader.warm_up(d)
|
|
133
132
|
d._storage = mock_s3_storage
|
|
134
133
|
|
|
135
134
|
docs = [
|
|
@@ -141,7 +140,6 @@ class TestS3Downloader:
|
|
|
141
140
|
|
|
142
141
|
def test_run_with_extensions(self, tmp_path, mock_s3_storage, mock_boto3_session):
|
|
143
142
|
d = S3Downloader(file_root_path=str(tmp_path), file_extensions=[".txt"])
|
|
144
|
-
S3Downloader.warm_up(d)
|
|
145
143
|
d._storage = mock_s3_storage
|
|
146
144
|
|
|
147
145
|
docs = [
|
|
@@ -155,12 +153,9 @@ class TestS3Downloader:
|
|
|
155
153
|
|
|
156
154
|
def test_run_with_input_file_meta_key(self, tmp_path, mock_s3_storage, mock_boto3_session):
|
|
157
155
|
d = S3Downloader(file_root_path=str(tmp_path), file_name_meta_key="custom_file_key")
|
|
158
|
-
S3Downloader.warm_up(d)
|
|
159
156
|
d._storage = mock_s3_storage
|
|
160
157
|
|
|
161
|
-
docs = [
|
|
162
|
-
Document(meta={"file_id": str(uuid4()), "custom_file_key": "a.txt"}),
|
|
163
|
-
]
|
|
158
|
+
docs = [Document(meta={"file_id": str(uuid4()), "custom_file_key": "a.txt"})]
|
|
164
159
|
|
|
165
160
|
out = d.run(documents=docs)
|
|
166
161
|
assert len(out["documents"]) == 1
|
|
@@ -168,12 +163,9 @@ class TestS3Downloader:
|
|
|
168
163
|
|
|
169
164
|
def test_run_with_s3_key_generation_function(self, tmp_path, mock_s3_storage, mock_boto3_session):
|
|
170
165
|
d = S3Downloader(file_root_path=str(tmp_path), s3_key_generation_function=s3_key_generation_function)
|
|
171
|
-
S3Downloader.warm_up(d)
|
|
172
166
|
d._storage = mock_s3_storage
|
|
173
167
|
|
|
174
|
-
docs = [
|
|
175
|
-
Document(meta={"file_id": str(uuid4()), "file_name": "a.txt"}),
|
|
176
|
-
]
|
|
168
|
+
docs = [Document(meta={"file_id": str(uuid4()), "file_name": "a.txt"})]
|
|
177
169
|
out = d.run(documents=docs)
|
|
178
170
|
assert len(out["documents"]) == 1
|
|
179
171
|
assert out["documents"][0].meta["file_name"] == "a.txt"
|
|
@@ -189,7 +181,6 @@ class TestS3Downloader:
|
|
|
189
181
|
s3_key_generation_function=s3_key_generation_function,
|
|
190
182
|
file_extensions=[".txt"],
|
|
191
183
|
)
|
|
192
|
-
S3Downloader.warm_up(d)
|
|
193
184
|
d._storage = mock_s3_storage
|
|
194
185
|
|
|
195
186
|
docs = [
|
|
@@ -210,8 +201,6 @@ class TestS3Downloader:
|
|
|
210
201
|
def test_live_run(self, tmp_path, monkeypatch):
|
|
211
202
|
d = S3Downloader(file_root_path=str(tmp_path))
|
|
212
203
|
monkeypatch.setenv("S3_DOWNLOADER_PREFIX", "")
|
|
213
|
-
S3Downloader.warm_up(d)
|
|
214
|
-
|
|
215
204
|
docs = [
|
|
216
205
|
Document(meta={"file_id": str(uuid4()), "file_name": "text-sample.txt"}),
|
|
217
206
|
Document(meta={"file_id": str(uuid4()), "file_name": "document-sample.pdf"}),
|
|
@@ -229,9 +218,7 @@ class TestS3Downloader:
|
|
|
229
218
|
)
|
|
230
219
|
def test_live_run_with_no_documents(self, tmp_path):
|
|
231
220
|
d = S3Downloader(file_root_path=str(tmp_path))
|
|
232
|
-
|
|
233
|
-
docs = []
|
|
234
|
-
out = d.run(documents=docs)
|
|
221
|
+
out = d.run(documents=[])
|
|
235
222
|
assert len(out["documents"]) == 0
|
|
236
223
|
|
|
237
224
|
@pytest.mark.integration
|
|
@@ -247,10 +234,8 @@ class TestS3Downloader:
|
|
|
247
234
|
def test_live_run_with_custom_meta_key(self, tmp_path, monkeypatch):
|
|
248
235
|
d = S3Downloader(file_root_path=str(tmp_path), file_name_meta_key="custom_name")
|
|
249
236
|
monkeypatch.setenv("S3_DOWNLOADER_PREFIX", "")
|
|
250
|
-
|
|
251
|
-
docs = [
|
|
252
|
-
Document(meta={"custom_name": "text-sample.txt"}),
|
|
253
|
-
]
|
|
237
|
+
d.warm_up()
|
|
238
|
+
docs = [Document(meta={"custom_name": "text-sample.txt"})]
|
|
254
239
|
out = d.run(documents=docs)
|
|
255
240
|
assert len(out["documents"]) == 1
|
|
256
241
|
assert out["documents"][0].meta["custom_name"] == "text-sample.txt"
|
|
@@ -263,11 +248,8 @@ class TestS3Downloader:
|
|
|
263
248
|
def test_live_run_with_prefix(self, tmp_path, monkeypatch):
|
|
264
249
|
d = S3Downloader(file_root_path=str(tmp_path))
|
|
265
250
|
monkeypatch.setenv("S3_DOWNLOADER_PREFIX", "subfolder/")
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
docs = [
|
|
269
|
-
Document(meta={"file_name": "employees.json"}),
|
|
270
|
-
]
|
|
251
|
+
d.warm_up()
|
|
252
|
+
docs = [Document(meta={"file_name": "employees.json"})]
|
|
271
253
|
out = d.run(documents=docs)
|
|
272
254
|
assert len(out["documents"]) == 1
|
|
273
255
|
assert out["documents"][0].meta["file_name"] == "employees.json"
|
|
@@ -286,10 +268,8 @@ class TestS3Downloader:
|
|
|
286
268
|
file_name_meta_key="file_name",
|
|
287
269
|
s3_key_generation_function=s3_key_generation_function,
|
|
288
270
|
)
|
|
289
|
-
|
|
290
|
-
docs = [
|
|
291
|
-
Document(meta={"file_name": "dog.jpg"}),
|
|
292
|
-
]
|
|
271
|
+
d.warm_up()
|
|
272
|
+
docs = [Document(meta={"file_name": "dog.jpg"})]
|
|
293
273
|
out = d.run(documents=docs)
|
|
294
274
|
assert len(out["documents"]) == 1
|
|
295
275
|
assert out["documents"][0].meta["file_name"] == "dog.jpg"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{amazon_bedrock_haystack-5.3.1 → amazon_bedrock_haystack-5.4.0}/examples/bedrock_ranker_example.py
RENAMED
|
File without changes
|
{amazon_bedrock_haystack-5.3.1 → amazon_bedrock_haystack-5.4.0}/examples/chatgenerator_example.py
RENAMED
|
File without changes
|
|
File without changes
|
{amazon_bedrock_haystack-5.3.1 → amazon_bedrock_haystack-5.4.0}/examples/s3_downloader_example.py
RENAMED
|
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
|
|
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
|
{amazon_bedrock_haystack-5.3.1 → amazon_bedrock_haystack-5.4.0}/tests/test_chat_generator.py
RENAMED
|
File without changes
|
{amazon_bedrock_haystack-5.3.1 → amazon_bedrock_haystack-5.4.0}/tests/test_chat_generator_utils.py
RENAMED
|
File without changes
|
{amazon_bedrock_haystack-5.3.1 → amazon_bedrock_haystack-5.4.0}/tests/test_document_embedder.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{amazon_bedrock_haystack-5.3.1 → amazon_bedrock_haystack-5.4.0}/tests/test_files/haystack-logo.png
RENAMED
|
File without changes
|
{amazon_bedrock_haystack-5.3.1 → amazon_bedrock_haystack-5.4.0}/tests/test_files/sample_pdf_1.pdf
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|