File size: 1,014 Bytes
2e44b1a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# AI21 Labs

>[AI21 Labs](https://www.ai21.com/about) is a company specializing in Natural 
> Language Processing (NLP), which develops AI systems 
> that can understand and generate natural language.

This page covers how to use the `AI21` ecosystem within `LangChain`.

## Installation and Setup

- Get an AI21 api key and set it as an environment variable (`AI21_API_KEY`)
- Install the Python package:

```bash
pip install langchain-ai21
```

## Chat models

### AI21 Chat 

See a [usage example](/docs/integrations/chat/ai21).

```python
from langchain_ai21 import ChatAI21
```

## Deprecated features

:::caution The following features are deprecated. 
:::

### AI21 LLM

```python
from langchain_ai21 import AI21LLM
```

### AI21 Contextual Answer

```python
from langchain_ai21 import AI21ContextualAnswers
```

### AI21 Embeddings

```python
from langchain_ai21 import AI21Embeddings
```
## Text splitters

### AI21 Semantic Text Splitter

```python
from langchain_ai21 import AI21SemanticTextSplitter
```