Skip to content

Commit 61542a0

Browse files
committed
feat: readme
1 parent a03d6b6 commit 61542a0

File tree

1 file changed

+9
-32
lines changed

1 file changed

+9
-32
lines changed

README.md

Lines changed: 9 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ For convenience, you can use `createAndPoll()` which automatically waits for com
140140
const result = await client.beta.maestro.runs.createAndPoll(
141141
{
142142
input: 'Write a comprehensive report on AI trends in 2024',
143-
tools: ['web_search'],
143+
tools: [{ type: 'web_search' }],
144144
budget: 'medium',
145145
},
146146
{
@@ -161,18 +161,17 @@ const advancedRun = await client.beta.maestro.runs.createAndPoll({
161161
input: 'Research sustainable energy solutions',
162162

163163
// Specify tools to use
164-
tools: ['web_search', 'file_search'],
165-
166-
// Configure tool resources
167-
tool_resources: {
168-
web_search: {
164+
tools: [
165+
{
166+
type: 'web_search',
169167
urls: ['https://example.com', 'https://research.org'],
170168
},
171-
file_search: {
169+
{
170+
type: 'file_search',
172171
file_ids: ['file-123', 'file-456'],
173172
labels: ['research', 'energy'],
174173
},
175-
},
174+
],
176175

177176
// Define specific requirements
178177
requirements: [
@@ -212,35 +211,13 @@ const structuredRun = await client.beta.maestro.runs.create({
212211
{ role: 'system', content: 'You are a research assistant specializing in technology trends.' },
213212
{ role: 'user', content: 'What are the emerging AI technologies in healthcare?' },
214213
],
215-
tools: ['web_search'],
216-
});
217-
```
218-
219-
---
220-
221-
### Files
222-
223-
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.
224-
225-
```typescript
226-
import { AI21 } from 'ai21';
227-
228-
const client = new AI21({
229-
apiKey: process.env.AI21_API_KEY, // or pass it in directly
214+
tools: [{ type: 'web_search' }],
230215
});
231-
232-
const fileUploadResponse = await client.files.create({
233-
file: './articles/article1.pdf',
234-
labels: ['science', 'biology'],
235-
path: 'virtual-path/to/science-articles',
236-
});
237-
238-
const file = await client.files.get(fileUploadResponse.fileId);
239216
```
240217

241218
---
242219

243-
### Conversational-RAG
220+
## Conversational RAG (Beta)
244221

245222
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.
246223

0 commit comments

Comments
 (0)