amazon-bedrock-haystack 6.1.0__py3-none-any.whl → 6.2.0__py3-none-any.whl
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-6.1.0.dist-info → amazon_bedrock_haystack-6.2.0.dist-info}/METADATA +1 -1
- {amazon_bedrock_haystack-6.1.0.dist-info → amazon_bedrock_haystack-6.2.0.dist-info}/RECORD +6 -6
- haystack_integrations/components/generators/amazon_bedrock/chat/chat_generator.py +28 -0
- haystack_integrations/components/generators/amazon_bedrock/generator.py +10 -7
- {amazon_bedrock_haystack-6.1.0.dist-info → amazon_bedrock_haystack-6.2.0.dist-info}/WHEEL +0 -0
- {amazon_bedrock_haystack-6.1.0.dist-info → amazon_bedrock_haystack-6.2.0.dist-info}/licenses/LICENSE.txt +0 -0
{amazon_bedrock_haystack-6.1.0.dist-info → amazon_bedrock_haystack-6.2.0.dist-info}/METADATA
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: amazon-bedrock-haystack
|
|
3
|
-
Version: 6.
|
|
3
|
+
Version: 6.2.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
|
|
@@ -16,14 +16,14 @@ haystack_integrations/components/embedders/amazon_bedrock/text_embedder.py,sha25
|
|
|
16
16
|
haystack_integrations/components/generators/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
17
17
|
haystack_integrations/components/generators/amazon_bedrock/__init__.py,sha256=lv4NouIVm78YavUssWQrHHP_81u-7j21qW8v1kZMJPQ,284
|
|
18
18
|
haystack_integrations/components/generators/amazon_bedrock/adapters.py,sha256=4-gIWfw70hGaXMNS30UbJFNFCWK2KG6RMnT_4z5RHxc,19625
|
|
19
|
-
haystack_integrations/components/generators/amazon_bedrock/generator.py,sha256=
|
|
19
|
+
haystack_integrations/components/generators/amazon_bedrock/generator.py,sha256=jz9hT3ZMJtUsQnyeCa1sbeEf7e37t3EktQLAT8J2qpM,14901
|
|
20
20
|
haystack_integrations/components/generators/amazon_bedrock/chat/__init__.py,sha256=6GZ8Y3Lw0rLOsOAqi6Tu5mZC977UzQvgDxKpOWr8IQw,110
|
|
21
|
-
haystack_integrations/components/generators/amazon_bedrock/chat/chat_generator.py,sha256=
|
|
21
|
+
haystack_integrations/components/generators/amazon_bedrock/chat/chat_generator.py,sha256=A3QbwDWFw7xy-uOjJWaARrihMekrq6N-wXGW9B4dzYw,27638
|
|
22
22
|
haystack_integrations/components/generators/amazon_bedrock/chat/utils.py,sha256=juOaTi8DuXr-i68zzjCnYoc5eNxO1DxcTI9fcNfg4rE,27214
|
|
23
23
|
haystack_integrations/components/rankers/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
24
24
|
haystack_integrations/components/rankers/amazon_bedrock/__init__.py,sha256=mJQKShAP5AfZvfKQisSh7kfKu6RIXzsYdk4eqMtcaEk,75
|
|
25
25
|
haystack_integrations/components/rankers/amazon_bedrock/ranker.py,sha256=L-1AzmsWR8PYb8CEJsfoYK9MBrE2qXFjenfiiGxa6iw,11769
|
|
26
|
-
amazon_bedrock_haystack-6.
|
|
27
|
-
amazon_bedrock_haystack-6.
|
|
28
|
-
amazon_bedrock_haystack-6.
|
|
29
|
-
amazon_bedrock_haystack-6.
|
|
26
|
+
amazon_bedrock_haystack-6.2.0.dist-info/METADATA,sha256=slUrz6lGzua09kTLV4_d43zv79iK1QXjp3a0x1swIOA,2179
|
|
27
|
+
amazon_bedrock_haystack-6.2.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
28
|
+
amazon_bedrock_haystack-6.2.0.dist-info/licenses/LICENSE.txt,sha256=B05uMshqTA74s-0ltyHKI6yoPfJ3zYgQbvcXfDVGFf8,10280
|
|
29
|
+
amazon_bedrock_haystack-6.2.0.dist-info/RECORD,,
|
|
@@ -372,6 +372,8 @@ class AmazonBedrockChatGenerator:
|
|
|
372
372
|
merged_kwargs = self.generation_kwargs.copy()
|
|
373
373
|
merged_kwargs.update(generation_kwargs)
|
|
374
374
|
|
|
375
|
+
merged_kwargs = self._resolve_flattened_generation_kwargs(merged_kwargs)
|
|
376
|
+
|
|
375
377
|
# Extract known inference parameters
|
|
376
378
|
# See https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_InferenceConfiguration.html
|
|
377
379
|
inference_config = {
|
|
@@ -419,6 +421,32 @@ class AmazonBedrockChatGenerator:
|
|
|
419
421
|
|
|
420
422
|
return params, callback
|
|
421
423
|
|
|
424
|
+
def _resolve_flattened_generation_kwargs(self, generation_kwargs: dict[str, Any]) -> dict[str, Any]:
|
|
425
|
+
generation_kwargs = generation_kwargs.copy()
|
|
426
|
+
if "disable_parallel_tool_use" in generation_kwargs:
|
|
427
|
+
disable_parallel_tool_use = generation_kwargs.pop("disable_parallel_tool_use")
|
|
428
|
+
tool_choice = generation_kwargs.setdefault("tool_choice", {})
|
|
429
|
+
tool_choice["disable_parallel_tool_use"] = disable_parallel_tool_use
|
|
430
|
+
|
|
431
|
+
if "parallel_tool_use" in generation_kwargs:
|
|
432
|
+
parallel_tool_use = generation_kwargs.pop("parallel_tool_use")
|
|
433
|
+
disable_parallel_tool_use = not parallel_tool_use
|
|
434
|
+
tool_choice = generation_kwargs.setdefault("tool_choice", {})
|
|
435
|
+
tool_choice["disable_parallel_tool_use"] = disable_parallel_tool_use
|
|
436
|
+
|
|
437
|
+
if "tool_choice_type" in generation_kwargs:
|
|
438
|
+
tool_choice_type = generation_kwargs.pop("tool_choice_type")
|
|
439
|
+
tool_choice = generation_kwargs.setdefault("tool_choice", {})
|
|
440
|
+
tool_choice["type"] = tool_choice_type
|
|
441
|
+
|
|
442
|
+
if "thinking_budget_tokens" in generation_kwargs:
|
|
443
|
+
thinking_budget_tokens = generation_kwargs.pop("thinking_budget_tokens")
|
|
444
|
+
thinking = generation_kwargs.setdefault("thinking", {})
|
|
445
|
+
thinking["budget_tokens"] = thinking_budget_tokens
|
|
446
|
+
thinking["type"] = "enabled"
|
|
447
|
+
|
|
448
|
+
return generation_kwargs
|
|
449
|
+
|
|
422
450
|
@component.output_types(replies=list[ChatMessage])
|
|
423
451
|
def run(
|
|
424
452
|
self,
|
|
@@ -63,14 +63,17 @@ class AmazonBedrockGenerator:
|
|
|
63
63
|
supports Amazon Bedrock.
|
|
64
64
|
"""
|
|
65
65
|
|
|
66
|
+
# Regex pattern for supported AWS Bedrock region prefixes
|
|
67
|
+
_REGION_PREFIX_PATTERN = r"((?:global|us-gov|us|eu|apac|au|ca|jp)\.)?"
|
|
68
|
+
|
|
66
69
|
SUPPORTED_MODEL_PATTERNS: ClassVar[dict[str, type[BedrockModelAdapter]]] = {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
70
|
+
rf"{_REGION_PREFIX_PATTERN}amazon.titan-text.*": AmazonTitanAdapter,
|
|
71
|
+
rf"{_REGION_PREFIX_PATTERN}ai21.j2.*": AI21LabsJurassic2Adapter,
|
|
72
|
+
rf"{_REGION_PREFIX_PATTERN}cohere.command-[^r].*": CohereCommandAdapter,
|
|
73
|
+
rf"{_REGION_PREFIX_PATTERN}cohere.command-r.*": CohereCommandRAdapter,
|
|
74
|
+
rf"{_REGION_PREFIX_PATTERN}anthropic.claude.*": AnthropicClaudeAdapter,
|
|
75
|
+
rf"{_REGION_PREFIX_PATTERN}meta.llama.*": MetaLlamaAdapter,
|
|
76
|
+
rf"{_REGION_PREFIX_PATTERN}mistral.*": MistralAdapter,
|
|
74
77
|
}
|
|
75
78
|
|
|
76
79
|
SUPPORTED_MODEL_FAMILIES: ClassVar[dict[str, type[BedrockModelAdapter]]] = {
|
|
File without changes
|
|
File without changes
|