-
Notifications
You must be signed in to change notification settings - Fork 156
ChatBedrockConverse vs ChatBedrock (difference in preparation of prompts?) #349
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
Comments
The ChatBedrockConverse uses Bedrock's new Converse API, which automatically applies prompt templating specific to the model used. The older InvokeModel API that ChatBedrock uses does not provide this functionality, so the ChatPromptAdapter is needed for prompt preprocessing. |
A small correction, InvokeModel API is just a different API that puts the onus on the developer to handle the native formatting for the model, hence the need for ChatPromptAdaptor here. Converse on the other handles the native formatting on the API backend, so simpler to use for most use cases. We (langchain-aws) have had better success with Converse, since it is easier to maintain for newer models, it is also much more complete for other use cases such as tool calling and langgraph. Let us know if you have any other questions. |
Thank you for the responses and clarification. That makes sense. If I were to want to use the Bedrock batch inference, I could use the langchain ChatPromptAdapter and then send the batch requests in via AWS? Something like this:
and then add those to the s3 records file? Or alternatively, does batch inference have an equivalent of Converse where there is a unified API? |
I believe batch inference is not supported in the same way as converse, it is in-fact a totally different API via the |
It seems like there is a difference between ChatBedrockConverse and ChatBedrock regarding the preparation of prompts.
ChatBedrock uses ChatPromptAdapter while ChatBedrockConverse does not.
Wondering if this is desired behavior or not?
The text was updated successfully, but these errors were encountered: