langchain4j / langchain4j

Java version of LangChain
https://docs.langchain4j.dev
Apache License 2.0
5k stars 998 forks source link

[FEATURE] Use Converse API instead of InvokeModel API for Amazon Bedrock integrations #1789

Open AndrewSerbin opened 2 months ago

AndrewSerbin commented 2 months ago

Currently, Langchain4j’s Amazon Bedrock integration utilizes the InvokeModel API. Amazon has introduced the Converse API, which provides a consistent interface that works with all models that support messages. https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html

langchain4j commented 2 months ago

@AndrewSerbin sounds great! Would you like to implement this? 🙏

herbert-beckman commented 2 months ago

@langchain4j see my example in issue #1074. I propose a new architecture to implement the converse API or create a new package.

langchain4j commented 2 months ago

@herbert-beckman if converse API uses the same SDK, I would keep it in langchain4j-bedrock module. We could create BedrockChatModel that could eventually be used instead of all Bedrock{Model}ChatModel classes. WDYT?

herbert-beckman commented 2 months ago

I agree. However, some details still remain from the models, such as the input schemas and inference configs. I'm going to open a PR with the proposal.

langchain4j commented 2 months ago

@herbert-beckman awesome, thank you!

langchain4j commented 4 weeks ago

Hi @herbert-beckman, any news regarding this? Thanks!

herbert-beckman commented 3 weeks ago

Hello @langchain4j. No news. I haven't been able to focus on it yet.

herbert-beckman commented 2 weeks ago

@langchain4j I opened the draft PR. Please, if you can already suggest any changes, I'd appreciate it. Thank you!

langchain4j commented 2 weeks ago

@herbert-beckman great, thank you! ❤️ Looks good from the first glance, I will take a deeper look this week!