client-bedrock-runtime: Same request via InvokeModelWithResponseStreamCommand throws different exceptions depending on the model used #6266
Labels
bug
This issue is a bug.
p2
This is a standard priority issue
service-api
This issue is due to a problem in a service API, not the SDK implementation.
Checkboxes for prior research
Describe the bug
When sending a request that exceeds the allowed token count:
anthropic.claude-3-haiku-20240307-v1:0
will throw aValidationException
with a descriptive message:ValidationException: Input is too long for requested model.
anthropic.claude-3-opus-20240229-v1:0
will throw aModelStreamErrorException
with a generic message:The system encountered an unexpected error during processing. Try your request again.
SDK version number
@aws-sdk/[email protected]
Which JavaScript Runtime is this issue in?
Node.js
Details of the browser/Node.js/ReactNative version
v20.11.0
Reproduction Steps
Sending a request that exceeds the allowed token count and examine the exception thrown.
Observed Behavior
anthropic.claude-3-haiku-20240307-v1:0
will throw aValidationException
with a descriptive message:ValidationException: Input is too long for requested model.
anthropic.claude-3-opus-20240229-v1:0
will throw aModelStreamErrorException
with a generic message:The system encountered an unexpected error during processing. Try your request again.
Expected Behavior
The same exception type for both models, with information that allows us to respond correctly.
Possible Solution
No response
Additional Information/Context
No response
The text was updated successfully, but these errors were encountered: