deepset-ai / haystack-core-integrations

Additional packages (components, document stores and the likes) to extend the capabilities of Haystack version 2.0 and onwards
https://haystack.deepset.ai
Apache License 2.0
121 stars 119 forks source link

fix: AmazonBedrockChatGenerator with Claude raises moot warning for stream… #1205

Closed vblagoje closed 1 day ago

vblagoje commented 1 day ago

This pull request includes a minor update to the prepare_body method in the amazon_bedrock integration. The change ensures compatibility with Anthropic by removing the unsupported stream keyword argument from inference_kwargs.

We need to leave "stream" kwarg as some other models like Cohere do require it and other LLM foundations models are able to tolerate its presence. We'll soon completely rewrite entire AmazonBedrockChatGenerator codebase to use Converse API anyway.

Note: I didn’t add any new tests but ran the existing ones on CI and locally (for Mistral) to review the logs. While adding new tests would typically be necessary for these fixes I skipped them in this case because we’re planning a complete rewrite of the Amazon Bedrock integration soon anyway.