Skip to content

Commit 7bd4594

Browse files
committed
chore(internal): formatting fixes
1 parent b36623f commit 7bd4594

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

.github/workflows/create-releases.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,3 @@ jobs:
4141
env:
4242
DATA: ${{ toJSON(steps.release.outputs) }}
4343
NPM_TOKEN: ${{ secrets.ANTHROPIC_NPM_TOKEN || secrets.NPM_TOKEN }}
44-

.github/workflows/release-doctor.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,3 @@ jobs:
2121
env:
2222
STAINLESS_API_KEY: ${{ secrets.STAINLESS_API_KEY }}
2323
NPM_TOKEN: ${{ secrets.ANTHROPIC_NPM_TOKEN || secrets.NPM_TOKEN }}
24-

README.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ await anthropic.beta.messages.batches.create({
163163
});
164164
```
165165

166-
167166
### Getting results from a batch
168167

169168
Once a Message Batch has been processed, indicated by `.processing_status === 'ended'`, you can access the results with `.batches.results()`
@@ -172,7 +171,7 @@ Once a Message Batch has been processed, indicated by `.processing_status === 'e
172171
const results = await anthropic.beta.messages.batches.results(batch_id);
173172
for await (const entry of results) {
174173
if (entry.result.type === 'succeeded') {
175-
console.log(entry.result.message.content)
174+
console.log(entry.result.message.content);
176175
}
177176
}
178177
```
@@ -234,11 +233,14 @@ Error codes are as follows:
234233
All object responses in the SDK provide a `_request_id` property which is added from the `request-id` response header so that you can quickly log failing requests and report them back to Anthropic.
235234

236235
```ts
237-
const message = await client.messages.create({ max_tokens: 1024, messages: [{ role: 'user', content: 'Hello, Claude' }], model: 'claude-3-5-sonnet-latest' });
238-
console.log(completion._request_id) // req_018EeWyXxfu5pfWkrYcMdjWG
236+
const message = await client.messages.create({
237+
max_tokens: 1024,
238+
messages: [{ role: 'user', content: 'Hello, Claude' }],
239+
model: 'claude-3-5-sonnet-latest',
240+
});
241+
console.log(completion._request_id); // req_018EeWyXxfu5pfWkrYcMdjWG
239242
```
240243

241-
242244
### Retries
243245

244246
Certain errors will be automatically retried 2 times by default, with a short exponential backoff.
@@ -263,12 +265,14 @@ await client.messages.create({ max_tokens: 1024, messages: [{ role: 'user', cont
263265
### Timeouts
264266

265267
By default requests time out after 10 minutes. However if you have specified a large `max_tokens` value and are
266-
*not* streaming, the default timeout will be calculated dynamically using the formula:
268+
_not_ streaming, the default timeout will be calculated dynamically using the formula:
269+
267270
```typescript
268271
const minimum = 10 * 60;
269272
const calculated = (60 * 60 * maxTokens) / 128_000;
270273
return calculated < minimum ? minimum * 1000 : calculated * 1000;
271274
```
275+
272276
which will result in a timeout up to 60 minutes, scaled by the `max_tokens` parameter, unless overriden at the request or client level.
273277

274278
You can configure this with a `timeout` option:

0 commit comments

Comments
 (0)