You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Go, case statements don't fall through. So what we have here is a noop handler for the ExceptionMessageType case.
I learned this while trying to debug an empty response stream for a payload like:
"messages": [
{
"role": "user",
"content": "Tell me a good joke please."
},
{
"role": "assistant",
"content": "Sure, "
}]
}
It turns out the Bedrock API is telling the client there is an exception because the last assistant message cannot have trailing whitespace, but the exception returned by Bedrock is eaten by the noop for the ExceptionMessageType case.
This is a one-liner fix. Either update the code to:
case eventstreamapi.ExceptionMessageType:
fallthrough // <--------- add this
case eventstreamapi.ErrorMessageType:
or
case eventstreamapi.ExceptionMessageType, case eventstreamapi.ErrorMessageType:
The text was updated successfully, but these errors were encountered:
There is an error in the SDK here:
anthropic-sdk-go/bedrock/bedrock.go
Lines 99 to 100 in eafcc8d
In Go, case statements don't fall through. So what we have here is a noop handler for the
ExceptionMessageType
case.I learned this while trying to debug an empty response stream for a payload like:
It turns out the Bedrock API is telling the client there is an exception because the last assistant message cannot have trailing whitespace, but the
exception
returned by Bedrock is eaten by the noop for theExceptionMessageType
case.This is a one-liner fix. Either update the code to:
or
The text was updated successfully, but these errors were encountered: