Skip to content
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

Issues with: inference/cross-region-inference/Getting_started_with_Cross-region_Inference.ipynb #297

Open
wilalbto opened this issue Sep 10, 2024 · 1 comment

Comments

@wilalbto
Copy link

After installing:

!pip install --quiet langchain_aws langchain_community

Then, running:

from langchain_aws import ChatBedrockConverse

messages = [
    (
        "system",
        "You are a helpful assistant that shapes sentences into poetic form. Translate the user sentence.",
    ),
    ("human", "I love programming."),
]

llm = ChatBedrockConverse(
    model='us.anthropic.claude-3-sonnet-20240229-v1:0',
    temperature=0,
    max_tokens=None,
    client=bedrock_runtime,
)

print(llm.invoke(messages).content)

I am getting the error:

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
Cell In[5], line 1
----> 1 from langchain_aws import ChatBedrockConverse
      3 messages = [
      4     (
      5         "system",
   (...)
      8     ("human", "I love programming."),
      9 ]
     11 llm = ChatBedrockConverse(
     12     model='us.anthropic.claude-3-sonnet-20240229-v1:0',
     13     temperature=0,
     14     max_tokens=None,
     15     client=bedrock_runtime,
     16 )

ImportError: cannot import name 'ChatBedrockConverse' from 'langchain_aws' ([/opt/conda/lib/python3.10/site-packages/langchain_aws/__init__.py](https://x4kaivqtuvti2g3.studio.us-east-1.sagemaker.aws/opt/conda/lib/python3.10/site-packages/langchain_aws/__init__.py))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants