Skip to content

Commit

Permalink
chore(docs): use client instead of package name in Node examples (#469)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] committed Jul 29, 2024
1 parent 879d9da commit 4d899d9
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The full API of this library can be found in [api.md](api.md).
```js
import Anthropic from '@anthropic-ai/sdk';

const anthropic = new Anthropic({
const client = new Anthropic({
apiKey: process.env['ANTHROPIC_API_KEY'], // This is the default and can be omitted
});

Expand All @@ -44,7 +44,7 @@ We provide support for streaming responses using Server Sent Events (SSE).
```ts
import Anthropic from '@anthropic-ai/sdk';

const anthropic = new Anthropic();
const client = new Anthropic();

const stream = await anthropic.messages.create({
max_tokens: 1024,
Expand All @@ -68,7 +68,7 @@ This library includes TypeScript definitions for all request params and response
```ts
import Anthropic from '@anthropic-ai/sdk';

const anthropic = new Anthropic({
const client = new Anthropic({
apiKey: process.env['ANTHROPIC_API_KEY'], // This is the default and can be omitted
});

Expand Down Expand Up @@ -193,7 +193,7 @@ You can use the `maxRetries` option to configure or disable this:
<!-- prettier-ignore -->
```js
// Configure the default for all requests:
const anthropic = new Anthropic({
const client = new Anthropic({
maxRetries: 0, // default is 2
});

Expand All @@ -210,7 +210,7 @@ Requests time out after 10 minutes by default. You can configure this with a `ti
<!-- prettier-ignore -->
```ts
// Configure the default for all requests:
const anthropic = new Anthropic({
const client = new Anthropic({
timeout: 20 * 1000, // 20 seconds (default is 10 minutes)
});

Expand All @@ -235,7 +235,7 @@ Be aware that doing so may result in incorrect types and other unexpected or und
```ts
import Anthropic from '@anthropic-ai/sdk';

const anthropic = new Anthropic();
const client = new Anthropic();

const message = await anthropic.messages.create(
{
Expand All @@ -257,7 +257,7 @@ You can also use the `.withResponse()` method to get the raw `Response` along wi

<!-- prettier-ignore -->
```ts
const anthropic = new Anthropic();
const client = new Anthropic();

const response = await anthropic.messages
.create({
Expand Down Expand Up @@ -376,7 +376,7 @@ import http from 'http';
import { HttpsProxyAgent } from 'https-proxy-agent';

// Configure the default for all requests:
const anthropic = new Anthropic({
const client = new Anthropic({
httpAgent: new HttpsProxyAgent(process.env.PROXY_URL),
});

Expand Down

0 comments on commit 4d899d9

Please sign in to comment.