buhe/langchain-swift

Add support for Bedrock

sebsto opened this issue · 6 comments

sebsto commented

I am new to this project and still learning the ropes :-)
What would be required to add support for Amazon Bedrock, like https://python.langchain.com/docs/integrations/llms/bedrock

Happy to contribute with a PR

buhe commented

Thank you!
Looking forward to your PR, if there is anything need help please do not hesitate to say.

buhe commented

I've used https://github.com/soto-project/soto and hope it helps

sebsto commented

@buhe that was my next question. This PR would bring a very large dependency in.
I was planning to use the AWS SDK for Swift (https://github.com/awslabs/aws-sdk-swift), Soto would work too if it has been updated to include Bedrock API.
I also have a "mini-SDK" working, just for Bedrock, with just one dependency to generate the AWS signature in the header. This is much lighter but would require to manually add Bedrock API if they are going to add more in the future.

My preference in terms of future maintainability is to bring in the AWS SDK for Swift. But that will significantly increase swift package resolve and swift build time for everybody.

What do you think ?

buhe commented

I also feel that the AWS SDK should be introduced as a dependency. As for the size, and at some point later we can split the project into langchain-swift, langchain-swift-ext1, langchain-swift-ext2. Langchain-swift as the core contains superclass and basic implementation, the rest can be put into langchain-swift-ext1 and dependency on langchain-swift, so that users can choose for themselves.

What do you think?

buhe commented

@sebsto Is there anything I can do to help?

sebsto commented

@buhe - I am busy at work until Dec. 7th. Will test and report here after that date.