I have found that adapter packages like LangChain tend to add support for Anthropic model features in langchain-anthropic
before they add support for the equivalent features for Bedrock’s Anthropic model deployments in langchain-aws
.
For example, LangChain has supported Anthropic structured output for a while now; see Anthropic function calling for structured LLM outputs – YouTube, and yet as you can see, the compatibility table at https://python.langchain.com/v0.2/docs/integrations/chat/ shows that it’s available in ChatAnthropic
but not ChatBedrock
.
This isn’t the first time I’ve come across this; the same was true for .bind_tools()
support.
At a conceptual level, I’m seeking to understand whether this lag is due to any technical differences between the Bedrock Claude APIs and the Anthropic Claude APIs. If they are the same (for certain model strings like anthropic.claude-3-sonnet-20240229-v1:0
, for example), then why is there a lag? I’m seeking to know how I can monkey patch the same behavior into the Bedrock classes.
I’m not the only one asking about this; see also Langchain workaround for with_structured_output using ChatBedrock which discussed a workaround that involved not using langchain.
So – concretely, how do I verify whether and in what conditions certain API calls are possible in anthropic’s API but not in Bedrock’s? Is there documentation on this? I haven’t been able to find a compatibility table to date.