-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add Amazon Bedrock support #6226
Conversation
Thanks @viveksilimkhan1 for this awesome contribution. Could you please sign the CLA? As we want to get this as fast as possible into haystack, I will support you in writing tests and pushing it over the finish line. Hope that's ok. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left some comments. Functionality-wise we have to:
- add anthropic claude support
- support streaming
- request supported models from bedrock
- use DefaultPromptHandler to implement
_ensure_token_limit
Quality-wise we have to:
- implement tests
- improve the params validation
@viveksilimkhan1 please let me know if you find time to tackle one or more of those points in the next two days. Otherwise I'm happy to jump on it. :-) |
@viveksilimkhan1 I did some refactorings and improved the I will continue writing tests for instantiation and
Also make sure to install the precommit hooks running |
@anakin87 this PR is good to go from my side. Feel free to have a look. |
**/*.py | ||
files_ignore: | | ||
test/** | ||
rest_api/test/** | ||
haystack/preview/**/*.py |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Misconfig tried to lint my changes and failed because of missing dependencies that are not available to in preview.
@tstadel I had a quick look and it looks good to me... If you haven't already done so, I would ask you to play around with these changes locally a bit. In particular, I would check if the PromptNode still detects the appropriate invocation layers |
Co-authored-by: Agnieszka Marzec <[email protected]>
So I've tested the following manually:
I'll finish the last one in the meantime. @anakin87 would you have one final look? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@viveksilimkhan1 thanks a lot for this contribution 🚀 ! I had to change a few things regarding streaming support, but now we're good to merge. |
* Add Bedrock * Update supported models for Bedrock * Fix supports and add extract response in Bedrock * fix errors imports * improve and refactor supports * fix install * fix mypy * fix pylint * fix existing tests * Added Anthropic Bedrock * fix tests * fix sagemaker tests * add default prompt handler, constructor and supports tests * more tests * invoke refactoring * refactor model_kwargs * fix mypy * lstrip responses * Add streaming support * bump boto3 version * add class docstrings, better exception names * fix layer name * add tests for anthropic and cohere model adapters * update cohere params * update ai21 args and add tests * support cohere command light model * add tital tests * better class names * support meta llama 2 model * fix streaming support * more future-proof model adapter selection * fix import * fix mypy * fix pylint for preview * add tests for streaming * add release notes * Apply suggestions from code review Co-authored-by: Agnieszka Marzec <[email protected]> * fix format * fix tests after msg changes * fix streaming for cohere --------- Co-authored-by: tstadel <[email protected]> Co-authored-by: tstadel <[email protected]> Co-authored-by: Agnieszka Marzec <[email protected]>
Related Issues
Proposed Changes:
Added support for Amazon Bedrock Models
AmazonBedrockInvocationLayer
AWSBaseInvocationLayer
How did you test it?
Notes for the reviewer
Checklist
fix:
,feat:
,build:
,chore:
,ci:
,docs:
,style:
,refactor:
,perf:
,test:
.