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
Exposing more boto3 client options to ChatBedrock and doc example? #29
Comments
@P1llus |
@3coins Ah yeah that is true about the defaults, might be a bit overkill to change it like that. I think something in-between would be if its possible for us to detect the underlying issue with some sort of logging. I am unsure if this is how boto3 logs it as well or if its the ChatBedrock class that don't surface information like that? |
Yes, totally makes sense, exception handling is not the best at the moment and we can improve that. I have to check if there is a separate exception thrown by the API that we can surface here. |
With the addition of the opus model support on Bedrock, which generally tends to always hit the default timeout options, would it be okay to add the different retry/timeout options from boto3 as common options to ChatBedrock?
Currently we have support for a few common keys here: https://github.com/langchain-ai/langchain-aws/blob/main/libs/aws/langchain_aws/llms/bedrock.py#L300.
However just changing from
Claude 2/2.1
orClaude 3 Sonnet
toOpus
increases the runtime mostly by 10x (mine are consistently around 20-35 seconds on old models to 200+ seconds with Opus)..UPDATE:
Later it also turns out many of the timeouts reported by boto3 was actually general throttling (as seen in bedrock logs), however there was no logs or errors indicating any throttling happening, just reported as a timeout.
Changing the timeout settings + upping the max_attempts was necessary to even get it to retry properly it seems.
I would assume that once more people start using this new library, and depending on the popularity of Opus, a few changes are recommended:
boto3
client options available as arguments toChatBedrock/BedrockBase
, so that developers can instantly see them as a supported list of arguments when developing using this chat model.boto3
options that would work withBedrock
, and a small example on how to create a customBotocore.config.Config()
object that can be passed to the existingconfig
argument would be greatly appreciated. I did get it working through trial and error, but only from boto3 examples directly and not from langchain issues or docs.The text was updated successfully, but these errors were encountered: