langchain-ai / langchain-aws

Build LangChain Applications on AWS
MIT License
106 stars 88 forks source link

fix(bedrock): Correct Cross-Region Inference Identifiers #278

Open watany-dev opened 1 week ago

watany-dev commented 1 week ago

Inference endpoints in the Asia-Pacific region now correctly identify model IDs starting with the apac prefix. This update ensures that region-specific identifiers are parsed and processed accurately for cross-region inference.

ex. https://dev.classmethod.jp/articles/amazon-bedrock-cross-region-inference-apac/

paikwiki commented 6 days ago

I also encountered this issue. When using the “apac” region prefix in its current state, the following error occurs:

NotImplementedError: Provider apac model does not support chat.
env/lib/python3.11/site-packages/langchain_aws/chat_models/bedrock.py:362: NotImplementedError

The cause of this error is that the “apac” region prefix is not recognized and is mistakenly interpreted as a provider name. This seems to be an issue that needs to be fixed quickly.