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

Amazon Bedrock Workshop - [Bug] #256

Open
codekiln opened this issue May 20, 2024 · 2 comments
Open

Amazon Bedrock Workshop - [Bug] #256

codekiln opened this issue May 20, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@codekiln
Copy link

codekiln commented May 20, 2024

Describe the bug
In the code cell below ### Invoke Langchain with Chain using BedrockChat class in 06_OpenSource_examples/05_OpenSource_agents/01_tools_agents.ipynb, there's a deprecation warning:

/Users/pnore/Library/Caches/pypoetry/virtualenvs/genai-langserve-IOUqE2kZ-py3.11/lib/python3.11/site-packages/langchain_core/_api/deprecation.py:119: LangChainDeprecationWarning: The class `BedrockChat` was deprecated in LangChain 0.0.34 and will be removed in 0.3. An updated version of the class exists in the langchain-aws package and should be used instead. To use it run `pip install -U langchain-aws` and import as `from langchain_aws import ChatBedrock`.

Also, in the code cell that contains llm_math_chain({'question': 'text 4**5'}) there's another more pressing deprecation:

LangChainDeprecationWarning: The method `Chain.__call__` was deprecated in langchain 0.1.0 and will be removed in 0.2.0. Use invoke instead.
  warn_deprecated(

In the cell ask_agent("can you check the weather in Marysville WA for me?", react_agent_llm) there's another langchain 0.2.0 deprecation warning:

LangChainDeprecationWarning: The function `initialize_agent` was deprecated in LangChain 0.1.0 and will be removed in 0.2.0. Use Use new agent constructor methods like create_react_agent, create_json_agent, create_structured_chat_agent, etc. instead.
  warn_deprecated(

Note: the code continues to function for now.

Other places in this notebook (correctly, for now) use from langchain_aws.chat_models.bedrock import ChatBedrock.

To Reproduce
Steps to reproduce the behavior (or some version of this):

  1. Go to 06_OpenSource_examples/05_OpenSource_agents/01_tools_agents.ipynb
  2. Run all cells above ### Invoke Langchain with \Chain` using BedrockChat class`
  3. Run the code cell immediately before
  4. See warning

Expected behavior
Latest, non-deprecated version of langchain-aws's bedrock adapter used

Screenshots
image

Desktop (please complete the following information):

  • OS: MacOS
  • Browser PyCharm integrated
  • Version 1adcb9f
@codekiln codekiln added the bug Something isn't working label May 20, 2024
@w601sxs
Copy link
Contributor

w601sxs commented May 29, 2024

Can you take a look @rsgrewal-aws ?

@rsgrewal-aws
Copy link
Contributor

rsgrewal-aws commented May 29, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants