From 6a1a56c6ebc306b42af360e1a668832941d105bf Mon Sep 17 00:00:00 2001 From: Jeremy Tuloup Date: Sun, 9 Jun 2024 19:09:00 +0200 Subject: [PATCH] Fix import deprecations --- packages/jupyter-ai-magics/jupyter_ai_magics/providers.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/jupyter-ai-magics/jupyter_ai_magics/providers.py b/packages/jupyter-ai-magics/jupyter_ai_magics/providers.py index bef7efacc..3ece92180 100644 --- a/packages/jupyter-ai-magics/jupyter_ai_magics/providers.py +++ b/packages/jupyter-ai-magics/jupyter_ai_magics/providers.py @@ -20,8 +20,6 @@ from jsonpath_ng import parse from langchain.chat_models.base import BaseChatModel -from langchain.llms.sagemaker_endpoint import LLMContentHandler -from langchain.llms.utils import enforce_stop_tokens from langchain.prompts import ( ChatPromptTemplate, HumanMessagePromptTemplate, @@ -44,6 +42,7 @@ SagemakerEndpoint, Together, ) +from langchain_community.llms.sagemaker_endpoint import LLMContentHandler # this is necessary because `langchain.pydantic_v1.main` does not include # `ModelMetaclass`, as it is not listed in `__all__` by the `pydantic.main`