mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-27 08:58:48 +00:00
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 "<stdin>", line 1, in <module> 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`?
This commit is contained in:
parent
ab1a3cccac
commit
6fafcd0a70
@ -28,7 +28,7 @@ class AI21(LLM, BaseModel):
|
|||||||
Example:
|
Example:
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
from langchain import AI21
|
from langchain.llms import AI21
|
||||||
ai21 = AI21(model="j1-jumbo")
|
ai21 = AI21(model="j1-jumbo")
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user