0.9.7 • Published 4 days ago

@anthropic-ai/bedrock-sdk v0.9.7

Weekly downloads
-
License
MIT
Repository
github
Last release
4 days ago

Anthropic Bedrock TypeScript API Library

NPM version

This library provides convenient access to the Anthropic Bedrock API.

For the non-Bedrock Anthropic API at api.anthropic.com, see @anthropic-ai/sdk.

Installation

npm install @anthropic-ai/bedrock-sdk

Usage

import { AnthropicBedrock } from '@anthropic-ai/bedrock-sdk';

// Note: this assumes you have configured AWS credentials in a way
// that the AWS Node SDK will recognise, typicaly a shared `~/.aws/credentials`
// file or `AWS_ACCESS_KEY_ID` & `AWS_SECRET_ACCESS_KEY` environment variables.
//
// https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/setting-credentials-node.html
const anthropic = new AnthropicBedrock();

async function main() {
  const message = await anthropic.messages.create({
    model: 'anthropic.claude-3-sonnet-20240229-v1:0',
    messages: [
      {
        role: 'user',
        content: 'Hello!',
      },
    ],
    max_tokens: 1024,
  });
  console.log(message);
}

main();

For more details on how to use the SDK, see the README.md for the main Anthropic SDK which this library extends.

Requirements

TypeScript >= 4.5 is supported.

The following runtimes are supported:

  • Node.js 18 LTS or later (non-EOL) versions.
  • Deno v1.28.0 or higher, using import { AnthropicBedrock } from "npm:@anthropic-ai/bedrock-sdk".
  • Bun 1.0 or later.
  • Cloudflare Workers.
  • Vercel Edge Runtime.
  • Jest 28 or greater with the "node" environment ("jsdom" is not supported at this time).
  • Nitro v2.6 or greater.

Note that React Native is not supported at this time.

If you are interested in other runtime environments, please open or upvote an issue on GitHub.

0.9.7

4 days ago

0.9.6

1 month ago

0.9.4

1 month ago

0.9.3

1 month ago

0.9.5

1 month ago

0.9.2

1 month ago

0.9.1

2 months ago

0.9.0

2 months ago

0.8.0

2 months ago

0.7.1

3 months ago

0.7.0

3 months ago

0.6.5

3 months ago

0.6.4

4 months ago

0.6.3

4 months ago

0.6.2

4 months ago

0.6.1

5 months ago

0.6.0

5 months ago

0.5.0

6 months ago

0.5.2

5 months ago

0.5.1

6 months ago

0.4.1

6 months ago

0.4.0

6 months ago

0.3.0

7 months ago

0.2.0

7 months ago

0.1.0

7 months ago