Skip to content

Commit 7d8b8ac

Browse files
committed
docs: more beta updates
1 parent 5305cdb commit 7d8b8ac

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -126,14 +126,14 @@ Alternatively, you can use `client.messages.create({ ..., stream: true })` which
126126

127127
## Message Batches
128128

129-
This SDK provides beta support for the [Message Batches API](https://docs.anthropic.com/en/docs/build-with-claude/message-batches) under the `client.messages.batches` namespace.
129+
This SDK provides support for the [Message Batches API](https://docs.anthropic.com/en/docs/build-with-claude/message-batches) under the `client.messages.batches` namespace.
130130

131131
### Creating a batch
132132

133133
Message Batches takes an array of requests, where each object has a `custom_id` identifier, and the exact same request `params` as the standard Messages API:
134134

135135
```ts
136-
await anthropic.beta.messages.batches.create({
136+
await anthropic.messages.batches.create({
137137
requests: [
138138
{
139139
custom_id: 'my-first-request',
@@ -160,7 +160,7 @@ await anthropic.beta.messages.batches.create({
160160
Once a Message Batch has been processed, indicated by `.processing_status === 'ended'`, you can access the results with `.batches.results()`
161161

162162
```ts
163-
const results = await anthropic.beta.messages.batches.results(batch_id);
163+
const results = await anthropic.messages.batches.results(batch_id);
164164
for await (const entry of results) {
165165
if (entry.result.type === 'succeeded') {
166166
console.log(entry.result.message.content);
@@ -352,22 +352,22 @@ List methods in the Anthropic API are paginated.
352352
You can use the `for await … of` syntax to iterate through items across all pages:
353353

354354
```ts
355-
async function fetchAllBetaMessageBatches(params) {
356-
const allBetaMessageBatches = [];
355+
async function fetchAllMessageBatches(params) {
356+
const allMessageBatches = [];
357357
// Automatically fetches more pages as needed.
358-
for await (const betaMessageBatch of client.messages.batches.list({ limit: 20 })) {
359-
allBetaMessageBatches.push(betaMessageBatch);
358+
for await (const messageBatch of client.messages.batches.list({ limit: 20 })) {
359+
allMessageBatches.push(messageBatch);
360360
}
361-
return allBetaMessageBatches;
361+
return allMessageBatches;
362362
}
363363
```
364364

365365
Alternatively, you can request a single page at a time:
366366

367367
```ts
368368
let page = await client.messages.batches.list({ limit: 20 });
369-
for (const betaMessageBatch of page.data) {
370-
console.log(betaMessageBatch);
369+
for (const messageBatch of page.data) {
370+
console.log(messageBatch);
371371
}
372372

373373
// Convenience methods are provided for manually paginating:

0 commit comments

Comments
 (0)