amazon-bedrock-haystack 6.2.0__py3-none-any.whl → 6.2.1__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: amazon-bedrock-haystack
3
- Version: 6.2.0
3
+ Version: 6.2.1
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
@@ -18,12 +18,12 @@ haystack_integrations/components/generators/amazon_bedrock/__init__.py,sha256=lv
18
18
  haystack_integrations/components/generators/amazon_bedrock/adapters.py,sha256=4-gIWfw70hGaXMNS30UbJFNFCWK2KG6RMnT_4z5RHxc,19625
19
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=A3QbwDWFw7xy-uOjJWaARrihMekrq6N-wXGW9B4dzYw,27638
21
+ haystack_integrations/components/generators/amazon_bedrock/chat/chat_generator.py,sha256=C2hB0Wg_oxSnvPAIrTB4eHqjn8a732HfhbhYmS9eGjc,27731
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.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,,
26
+ amazon_bedrock_haystack-6.2.1.dist-info/METADATA,sha256=Fr8kZsEebhQpC-g0uj6-h6cUMv0ZIi5dwTYq2HZSt7w,2179
27
+ amazon_bedrock_haystack-6.2.1.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
28
+ amazon_bedrock_haystack-6.2.1.dist-info/licenses/LICENSE.txt,sha256=B05uMshqTA74s-0ltyHKI6yoPfJ3zYgQbvcXfDVGFf8,10280
29
+ amazon_bedrock_haystack-6.2.1.dist-info/RECORD,,
@@ -423,27 +423,31 @@ class AmazonBedrockChatGenerator:
423
423
 
424
424
  def _resolve_flattened_generation_kwargs(self, generation_kwargs: dict[str, Any]) -> dict[str, Any]:
425
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
426
 
431
- if "parallel_tool_use" in generation_kwargs:
432
- parallel_tool_use = generation_kwargs.pop("parallel_tool_use")
427
+ disable_parallel_tool_use = generation_kwargs.pop("disable_parallel_tool_use", None)
428
+ parallel_tool_use = generation_kwargs.pop("parallel_tool_use", None)
429
+
430
+ if disable_parallel_tool_use is not None and parallel_tool_use is not None:
431
+ msg = "Cannot set both disable_parallel_tool_use and parallel_tool_use"
432
+ raise ValueError(msg)
433
+ elif parallel_tool_use is not None:
433
434
  disable_parallel_tool_use = not parallel_tool_use
435
+
436
+ if disable_parallel_tool_use is not None:
434
437
  tool_choice = generation_kwargs.setdefault("tool_choice", {})
435
438
  tool_choice["disable_parallel_tool_use"] = disable_parallel_tool_use
439
+ tool_choice.setdefault("type", "auto") # default value
436
440
 
437
- if "tool_choice_type" in generation_kwargs:
438
- tool_choice_type = generation_kwargs.pop("tool_choice_type")
441
+ tool_choice_type = generation_kwargs.pop("tool_choice_type", None)
442
+ if tool_choice_type is not None:
439
443
  tool_choice = generation_kwargs.setdefault("tool_choice", {})
440
444
  tool_choice["type"] = tool_choice_type
441
445
 
442
- if "thinking_budget_tokens" in generation_kwargs:
443
- thinking_budget_tokens = generation_kwargs.pop("thinking_budget_tokens")
446
+ thinking_budget_tokens = generation_kwargs.pop("thinking_budget_tokens", None)
447
+ if thinking_budget_tokens is not None:
444
448
  thinking = generation_kwargs.setdefault("thinking", {})
445
449
  thinking["budget_tokens"] = thinking_budget_tokens
446
- thinking["type"] = "enabled"
450
+ thinking.setdefault("type", "enabled")
447
451
 
448
452
  return generation_kwargs
449
453