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` 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.
114
+
AI21 Maestro is an advanced AI orchestration platform that can intelligently use tools and manage complex workflows. The `AI21` class provides a `beta.maestro` property that gives you access to the Maestro API.
113
115
116
+
### Basic Usage
114
117
115
118
```typescript
116
119
import { AI21 } from'ai21';
117
120
118
121
const client =newAI21({
119
-
apiKey: process.env.AI21_API_KEY,// or pass it in directly
{ role: 'system', content: 'You are a research assistant specializing in technology trends.' },
212
+
{ role: 'user', content: 'What are the emerging AI technologies in healthcare?' },
213
+
],
214
+
tools: [{ type: 'web_search' }],
215
+
});
131
216
```
132
217
133
218
---
134
-
### Conversational-RAG
135
219
220
+
## Conversational RAG (Beta)
136
221
137
222
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.
messages: [{ role: 'user', content: 'This question presumes that the answer can be found within the uploaded files.' }],
149
-
});
150
-
232
+
messages: [
233
+
{
234
+
role: 'user',
235
+
content: 'This question presumes that the answer can be found within the uploaded files.',
236
+
},
237
+
],
238
+
});
151
239
```
152
240
241
+
---
242
+
243
+
## Library
244
+
245
+
The `AI21` class provides a `library` property that gives you access to the Library Files API. This is a separate file management system designed for library-specific operations.
0 commit comments