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`?
searx-api
trigaten 1 year ago committed by GitHub
parent ab1a3cccac
commit 6fafcd0a70
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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")
"""

Loading…
Cancel
Save