You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The AI21 API Client is a TypeScript library that provides a convenient interface for interacting with the AI21 API. It abstracts away the low-level details of making API requests and handling responses, allowing developers to focus on building their applications.
4
24
@@ -16,7 +36,22 @@ or
16
36
yarn add ai21
17
37
```
18
38
19
-
## Usage
39
+
## Examples (tl;dr)
40
+
41
+
If you want to quickly get a glance how to use the AI21 Python SDK and jump straight to business, you can check out the examples. Take a look at our models and see them in action! Several examples and demonstrations have been put together to show our models' functionality and capabilities.
42
+
43
+
### [Check out the Examples](examples/)
44
+
45
+
Feel free to dive in, experiment, and adapt these examples to suit your needs. We believe they'll help you get up and running quickly.
46
+
47
+
## Documentation
48
+
49
+
---
50
+
51
+
The full documentation for the REST API can be found on [docs.ai21.com](https://docs.ai21.com/).
52
+
53
+
54
+
## Chat-Usage
20
55
21
56
To use the AI21 API Client, you'll need to have an API key. You can obtain an API key by signing up for an account on the AI21 website.
22
57
@@ -46,7 +81,7 @@ The client supports streaming responses for real-time processing. Here are examp
The `AI21` class provides a `files` property that gives you access to the Files API. You can use this to upload files to the AI21 Studio, which can then be utilized as context for the conversational RAG engine
98
+
The `AI21` class provides a `files` property that gives you access to the Files API. You can use it to upload, retrieve, update, list, and delete files.
The `AI21` class provides a `conversationalRag` property that gives you access to the Conversational RAG API. You can use it to ask questions that are answered based on the files you uploaded.
124
+
125
+
126
+
```typescript
127
+
import { AI21 } from'ai21';
128
+
129
+
const client =newAI21({
130
+
apiKey: process.env.AI21_API_KEY, // or pass it in directly
0 commit comments