Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(docs): use client instead of package name in Node examples #469

Merged
merged 1 commit into from
Jul 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -139,7 +139,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 @@ -156,7 +156,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 @@ -181,7 +181,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 @@ -203,7 +203,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 @@ -322,7 +322,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