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

Fix import deprecations #824

Merged
merged 1 commit into from
Jun 11, 2024
Merged

Fix import deprecations #824

merged 1 commit into from
Jun 11, 2024

Conversation

jtpio
Copy link
Member

@jtpio jtpio commented Jun 9, 2024

Fix a couple of deprecation warnings logged at JupyterLab startup:

PREFIX/envs/jupyter-ai/lib/python3.11/site-packages/langchain/_api/module_import.py:120: LangChainDeprecationWarning: Importing LLMContentHandler from langchain.llms is deprecated. Please replace deprecated imports:

>> from langchain.llms import LLMContentHandler

with new imports of:

>> from langchain_community.llms.sagemaker_endpoint import LLMContentHandler

  warn_deprecated(
PREFIX/envs/jupyter-ai/lib/python3.11/site-packages/langchain/_api/module_import.py:120: LangChainDeprecationWarning: Importing enforce_stop_tokens from langchain.llms is deprecated. Please replace deprecated imports:

>> from langchain.llms import enforce_stop_tokens

with new imports of:

>> from langchain_community.llms.utils import enforce_stop_tokens

@jtpio jtpio added the maintenance Change related to maintenance of the repository label Jun 9, 2024
Copy link
Member

@krassowski krassowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - I confirmed enforce_stop_tokens is not used and LLMContentHandler can be imported from from langchain_community.llms.sagemaker_endpoint in the lowest required version of langchain , thank you @jtpio!

Copy link
Member

@dlqqq dlqqq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work @jtpio! Thank you @krassowski for reviewing & confirming as well.

@dlqqq dlqqq enabled auto-merge (squash) June 11, 2024 18:43
@dlqqq dlqqq merged commit ab3e9eb into jupyterlab:main Jun 11, 2024
8 checks passed
@jtpio jtpio deleted the deprecations branch June 11, 2024 18:59
Marchlak pushed a commit to Marchlak/jupyter-ai that referenced this pull request Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Change related to maintenance of the repository
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants