From 5ea6f8be0696e3753d8624f72328a5cba3a86056 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 10 Jul 2024 10:28:44 +0000 Subject: [PATCH 01/18] feat(client): make request-id header more accessible (#462) --- src/error.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/error.ts b/src/error.ts index 7f869677..b49eb8e2 100644 --- a/src/error.ts +++ b/src/error.ts @@ -9,6 +9,8 @@ export class APIError extends AnthropicError { readonly headers: Headers | undefined; readonly error: Object | undefined; + readonly request_id: string | null | undefined; + constructor( status: number | undefined, error: Object | undefined, @@ -18,6 +20,7 @@ export class APIError extends AnthropicError { super(`${APIError.makeMessage(status, error, message)}`); this.status = status; this.headers = headers; + this.request_id = headers?.['request-id']; this.error = error; } From cc405a8cc4ea26389b9d857d75818722d0bcbfcd Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 11 Jul 2024 10:22:11 +0000 Subject: [PATCH 02/18] chore(ci): also run workflows for PRs targeting `next` (#464) --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3b184362..83198e80 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,6 +6,7 @@ on: pull_request: branches: - main + - next jobs: lint: From c1fd563693bd354a81e0ae55c7355144f06b7f0b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sun, 14 Jul 2024 02:10:32 +0000 Subject: [PATCH 03/18] chore(internal): minor changes to tests (#465) --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index ff322255..3ad8fd53 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 2 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/anthropic-ce067ae8303fa9b7aae2e8ebf0b6e9e41509f169ba93c1807e6ed9c9e541be1a.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/anthropic-e2a51f04a202c13736b6fa2061a89a0c443f99ab166d965d702baf371eb1ca8f.yml From 50b9f2b0c3feb4707af2b9e5f006a3f726782803 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 15 Jul 2024 18:19:58 +0000 Subject: [PATCH 04/18] chore(docs): minor update to formatting of API link in README (#467) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 86321dde..f9b5072a 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This library provides convenient access to the Anthropic REST API from server-side TypeScript or JavaScript. -The REST API documentation can be found [on docs.anthropic.com](https://docs.anthropic.com/claude/reference/). The full API of this library can be found in [api.md](api.md). +The REST API documentation can be found on [docs.anthropic.com](https://docs.anthropic.com/claude/reference/). The full API of this library can be found in [api.md](api.md). ## Installation From 968a7fbb6cb779d17d9f6c485c0b61f241e327bc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 16 Jul 2024 13:42:20 +0000 Subject: [PATCH 05/18] chore(docs): mention lack of support for web browser runtimes (#468) --- README.md | 3 +++ src/index.ts | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index f9b5072a..807b01eb 100644 --- a/README.md +++ b/README.md @@ -419,6 +419,9 @@ The following runtimes are supported: - Jest 28 or greater with the `"node"` environment (`"jsdom"` is not supported at this time). - Nitro v2.6 or greater. +> [!WARNING] +> Web browser runtimes aren't supported. The SDK will throw an error if used in a browser environment. + 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. diff --git a/src/index.ts b/src/index.ts index 0976766d..2df0939a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -109,6 +109,12 @@ export class Anthropic extends Core.APIClient { baseURL: baseURL || `https://api.anthropic.com`, }; + if (Core.isRunningInBrowser()) { + throw new Errors.AnthropicError( + "It looks like you're running in a browser-like environment, which is disabled to protect your secret API credentials from attackers. If you have a strong business need for client-side use of this API, please open a GitHub issue with your use-case and security mitigations.", + ); + } + super({ baseURL: options.baseURL!, timeout: options.timeout ?? 600000 /* 10 minutes */, From 8961ebf54bbab898667119c8d9551e33a4de6846 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 18 Jul 2024 16:35:07 +0000 Subject: [PATCH 06/18] chore(docs): use client instead of package name in Node examples (#469) --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 807b01eb..e5d25135 100644 --- a/README.md +++ b/README.md @@ -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 }); @@ -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, @@ -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 }); @@ -193,7 +193,7 @@ You can use the `maxRetries` option to configure or disable this: ```js // Configure the default for all requests: -const anthropic = new Anthropic({ +const client = new Anthropic({ maxRetries: 0, // default is 2 }); @@ -210,7 +210,7 @@ Requests time out after 10 minutes by default. You can configure this with a `ti ```ts // Configure the default for all requests: -const anthropic = new Anthropic({ +const client = new Anthropic({ timeout: 20 * 1000, // 20 seconds (default is 10 minutes) }); @@ -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( { @@ -257,7 +257,7 @@ You can also use the `.withResponse()` method to get the raw `Response` along wi ```ts -const anthropic = new Anthropic(); +const client = new Anthropic(); const response = await anthropic.messages .create({ @@ -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), }); From b493aa49d3d6e67be22c3e8255dd4286e6bbcdeb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 18 Jul 2024 21:29:14 +0000 Subject: [PATCH 07/18] chore: sync spec (#470) --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 3ad8fd53..4f03232f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 2 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/anthropic-e2a51f04a202c13736b6fa2061a89a0c443f99ab166d965d702baf371eb1ca8f.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/anthropic-e38cd52aed438cef6e0a25eeeab8ff6000583c3cf152a10f0c3610ceb3da7b4e.yml From e1a7f9f813077fb033c732c004c7bda85738a321 Mon Sep 17 00:00:00 2001 From: Linus Gubenis Date: Tue, 23 Jul 2024 11:18:38 +0200 Subject: [PATCH 08/18] chore(docs): rename anthropic const to client (#471) and use client --- packages/bedrock-sdk/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/bedrock-sdk/README.md b/packages/bedrock-sdk/README.md index d3d93c01..f6eca6f5 100644 --- a/packages/bedrock-sdk/README.md +++ b/packages/bedrock-sdk/README.md @@ -23,10 +23,10 @@ import { AnthropicBedrock } from '@anthropic-ai/bedrock-sdk'; // 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(); +const client = new AnthropicBedrock(); async function main() { - const message = await anthropic.messages.create({ + const message = await client.messages.create({ model: 'anthropic.claude-3-sonnet-20240229-v1:0', messages: [ { From 0f6190a69d8986ac3779441eba43d345ec3fb342 Mon Sep 17 00:00:00 2001 From: Robert Craigie Date: Tue, 23 Jul 2024 10:31:19 +0100 Subject: [PATCH 09/18] chore(bedrock): use `chunk` for internal SSE parsing instead of `completion` (#472) --- packages/bedrock-sdk/src/streaming.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/bedrock-sdk/src/streaming.ts b/packages/bedrock-sdk/src/streaming.ts index 066ec5cb..01f0956b 100644 --- a/packages/bedrock-sdk/src/streaming.ts +++ b/packages/bedrock-sdk/src/streaming.ts @@ -47,7 +47,7 @@ export class Stream extends CoreStream { for await (const event of eventStream) { if (event.chunk && event.chunk.bytes) { const s = toUtf8(event.chunk.bytes); - yield { event: 'completion', data: s, raw: [] }; + yield { event: 'chunk', data: s, raw: [] }; } else if (event.internalServerException) { yield { event: 'error', data: 'InternalServerException', raw: [] }; } else if (event.modelStreamErrorException) { @@ -69,7 +69,7 @@ export class Stream extends CoreStream { let done = false; try { for await (const sse of iterMessages()) { - if (sse.event === 'completion') { + if (sse.event === 'chunk') { try { yield JSON.parse(sse.data); } catch (e) { From 6f21ecfd781d04a7dc83641f069bb38d5584a320 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 23 Jul 2024 10:32:14 +0000 Subject: [PATCH 10/18] chore(tests): update prism version (#473) --- scripts/mock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/mock b/scripts/mock index fe89a1d0..f5861576 100755 --- a/scripts/mock +++ b/scripts/mock @@ -21,7 +21,7 @@ echo "==> Starting mock server with URL ${URL}" # Run prism mock on the given spec if [ "$1" == "--daemon" ]; then - npm exec --package=@stoplight/prism-cli@~5.8 -- prism mock "$URL" &> .prism.log & + npm exec --package=@stainless-api/prism-cli@5.8.4 -- prism mock "$URL" &> .prism.log & # Wait for server to come online echo -n "Waiting for server" @@ -37,5 +37,5 @@ if [ "$1" == "--daemon" ]; then echo else - npm exec --package=@stoplight/prism-cli@~5.8 -- prism mock "$URL" + npm exec --package=@stainless-api/prism-cli@5.8.4 -- prism mock "$URL" fi From a8ca93cc40464dc76118f7dd72e94c52693f3d63 Mon Sep 17 00:00:00 2001 From: Stainless Bot Date: Tue, 23 Jul 2024 14:07:11 +0000 Subject: [PATCH 11/18] fix: use relative paths (#475) --- src/index.ts | 4 ++-- src/resource.ts | 2 +- src/resources/completions.ts | 10 +++++----- src/resources/messages.ts | 16 ++++++++-------- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/index.ts b/src/index.ts index 2df0939a..7d1072d2 100644 --- a/src/index.ts +++ b/src/index.ts @@ -3,8 +3,8 @@ import * as Errors from './error'; import * as Uploads from './uploads'; import { type Agent } from './_shims/index'; -import * as Core from '@anthropic-ai/sdk/core'; -import * as API from '@anthropic-ai/sdk/resources/index'; +import * as Core from './core'; +import * as API from './resources/index'; export interface ClientOptions { /** diff --git a/src/resource.ts b/src/resource.ts index 2763fa34..4d0a2661 100644 --- a/src/resource.ts +++ b/src/resource.ts @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import * as Core from '@anthropic-ai/sdk/core'; +import * as Core from './core'; export class APIResource { protected _client: Core.APIClient; diff --git a/src/resources/completions.ts b/src/resources/completions.ts index fb3479a2..0ecb1d44 100644 --- a/src/resources/completions.ts +++ b/src/resources/completions.ts @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import { APIResource } from '@anthropic-ai/sdk/resource'; -import { APIPromise } from '@anthropic-ai/sdk/core'; -import * as Core from '@anthropic-ai/sdk/core'; -import * as CompletionsAPI from '@anthropic-ai/sdk/resources/completions'; -import { Stream } from '@anthropic-ai/sdk/streaming'; +import { APIResource } from '../resource'; +import { APIPromise } from '../core'; +import * as Core from '../core'; +import * as CompletionsAPI from './completions'; +import { Stream } from '../streaming'; export class Completions extends APIResource { /** diff --git a/src/resources/messages.ts b/src/resources/messages.ts index e55c3c6a..76d7119c 100644 --- a/src/resources/messages.ts +++ b/src/resources/messages.ts @@ -1,13 +1,13 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import { APIResource } from '@anthropic-ai/sdk/resource'; -import { APIPromise } from '@anthropic-ai/sdk/core'; -import * as Core from '@anthropic-ai/sdk/core'; -import { MessageStream } from '@anthropic-ai/sdk/lib/MessageStream'; -import * as MessagesAPI from '@anthropic-ai/sdk/resources/messages'; -import { Stream } from '@anthropic-ai/sdk/streaming'; - -export { MessageStream } from '@anthropic-ai/sdk/lib/MessageStream'; +import { APIResource } from '../resource'; +import { APIPromise } from '../core'; +import * as Core from '../core'; +import * as MessagesAPI from './messages'; +import { Stream } from '../streaming'; +import { MessageStream } from '../lib/MessageStream'; + +export { MessageStream } from '../lib/MessageStream'; export class Messages extends APIResource { /** From d2d4e36b995cc84e8a3a7c64eb614011df399c5e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 24 Jul 2024 20:13:52 +0000 Subject: [PATCH 12/18] refactor: extract model out to a named type and rename partialjson (#477) --- .stats.yml | 2 +- api.md | 3 +- src/index.ts | 3 +- src/resources/completions.ts | 14 ++++---- src/resources/index.ts | 3 +- src/resources/messages.ts | 43 +++++++++++++++---------- tests/api-resources/completions.test.ts | 4 +-- 7 files changed, 43 insertions(+), 29 deletions(-) diff --git a/.stats.yml b/.stats.yml index 4f03232f..ff2805b6 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 2 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/anthropic-e38cd52aed438cef6e0a25eeeab8ff6000583c3cf152a10f0c3610ceb3da7b4e.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/anthropic-5903ec2fd4efd7f261908bc4ec8ecd6b19cb9efa79637ad273583f1b763f80fd.yml diff --git a/api.md b/api.md index 7c732d1d..c636b226 100644 --- a/api.md +++ b/api.md @@ -9,7 +9,7 @@ Types: - ContentBlockStartEvent - ContentBlockStopEvent - ImageBlockParam -- InputJsonDelta +- InputJSONDelta - Message - MessageDeltaEvent - MessageDeltaUsage @@ -17,6 +17,7 @@ Types: - MessageStartEvent - MessageStopEvent - MessageStreamEvent +- Model - RawContentBlockDeltaEvent - RawContentBlockStartEvent - RawContentBlockStopEvent diff --git a/src/index.ts b/src/index.ts index 7d1072d2..e2ce21c3 100644 --- a/src/index.ts +++ b/src/index.ts @@ -250,7 +250,7 @@ export namespace Anthropic { export import ContentBlockStartEvent = API.ContentBlockStartEvent; export import ContentBlockStopEvent = API.ContentBlockStopEvent; export import ImageBlockParam = API.ImageBlockParam; - export import InputJsonDelta = API.InputJsonDelta; + export import InputJSONDelta = API.InputJSONDelta; export import Message = API.Message; export import MessageDeltaEvent = API.MessageDeltaEvent; export import MessageDeltaUsage = API.MessageDeltaUsage; @@ -258,6 +258,7 @@ export namespace Anthropic { export import MessageStartEvent = API.MessageStartEvent; export import MessageStopEvent = API.MessageStopEvent; export import MessageStreamEvent = API.MessageStreamEvent; + export import Model = API.Model; export import RawContentBlockDeltaEvent = API.RawContentBlockDeltaEvent; export import RawContentBlockStartEvent = API.RawContentBlockStartEvent; export import RawContentBlockStopEvent = API.RawContentBlockStopEvent; diff --git a/src/resources/completions.ts b/src/resources/completions.ts index 0ecb1d44..fe9c2c0b 100644 --- a/src/resources/completions.ts +++ b/src/resources/completions.ts @@ -4,6 +4,7 @@ import { APIResource } from '../resource'; import { APIPromise } from '../core'; import * as Core from '../core'; import * as CompletionsAPI from './completions'; +import * as MessagesAPI from './messages'; import { Stream } from '../streaming'; export class Completions extends APIResource { @@ -53,9 +54,11 @@ export interface Completion { completion: string; /** - * The model that handled the request. + * The model that will complete your prompt.\n\nSee + * [models](https://docs.anthropic.com/en/docs/models-overview) for additional + * details and options. */ - model: string; + model: MessagesAPI.Model; /** * The reason that we stopped. @@ -88,12 +91,11 @@ export interface CompletionCreateParamsBase { max_tokens_to_sample: number; /** - * The model that will complete your prompt. - * - * See [models](https://docs.anthropic.com/en/docs/models-overview) for additional + * The model that will complete your prompt.\n\nSee + * [models](https://docs.anthropic.com/en/docs/models-overview) for additional * details and options. */ - model: (string & {}) | 'claude-2.0' | 'claude-2.1' | 'claude-instant-1.2'; + model: MessagesAPI.Model; /** * The prompt that you want Claude to complete. diff --git a/src/resources/index.ts b/src/resources/index.ts index 84f839d1..9b59bcbe 100644 --- a/src/resources/index.ts +++ b/src/resources/index.ts @@ -13,7 +13,7 @@ export { ContentBlockStartEvent, ContentBlockStopEvent, ImageBlockParam, - InputJsonDelta, + InputJSONDelta, Message, MessageDeltaEvent, MessageDeltaUsage, @@ -21,6 +21,7 @@ export { MessageStartEvent, MessageStopEvent, MessageStreamEvent, + Model, RawContentBlockDeltaEvent, RawContentBlockStartEvent, RawContentBlockStopEvent, diff --git a/src/resources/messages.ts b/src/resources/messages.ts index 76d7119c..681c829c 100644 --- a/src/resources/messages.ts +++ b/src/resources/messages.ts @@ -72,7 +72,7 @@ export namespace ImageBlockParam { } } -export interface InputJsonDelta { +export interface InputJSONDelta { partial_json: string; type: 'input_json_delta'; @@ -123,9 +123,11 @@ export interface Message { content: Array; /** - * The model that handled the request. + * The model that will complete your prompt.\n\nSee + * [models](https://docs.anthropic.com/en/docs/models-overview) for additional + * details and options. */ - model: string; + model: Model; /** * Conversational role of the generated message. @@ -202,8 +204,23 @@ export type MessageStopEvent = RawMessageStopEvent; export type MessageStreamEvent = RawMessageStreamEvent; +/** + * The model that will complete your prompt.\n\nSee + * [models](https://docs.anthropic.com/en/docs/models-overview) for additional + * details and options. + */ +export type Model = + | (string & {}) + | 'claude-3-5-sonnet-20240620' + | 'claude-3-opus-20240229' + | 'claude-3-sonnet-20240229' + | 'claude-3-haiku-20240307' + | 'claude-2.1' + | 'claude-2.0' + | 'claude-instant-1.2'; + export interface RawContentBlockDeltaEvent { - delta: TextDelta | InputJsonDelta; + delta: TextDelta | InputJSONDelta; index: number; @@ -473,20 +490,11 @@ export interface MessageCreateParamsBase { messages: Array; /** - * The model that will complete your prompt. - * - * See [models](https://docs.anthropic.com/en/docs/models-overview) for additional + * The model that will complete your prompt.\n\nSee + * [models](https://docs.anthropic.com/en/docs/models-overview) for additional * details and options. */ - model: - | (string & {}) - | 'claude-3-5-sonnet-20240620' - | 'claude-3-opus-20240229' - | 'claude-3-sonnet-20240229' - | 'claude-3-haiku-20240307' - | 'claude-2.1' - | 'claude-2.0' - | 'claude-instant-1.2'; + model: Model; /** * An object describing metadata about the request. @@ -714,7 +722,7 @@ export namespace Messages { export import ContentBlockStartEvent = MessagesAPI.ContentBlockStartEvent; export import ContentBlockStopEvent = MessagesAPI.ContentBlockStopEvent; export import ImageBlockParam = MessagesAPI.ImageBlockParam; - export import InputJsonDelta = MessagesAPI.InputJsonDelta; + export import InputJSONDelta = MessagesAPI.InputJSONDelta; export import Message = MessagesAPI.Message; export import MessageDeltaEvent = MessagesAPI.MessageDeltaEvent; export import MessageDeltaUsage = MessagesAPI.MessageDeltaUsage; @@ -722,6 +730,7 @@ export namespace Messages { export import MessageStartEvent = MessagesAPI.MessageStartEvent; export import MessageStopEvent = MessagesAPI.MessageStopEvent; export import MessageStreamEvent = MessagesAPI.MessageStreamEvent; + export import Model = MessagesAPI.Model; export import RawContentBlockDeltaEvent = MessagesAPI.RawContentBlockDeltaEvent; export import RawContentBlockStartEvent = MessagesAPI.RawContentBlockStartEvent; export import RawContentBlockStopEvent = MessagesAPI.RawContentBlockStopEvent; diff --git a/tests/api-resources/completions.test.ts b/tests/api-resources/completions.test.ts index 546dcc74..4508a959 100644 --- a/tests/api-resources/completions.test.ts +++ b/tests/api-resources/completions.test.ts @@ -12,7 +12,7 @@ describe('resource completions', () => { test('create: only required params', async () => { const responsePromise = anthropic.completions.create({ max_tokens_to_sample: 256, - model: 'claude-2.1', + model: 'string', prompt: '\n\nHuman: Hello, world!\n\nAssistant:', }); const rawResponse = await responsePromise.asResponse(); @@ -27,7 +27,7 @@ describe('resource completions', () => { test('create: required and optional params', async () => { const response = await anthropic.completions.create({ max_tokens_to_sample: 256, - model: 'claude-2.1', + model: 'string', prompt: '\n\nHuman: Hello, world!\n\nAssistant:', metadata: { user_id: '13803d75-b4b5-4c3e-b2a2-6f21399b021b' }, stop_sequences: ['string', 'string', 'string'], From 8b081613a50821b8dfa8a1251d42337a20607411 Mon Sep 17 00:00:00 2001 From: Young-Jin Park Date: Wed, 24 Jul 2024 16:16:48 -0400 Subject: [PATCH 13/18] feat: add back compat alias for InputJsonDelta --- src/resources/index.ts | 1 + src/resources/messages.ts | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/resources/index.ts b/src/resources/index.ts index 9b59bcbe..0c36e4b3 100644 --- a/src/resources/index.ts +++ b/src/resources/index.ts @@ -13,6 +13,7 @@ export { ContentBlockStartEvent, ContentBlockStopEvent, ImageBlockParam, + InputJsonDelta, InputJSONDelta, Message, MessageDeltaEvent, diff --git a/src/resources/messages.ts b/src/resources/messages.ts index 681c829c..e45f5b78 100644 --- a/src/resources/messages.ts +++ b/src/resources/messages.ts @@ -72,6 +72,8 @@ export namespace ImageBlockParam { } } +export type InputJsonDelta = InputJSONDelta; + export interface InputJSONDelta { partial_json: string; @@ -722,6 +724,7 @@ export namespace Messages { export import ContentBlockStartEvent = MessagesAPI.ContentBlockStartEvent; export import ContentBlockStopEvent = MessagesAPI.ContentBlockStopEvent; export import ImageBlockParam = MessagesAPI.ImageBlockParam; + export import InputJJsonDelta = MessagesAPI.InputJsonDelta; export import InputJSONDelta = MessagesAPI.InputJSONDelta; export import Message = MessagesAPI.Message; export import MessageDeltaEvent = MessagesAPI.MessageDeltaEvent; From 75f5710d57e6f72b6770d32d9c6dd71bbfb43d85 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 25 Jul 2024 16:29:33 +0000 Subject: [PATCH 14/18] fix(compat): remove ReadableStream polyfill redundant since node v16 (#478) Note that this breaks streaming in Node v14, which has been unsupported since v4.0.0 of this library. --- package.json | 3 +-- src/_shims/node-runtime.ts | 4 +--- yarn.lock | 5 ----- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 4804cc60..5a302c38 100644 --- a/package.json +++ b/package.json @@ -30,8 +30,7 @@ "agentkeepalive": "^4.2.1", "form-data-encoder": "1.7.2", "formdata-node": "^4.3.2", - "node-fetch": "^2.6.7", - "web-streams-polyfill": "^3.2.1" + "node-fetch": "^2.6.7" }, "devDependencies": { "@swc/core": "^1.3.102", diff --git a/src/_shims/node-runtime.ts b/src/_shims/node-runtime.ts index a9c42ebe..ab9f2ab5 100644 --- a/src/_shims/node-runtime.ts +++ b/src/_shims/node-runtime.ts @@ -13,9 +13,7 @@ import { Readable } from 'node:stream'; import { type RequestOptions } from '../core'; import { MultipartBody } from './MultipartBody'; import { type Shims } from './registry'; - -// @ts-ignore (this package does not have proper export maps for this export) -import { ReadableStream } from 'web-streams-polyfill/dist/ponyfill.es2018.js'; +import { ReadableStream } from 'node:stream/web'; type FileFromPathOptions = Omit; diff --git a/yarn.lock b/yarn.lock index dda4d2e4..358dbf20 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3412,11 +3412,6 @@ web-streams-polyfill@4.0.0-beta.1: resolved "https://registry.yarnpkg.com/web-streams-polyfill/-/web-streams-polyfill-4.0.0-beta.1.tgz#3b19b9817374b7cee06d374ba7eeb3aeb80e8c95" integrity sha512-3ux37gEX670UUphBF9AMCq8XM6iQ8Ac6A+DSRRjDoRBm1ufCkaCDdNVbaqq60PsEkdNlLKrGtv/YBP4EJXqNtQ== -web-streams-polyfill@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz#71c2718c52b45fd49dbeee88634b3a60ceab42a6" - integrity sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q== - webidl-conversions@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" From a247935a86b87b90209f493921661d20c9bc6457 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 26 Jul 2024 11:51:14 +0000 Subject: [PATCH 15/18] chore(docs): fix incorrect client var names (#479) --- README.md | 20 ++++++++++---------- tests/api-resources/completions.test.ts | 6 +++--- tests/api-resources/messages.test.ts | 6 +++--- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index e5d25135..5c07abfc 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ const client = new Anthropic({ }); async function main() { - const message = await anthropic.messages.create({ + const message = await client.messages.create({ max_tokens: 1024, messages: [{ role: 'user', content: 'Hello, Claude' }], model: 'claude-3-opus-20240229', @@ -46,7 +46,7 @@ import Anthropic from '@anthropic-ai/sdk'; const client = new Anthropic(); -const stream = await anthropic.messages.create({ +const stream = await client.messages.create({ max_tokens: 1024, messages: [{ role: 'user', content: 'Hello, Claude' }], model: 'claude-3-opus-20240229', @@ -78,7 +78,7 @@ async function main() { messages: [{ role: 'user', content: 'Hello, Claude' }], model: 'claude-3-opus-20240229', }; - const message: Anthropic.Message = await anthropic.messages.create(params); + const message: Anthropic.Message = await client.messages.create(params); } main(); @@ -149,7 +149,7 @@ a subclass of `APIError` will be thrown: ```ts async function main() { - const message = await anthropic.messages + const message = await client.messages .create({ max_tokens: 1024, messages: [{ role: 'user', content: 'Hello, Claude' }], @@ -198,7 +198,7 @@ const client = new Anthropic({ }); // Or, configure per-request: -await anthropic.messages.create({ max_tokens: 1024, messages: [{ role: 'user', content: 'Hello, Claude' }], model: 'claude-3-opus-20240229' }, { +await client.messages.create({ max_tokens: 1024, messages: [{ role: 'user', content: 'Hello, Claude' }], model: 'claude-3-opus-20240229' }, { maxRetries: 5, }); ``` @@ -215,7 +215,7 @@ const client = new Anthropic({ }); // Override per-request: -await anthropic.messages.create({ max_tokens: 1024, messages: [{ role: 'user', content: 'Hello, Claude' }], model: 'claude-3-opus-20240229' }, { +await client.messages.create({ max_tokens: 1024, messages: [{ role: 'user', content: 'Hello, Claude' }], model: 'claude-3-opus-20240229' }, { timeout: 5 * 1000, }); ``` @@ -237,7 +237,7 @@ import Anthropic from '@anthropic-ai/sdk'; const client = new Anthropic(); -const message = await anthropic.messages.create( +const message = await client.messages.create( { max_tokens: 1024, messages: [{ role: 'user', content: 'Hello, Claude' }], @@ -259,7 +259,7 @@ You can also use the `.withResponse()` method to get the raw `Response` along wi ```ts const client = new Anthropic(); -const response = await anthropic.messages +const response = await client.messages .create({ max_tokens: 1024, messages: [{ role: 'user', content: 'Hello, Claude' }], @@ -269,7 +269,7 @@ const response = await anthropic.messages console.log(response.headers.get('X-My-Header')); console.log(response.statusText); // access the underlying Response object -const { data: message, response: raw } = await anthropic.messages +const { data: message, response: raw } = await client.messages .create({ max_tokens: 1024, messages: [{ role: 'user', content: 'Hello, Claude' }], @@ -381,7 +381,7 @@ const client = new Anthropic({ }); // Override per-request: -await anthropic.messages.create( +await client.messages.create( { max_tokens: 1024, messages: [{ role: 'user', content: 'Hello, Claude' }], diff --git a/tests/api-resources/completions.test.ts b/tests/api-resources/completions.test.ts index 4508a959..aa326cf2 100644 --- a/tests/api-resources/completions.test.ts +++ b/tests/api-resources/completions.test.ts @@ -3,14 +3,14 @@ import Anthropic from '@anthropic-ai/sdk'; import { Response } from 'node-fetch'; -const anthropic = new Anthropic({ +const client = new Anthropic({ apiKey: 'my-anthropic-api-key', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); describe('resource completions', () => { test('create: only required params', async () => { - const responsePromise = anthropic.completions.create({ + const responsePromise = client.completions.create({ max_tokens_to_sample: 256, model: 'string', prompt: '\n\nHuman: Hello, world!\n\nAssistant:', @@ -25,7 +25,7 @@ describe('resource completions', () => { }); test('create: required and optional params', async () => { - const response = await anthropic.completions.create({ + const response = await client.completions.create({ max_tokens_to_sample: 256, model: 'string', prompt: '\n\nHuman: Hello, world!\n\nAssistant:', diff --git a/tests/api-resources/messages.test.ts b/tests/api-resources/messages.test.ts index 7f71c7b7..c6e76bea 100644 --- a/tests/api-resources/messages.test.ts +++ b/tests/api-resources/messages.test.ts @@ -3,14 +3,14 @@ import Anthropic from '@anthropic-ai/sdk'; import { Response } from 'node-fetch'; -const anthropic = new Anthropic({ +const client = new Anthropic({ apiKey: 'my-anthropic-api-key', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); describe('resource messages', () => { test('create: only required params', async () => { - const responsePromise = anthropic.messages.create({ + const responsePromise = client.messages.create({ max_tokens: 1024, messages: [{ role: 'user', content: 'Hello, world' }], model: 'claude-3-5-sonnet-20240620', @@ -25,7 +25,7 @@ describe('resource messages', () => { }); test('create: required and optional params', async () => { - const response = await anthropic.messages.create({ + const response = await client.messages.create({ max_tokens: 1024, messages: [{ role: 'user', content: 'Hello, world' }], model: 'claude-3-5-sonnet-20240620', From 8dc9afcf00c4a38c2d85171ebceafc5f6a47c117 Mon Sep 17 00:00:00 2001 From: Robert Craigie Date: Mon, 29 Jul 2024 11:08:23 +0100 Subject: [PATCH 16/18] chore(internal): remove old reference to check-test-server --- packages/bedrock-sdk/package.json | 2 +- packages/vertex-sdk/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/bedrock-sdk/package.json b/packages/bedrock-sdk/package.json index 60903cd6..a221d069 100644 --- a/packages/bedrock-sdk/package.json +++ b/packages/bedrock-sdk/package.json @@ -11,7 +11,7 @@ "packageManager": "yarn@1.22.21", "private": false, "scripts": { - "test": "bin/check-test-server && yarn jest", + "test": "echo 'no tests defined yet' && exit 1", "build": "bash ./build", "prepack": "echo 'to pack, run yarn build && (cd dist; yarn pack)' && exit 1", "prepublishOnly": "echo 'to publish, run yarn build && (cd dist; yarn publish)' && exit 1", diff --git a/packages/vertex-sdk/package.json b/packages/vertex-sdk/package.json index de7a10de..f9e81c46 100644 --- a/packages/vertex-sdk/package.json +++ b/packages/vertex-sdk/package.json @@ -11,7 +11,7 @@ "packageManager": "yarn@1.22.21", "private": false, "scripts": { - "test": "bin/check-test-server && yarn jest", + "test": "echo 'no tests defined yet' && exit 1", "build": "bash ./build", "prepack": "echo 'to pack, run yarn build && (cd dist; yarn pack)' && exit 1", "prepublishOnly": "echo 'to publish, run yarn build && (cd dist; yarn publish)' && exit 1", From dc897537789c6b4bc31ee8238aad8ffaaa65df5e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 29 Jul 2024 19:45:51 +0000 Subject: [PATCH 17/18] chore(internal): add constant for default timeout (#480) --- src/index.ts | 1 + src/resources/completions.ts | 2 +- src/resources/messages.ts | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index e2ce21c3..01ba1962 100644 --- a/src/index.ts +++ b/src/index.ts @@ -195,6 +195,7 @@ export class Anthropic extends Core.APIClient { static Anthropic = this; static HUMAN_PROMPT = '\n\nHuman:'; static AI_PROMPT = '\n\nAssistant:'; + static DEFAULT_TIMEOUT = 600000; // 10 minutes static AnthropicError = Errors.AnthropicError; static APIError = Errors.APIError; diff --git a/src/resources/completions.ts b/src/resources/completions.ts index fe9c2c0b..86e9c602 100644 --- a/src/resources/completions.ts +++ b/src/resources/completions.ts @@ -33,7 +33,7 @@ export class Completions extends APIResource { ): APIPromise | APIPromise> { return this._client.post('/v1/complete', { body, - timeout: 600000, + timeout: (this._client as any)._options.timeout ?? 600000, ...options, stream: body.stream ?? false, }) as APIPromise | APIPromise>; diff --git a/src/resources/messages.ts b/src/resources/messages.ts index e45f5b78..ebc8a3d1 100644 --- a/src/resources/messages.ts +++ b/src/resources/messages.ts @@ -34,7 +34,7 @@ export class Messages extends APIResource { ): APIPromise | APIPromise> { return this._client.post('/v1/messages', { body, - timeout: 600000, + timeout: (this._client as any)._options.timeout ?? 600000, ...options, stream: body.stream ?? false, }) as APIPromise | APIPromise>; From 830fd2fb7001a9cdbb0cd68115f3a525fb01fb97 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 29 Jul 2024 19:46:13 +0000 Subject: [PATCH 18/18] chore: release main --- .release-please-manifest.json | 6 +++--- CHANGELOG.md | 36 +++++++++++++++++++++++++++++++ package.json | 2 +- packages/bedrock-sdk/CHANGELOG.md | 10 +++++++++ packages/bedrock-sdk/package.json | 2 +- packages/bedrock-sdk/yarn.lock | 2 +- packages/vertex-sdk/CHANGELOG.md | 8 +++++++ packages/vertex-sdk/package.json | 2 +- packages/vertex-sdk/yarn.lock | 2 +- src/version.ts | 2 +- 10 files changed, 63 insertions(+), 9 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 52c8e25f..02052543 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,5 +1,5 @@ { - ".": "0.24.3", - "packages/vertex-sdk": "0.4.0", - "packages/bedrock-sdk": "0.10.1" + ".": "0.25.0", + "packages/vertex-sdk": "0.4.1", + "packages/bedrock-sdk": "0.10.2" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 35cb3b9c..796b68e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,41 @@ # Changelog +## 0.25.0 (2024-07-29) + +Full Changelog: [sdk-v0.24.3...sdk-v0.25.0](https://github.com/anthropics/anthropic-sdk-typescript/compare/sdk-v0.24.3...sdk-v0.25.0) + +### Features + +* add back compat alias for InputJsonDelta ([8b08161](https://github.com/anthropics/anthropic-sdk-typescript/commit/8b081613a50821b8dfa8a1251d42337a20607411)) +* **client:** make request-id header more accessible ([#462](https://github.com/anthropics/anthropic-sdk-typescript/issues/462)) ([5ea6f8b](https://github.com/anthropics/anthropic-sdk-typescript/commit/5ea6f8be0696e3753d8624f72328a5cba3a86056)) + + +### Bug Fixes + +* **compat:** remove ReadableStream polyfill redundant since node v16 ([#478](https://github.com/anthropics/anthropic-sdk-typescript/issues/478)) ([75f5710](https://github.com/anthropics/anthropic-sdk-typescript/commit/75f5710d57e6f72b6770d32d9c6dd71bbfb43d85)) +* use relative paths ([#475](https://github.com/anthropics/anthropic-sdk-typescript/issues/475)) ([a8ca93c](https://github.com/anthropics/anthropic-sdk-typescript/commit/a8ca93cc40464dc76118f7dd72e94c52693f3d63)) + + +### Chores + +* **bedrock:** use `chunk` for internal SSE parsing instead of `completion` ([#472](https://github.com/anthropics/anthropic-sdk-typescript/issues/472)) ([0f6190a](https://github.com/anthropics/anthropic-sdk-typescript/commit/0f6190a69d8986ac3779441eba43d345ec3fb342)) +* **ci:** also run workflows for PRs targeting `next` ([#464](https://github.com/anthropics/anthropic-sdk-typescript/issues/464)) ([cc405a8](https://github.com/anthropics/anthropic-sdk-typescript/commit/cc405a8cc4ea26389b9d857d75818722d0bcbfcd)) +* **docs:** fix incorrect client var names ([#479](https://github.com/anthropics/anthropic-sdk-typescript/issues/479)) ([a247935](https://github.com/anthropics/anthropic-sdk-typescript/commit/a247935a86b87b90209f493921661d20c9bc6457)) +* **docs:** mention lack of support for web browser runtimes ([#468](https://github.com/anthropics/anthropic-sdk-typescript/issues/468)) ([968a7fb](https://github.com/anthropics/anthropic-sdk-typescript/commit/968a7fbb6cb779d17d9f6c485c0b61f241e327bc)) +* **docs:** minor update to formatting of API link in README ([#467](https://github.com/anthropics/anthropic-sdk-typescript/issues/467)) ([50b9f2b](https://github.com/anthropics/anthropic-sdk-typescript/commit/50b9f2b0c3feb4707af2b9e5f006a3f726782803)) +* **docs:** rename anthropic const to client ([#471](https://github.com/anthropics/anthropic-sdk-typescript/issues/471)) ([e1a7f9f](https://github.com/anthropics/anthropic-sdk-typescript/commit/e1a7f9f813077fb033c732c004c7bda85738a321)) +* **docs:** use client instead of package name in Node examples ([#469](https://github.com/anthropics/anthropic-sdk-typescript/issues/469)) ([8961ebf](https://github.com/anthropics/anthropic-sdk-typescript/commit/8961ebf54bbab898667119c8d9551e33a4de6846)) +* **internal:** add constant for default timeout ([#480](https://github.com/anthropics/anthropic-sdk-typescript/issues/480)) ([dc89753](https://github.com/anthropics/anthropic-sdk-typescript/commit/dc897537789c6b4bc31ee8238aad8ffaaa65df5e)) +* **internal:** minor changes to tests ([#465](https://github.com/anthropics/anthropic-sdk-typescript/issues/465)) ([c1fd563](https://github.com/anthropics/anthropic-sdk-typescript/commit/c1fd563693bd354a81e0ae55c7355144f06b7f0b)) +* **internal:** remove old reference to check-test-server ([8dc9afc](https://github.com/anthropics/anthropic-sdk-typescript/commit/8dc9afcf00c4a38c2d85171ebceafc5f6a47c117)) +* sync spec ([#470](https://github.com/anthropics/anthropic-sdk-typescript/issues/470)) ([b493aa4](https://github.com/anthropics/anthropic-sdk-typescript/commit/b493aa49d3d6e67be22c3e8255dd4286e6bbcdeb)) +* **tests:** update prism version ([#473](https://github.com/anthropics/anthropic-sdk-typescript/issues/473)) ([6f21ecf](https://github.com/anthropics/anthropic-sdk-typescript/commit/6f21ecfd781d04a7dc83641f069bb38d5584a320)) + + +### Refactors + +* extract model out to a named type and rename partialjson ([#477](https://github.com/anthropics/anthropic-sdk-typescript/issues/477)) ([d2d4e36](https://github.com/anthropics/anthropic-sdk-typescript/commit/d2d4e36b995cc84e8a3a7c64eb614011df399c5e)) + ## 0.24.3 (2024-07-01) Full Changelog: [sdk-v0.24.2...sdk-v0.24.3](https://github.com/anthropics/anthropic-sdk-typescript/compare/sdk-v0.24.2...sdk-v0.24.3) diff --git a/package.json b/package.json index 5a302c38..c8a75d7e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@anthropic-ai/sdk", - "version": "0.24.3", + "version": "0.25.0", "description": "The official TypeScript library for the Anthropic API", "author": "Anthropic ", "types": "dist/index.d.ts", diff --git a/packages/bedrock-sdk/CHANGELOG.md b/packages/bedrock-sdk/CHANGELOG.md index 760001ba..d1a6ac21 100644 --- a/packages/bedrock-sdk/CHANGELOG.md +++ b/packages/bedrock-sdk/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +## 0.10.2 (2024-07-29) + +Full Changelog: [bedrock-sdk-v0.10.1...bedrock-sdk-v0.10.2](https://github.com/anthropics/anthropic-sdk-typescript/compare/bedrock-sdk-v0.10.1...bedrock-sdk-v0.10.2) + +### Chores + +* **bedrock:** use `chunk` for internal SSE parsing instead of `completion` ([#472](https://github.com/anthropics/anthropic-sdk-typescript/issues/472)) ([0f6190a](https://github.com/anthropics/anthropic-sdk-typescript/commit/0f6190a69d8986ac3779441eba43d345ec3fb342)) +* **docs:** rename anthropic const to client ([#471](https://github.com/anthropics/anthropic-sdk-typescript/issues/471)) ([e1a7f9f](https://github.com/anthropics/anthropic-sdk-typescript/commit/e1a7f9f813077fb033c732c004c7bda85738a321)) +* **internal:** remove old reference to check-test-server ([8dc9afc](https://github.com/anthropics/anthropic-sdk-typescript/commit/8dc9afcf00c4a38c2d85171ebceafc5f6a47c117)) + ## 0.10.1 (2024-06-25) Full Changelog: [bedrock-sdk-v0.10.0...bedrock-sdk-v0.10.1](https://github.com/anthropics/anthropic-sdk-typescript/compare/bedrock-sdk-v0.10.0...bedrock-sdk-v0.10.1) diff --git a/packages/bedrock-sdk/package.json b/packages/bedrock-sdk/package.json index a221d069..140f7151 100644 --- a/packages/bedrock-sdk/package.json +++ b/packages/bedrock-sdk/package.json @@ -1,6 +1,6 @@ { "name": "@anthropic-ai/bedrock-sdk", - "version": "0.10.1", + "version": "0.10.2", "description": "The official TypeScript library for the Anthropic Bedrock API", "author": "Anthropic ", "types": "dist/index.d.ts", diff --git a/packages/bedrock-sdk/yarn.lock b/packages/bedrock-sdk/yarn.lock index e510f1d9..52ff2cbd 100644 --- a/packages/bedrock-sdk/yarn.lock +++ b/packages/bedrock-sdk/yarn.lock @@ -17,7 +17,7 @@ "@anthropic-ai/sdk@file:../../dist": # x-release-please-start-version - version "0.24.3" + version "0.25.0" # x-release-please-end-version dependencies: "@types/node" "^18.11.18" diff --git a/packages/vertex-sdk/CHANGELOG.md b/packages/vertex-sdk/CHANGELOG.md index 69906369..e312f5b6 100644 --- a/packages/vertex-sdk/CHANGELOG.md +++ b/packages/vertex-sdk/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.4.1 (2024-07-29) + +Full Changelog: [vertex-sdk-v0.4.0...vertex-sdk-v0.4.1](https://github.com/anthropics/anthropic-sdk-typescript/compare/vertex-sdk-v0.4.0...vertex-sdk-v0.4.1) + +### Chores + +* **internal:** remove old reference to check-test-server ([8dc9afc](https://github.com/anthropics/anthropic-sdk-typescript/commit/8dc9afcf00c4a38c2d85171ebceafc5f6a47c117)) + ## 0.4.0 (2024-05-30) Full Changelog: [vertex-sdk-v0.3.7...vertex-sdk-v0.4.0](https://github.com/anthropics/anthropic-sdk-typescript/compare/vertex-sdk-v0.3.7...vertex-sdk-v0.4.0) diff --git a/packages/vertex-sdk/package.json b/packages/vertex-sdk/package.json index f9e81c46..6e3c3c53 100644 --- a/packages/vertex-sdk/package.json +++ b/packages/vertex-sdk/package.json @@ -1,6 +1,6 @@ { "name": "@anthropic-ai/vertex-sdk", - "version": "0.4.0", + "version": "0.4.1", "description": "The official TypeScript library for the Anthropic Vertex API", "author": "Anthropic ", "types": "dist/index.d.ts", diff --git a/packages/vertex-sdk/yarn.lock b/packages/vertex-sdk/yarn.lock index 6ce8ca51..b2c98e81 100644 --- a/packages/vertex-sdk/yarn.lock +++ b/packages/vertex-sdk/yarn.lock @@ -17,7 +17,7 @@ "@anthropic-ai/sdk@file:../../dist": # x-release-please-start-version - version "0.24.3" + version "0.25.0" # x-release-please-end-version dependencies: "@types/node" "^18.11.18" diff --git a/src/version.ts b/src/version.ts index 5d7349b1..4931d4f6 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '0.24.3'; // x-release-please-version +export const VERSION = '0.25.0'; // x-release-please-version