From 6fafcd0a7056f9eda42f5726ccc098d52943d0c1 Mon Sep 17 00:00:00 2001 From: trigaten Date: Fri, 17 Feb 2023 02:13:34 -0500 Subject: [PATCH] Strange behavior with LLM import requirements (#1104) This import works fine: ```python from langchain import Anthropic ``` This import does not: ```python from langchain import AI21 ``` ``` Traceback (most recent call last): File "", line 1, in ImportError: cannot import name 'AI21' from 'langchain' (/opt/anaconda3/envs/fed_nlp/lib/python3.9/site-packages/langchain/__init__.py) ``` I think there is a slight documentation inconsistency here: https://langchain.readthedocs.io/en/latest/reference/modules/llms.html This PR starts to solve that. Should all the import examples be `from langchain.llms import X` instead of `from langchain import X`? --- langchain/llms/ai21.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/langchain/llms/ai21.py b/langchain/llms/ai21.py index e0b804c8..169718e2 100644 --- a/langchain/llms/ai21.py +++ b/langchain/llms/ai21.py @@ -28,7 +28,7 @@ class AI21(LLM, BaseModel): Example: .. code-block:: python - from langchain import AI21 + from langchain.llms import AI21 ai21 = AI21(model="j1-jumbo") """