-
Notifications
You must be signed in to change notification settings - Fork 1
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
fix(deps): update dependency @anthropic-ai/sdk to v0.33.1 #225
Conversation
openai debug - [puLL-Merge] - anthropics/[email protected] Diffdiff --git .github/workflows/handle-release-pr-title-edit.yml .github/workflows/handle-release-pr-title-edit.yml
deleted file mode 100644
index 8144aaae..00000000
--- .github/workflows/handle-release-pr-title-edit.yml
+++ /dev/null
@@ -1,26 +0,0 @@
-name: Handle release PR title edits
-on:
- pull_request:
- types:
- - edited
- - unlabeled
-
-jobs:
- update_pr_content:
- name: Update pull request content
- if: |
- ((github.event.action == 'edited' && github.event.changes.title.from != github.event.pull_request.title) ||
- (github.event.action == 'unlabeled' && github.event.label.name == 'autorelease: custom version')) &&
- startsWith(github.event.pull_request.head.ref, 'release-please--') &&
- github.event.pull_request.state == 'open' &&
- github.event.sender.login != 'stainless-bot' &&
- github.event.sender.login != 'stainless-app' &&
- github.repository == 'anthropics/anthropic-sdk-typescript'
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
- - uses: stainless-api/trigger-release-please@v1
- with:
- repo: ${{ github.event.repository.full_name }}
- stainless-api-key: ${{ secrets.STAINLESS_API_KEY }}
-
diff --git .release-please-manifest.json .release-please-manifest.json
index e6b9ab03..2053c67b 100644
--- .release-please-manifest.json
+++ .release-please-manifest.json
@@ -1,5 +1,5 @@
{
- ".": "0.32.1",
- "packages/vertex-sdk": "0.5.2",
- "packages/bedrock-sdk": "0.11.2"
+ ".": "0.33.1",
+ "packages/vertex-sdk": "0.6.1",
+ "packages/bedrock-sdk": "0.12.0"
}
diff --git .stats.yml .stats.yml
index ebe0695a..19e9daeb 100644
--- .stats.yml
+++ .stats.yml
@@ -1,2 +1,2 @@
-configured_endpoints: 10
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/anthropic-25f83d91f601c1962b3701fedf829f678f306aca0758af286ee1586cc9931f75.yml
+configured_endpoints: 19
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/anthropic-be055148d227480fcacc9086c37ac8009dcb487731069ada51af35044f65bee4.yml
diff --git CHANGELOG.md CHANGELOG.md
index f332e42a..a1a57c52 100644
--- CHANGELOG.md
+++ CHANGELOG.md
@@ -1,5 +1,61 @@
# Changelog
+## 0.33.1 (2024-12-17)
+
+Full Changelog: [sdk-v0.33.0...sdk-v0.33.1](https://github.com/anthropics/anthropic-sdk-typescript/compare/sdk-v0.33.0...sdk-v0.33.1)
+
+### Bug Fixes
+
+* **vertex:** remove `anthropic_version` deletion for token counting ([88221be](https://github.com/anthropics/anthropic-sdk-typescript/commit/88221be305d6e13ccf92e6e9cdb00daba45b57db))
+
+
+### Chores
+
+* **internal:** fix some typos ([#633](https://github.com/anthropics/anthropic-sdk-typescript/issues/633)) ([a0298f5](https://github.com/anthropics/anthropic-sdk-typescript/commit/a0298f5f67b8ecd25de416dbb3eada68b86befd7))
+
+## 0.33.0 (2024-12-17)
+
+Full Changelog: [sdk-v0.32.1...sdk-v0.33.0](https://github.com/anthropics/anthropic-sdk-typescript/compare/sdk-v0.32.1...sdk-v0.33.0)
+
+### Features
+
+* **api:** general availability updates ([93d1316](https://github.com/anthropics/anthropic-sdk-typescript/commit/93d13168f950b2cdfc3b7c6664205b06418fea79))
+* **api:** general availability updates ([#631](https://github.com/anthropics/anthropic-sdk-typescript/issues/631)) ([b5c92e5](https://github.com/anthropics/anthropic-sdk-typescript/commit/b5c92e5b74c370ac3f9ba28e915bd54588a42be0))
+* **client:** add ._request_id property to object responses ([#596](https://github.com/anthropics/anthropic-sdk-typescript/issues/596)) ([9d6d584](https://github.com/anthropics/anthropic-sdk-typescript/commit/9d6d58430a216df9888434158bf628ae4b067aba))
+* **internal:** make git install file structure match npm ([#617](https://github.com/anthropics/anthropic-sdk-typescript/issues/617)) ([d3dd7d5](https://github.com/anthropics/anthropic-sdk-typescript/commit/d3dd7d5f8cad460dd18725d5c0f3c8db3f00115d))
+* **vertex:** support token counting ([9e76b4d](https://github.com/anthropics/anthropic-sdk-typescript/commit/9e76b4dc22d62b1239b382bb771b69ad8cff9442))
+
+
+### Bug Fixes
+
+* **docs:** add missing await to pagination example ([#609](https://github.com/anthropics/anthropic-sdk-typescript/issues/609)) ([e303077](https://github.com/anthropics/anthropic-sdk-typescript/commit/e303077ebab73c41adee7d25375b767c3fc78998))
+* **types:** remove anthropic-instant-1.2 model ([#599](https://github.com/anthropics/anthropic-sdk-typescript/issues/599)) ([e222a4d](https://github.com/anthropics/anthropic-sdk-typescript/commit/e222a4d0518aa80671c66ee2a25d87dc87a51316))
+
+
+### Chores
+
+* **api:** update spec version ([#607](https://github.com/anthropics/anthropic-sdk-typescript/issues/607)) ([ea44f9a](https://github.com/anthropics/anthropic-sdk-typescript/commit/ea44f9ac49dcc25a5dfa53880ebf61318ee90f6c))
+* **api:** update spec version ([#629](https://github.com/anthropics/anthropic-sdk-typescript/issues/629)) ([a25295c](https://github.com/anthropics/anthropic-sdk-typescript/commit/a25295cd6db7b57162fdd9049eb8a3c37bb94f08))
+* **bedrock,vertex:** remove unsupported countTokens method ([#597](https://github.com/anthropics/anthropic-sdk-typescript/issues/597)) ([17b7da5](https://github.com/anthropics/anthropic-sdk-typescript/commit/17b7da5ee6f35ea2bdd53a66a662871affae6341))
+* **bedrock:** remove unsupported methods ([6458dc1](https://github.com/anthropics/anthropic-sdk-typescript/commit/6458dc14544c16240a6580a21a36fcf5bde594b2))
+* **ci:** remove unneeded workflow ([#594](https://github.com/anthropics/anthropic-sdk-typescript/issues/594)) ([7572e48](https://github.com/anthropics/anthropic-sdk-typescript/commit/7572e48dbccb2090562399c7ff2d01503c86f445))
+* **client:** drop unused devDependency ([#610](https://github.com/anthropics/anthropic-sdk-typescript/issues/610)) ([5d0d523](https://github.com/anthropics/anthropic-sdk-typescript/commit/5d0d523390d8c34cae836c423940b67defb9d2aa))
+* improve browser error message ([#613](https://github.com/anthropics/anthropic-sdk-typescript/issues/613)) ([c26121e](https://github.com/anthropics/anthropic-sdk-typescript/commit/c26121e84039b7430995b6363876ea9795ba31ed))
+* **internal:** bump cross-spawn to v7.0.6 ([#624](https://github.com/anthropics/anthropic-sdk-typescript/issues/624)) ([e58ba9a](https://github.com/anthropics/anthropic-sdk-typescript/commit/e58ba9a177ec5c8545fd3a3f4fd3d2e7c722f023))
+* **internal:** remove unnecessary getRequestClient function ([#623](https://github.com/anthropics/anthropic-sdk-typescript/issues/623)) ([882c45f](https://github.com/anthropics/anthropic-sdk-typescript/commit/882c45f5a0bd1f4b996d59e6589a205c2111f46b))
+* **internal:** update isAbsoluteURL ([#627](https://github.com/anthropics/anthropic-sdk-typescript/issues/627)) ([2528ea0](https://github.com/anthropics/anthropic-sdk-typescript/commit/2528ea0dcfc83f38e76b58eaadaa5e8c5c0b188d))
+* **internal:** update spec ([#630](https://github.com/anthropics/anthropic-sdk-typescript/issues/630)) ([82cac06](https://github.com/anthropics/anthropic-sdk-typescript/commit/82cac065e2711467773c0ea62848cdf139ed5a11))
+* **internal:** use reexports not destructuring ([#604](https://github.com/anthropics/anthropic-sdk-typescript/issues/604)) ([e4daff2](https://github.com/anthropics/anthropic-sdk-typescript/commit/e4daff2b6a3fb42876ebd06ed4947c88cff919d8))
+* remove redundant word in comment ([#615](https://github.com/anthropics/anthropic-sdk-typescript/issues/615)) ([ef57a10](https://github.com/anthropics/anthropic-sdk-typescript/commit/ef57a103bcfc922a724a7c878f970dbd369b305e))
+* **tests:** limit array example length ([#611](https://github.com/anthropics/anthropic-sdk-typescript/issues/611)) ([91dc181](https://github.com/anthropics/anthropic-sdk-typescript/commit/91dc1812db2cc9e1f4660a13106bad932518b7cf))
+* **types:** nicer error class types + jsdocs ([#626](https://github.com/anthropics/anthropic-sdk-typescript/issues/626)) ([0287993](https://github.com/anthropics/anthropic-sdk-typescript/commit/0287993912ef81bd2c49603d120f49f4f979d75e))
+
+
+### Documentation
+
+* remove suggestion to use `npm` call out ([#614](https://github.com/anthropics/anthropic-sdk-typescript/issues/614)) ([6369261](https://github.com/anthropics/anthropic-sdk-typescript/commit/6369261e3597351f17b8f1a3945ca56b00eba177))
+* use latest sonnet in example snippets ([#625](https://github.com/anthropics/anthropic-sdk-typescript/issues/625)) ([f70882b](https://github.com/anthropics/anthropic-sdk-typescript/commit/f70882b0e8119a414b01b9f0b85fbe1ccb06f122))
+
## 0.32.1 (2024-11-05)
Full Changelog: [sdk-v0.32.0...sdk-v0.32.1](https://github.com/anthropics/anthropic-sdk-typescript/compare/sdk-v0.32.0...sdk-v0.32.1)
diff --git README.md README.md
index daba6e63..da3db48e 100644
--- README.md
+++ README.md
@@ -28,7 +28,7 @@ async function main() {
const message = await client.messages.create({
max_tokens: 1024,
messages: [{ role: 'user', content: 'Hello, Claude' }],
- model: 'claude-3-opus-20240229',
+ model: 'claude-3-5-sonnet-latest',
});
console.log(message.content);
@@ -49,7 +49,7 @@ const client = new Anthropic();
const stream = await client.messages.create({
max_tokens: 1024,
messages: [{ role: 'user', content: 'Hello, Claude' }],
- model: 'claude-3-opus-20240229',
+ model: 'claude-3-5-sonnet-latest',
stream: true,
});
for await (const messageStreamEvent of stream) {
@@ -76,7 +76,7 @@ async function main() {
const params: Anthropic.MessageCreateParams = {
max_tokens: 1024,
messages: [{ role: 'user', content: 'Hello, Claude' }],
- model: 'claude-3-opus-20240229',
+ model: 'claude-3-5-sonnet-latest',
};
const message: Anthropic.Message = await client.messages.create(params);
}
@@ -108,7 +108,7 @@ const anthropic = new Anthropic();
async function main() {
const stream = anthropic.messages
.stream({
- model: 'claude-3-opus-20240229',
+ model: 'claude-3-5-sonnet-latest',
max_tokens: 1024,
messages: [
{
@@ -146,7 +146,7 @@ await anthropic.beta.messages.batches.create({
{
custom_id: 'my-first-request',
params: {
- model: 'claude-3-5-sonnet-20240620',
+ model: 'claude-3-5-sonnet-latest',
max_tokens: 1024,
messages: [{ role: 'user', content: 'Hello, world' }],
},
@@ -154,7 +154,7 @@ await anthropic.beta.messages.batches.create({
{
custom_id: 'my-second-request',
params: {
- model: 'claude-3-5-sonnet-20240620',
+ model: 'claude-3-5-sonnet-latest',
max_tokens: 1024,
messages: [{ role: 'user', content: 'Hi again, friend' }],
},
@@ -198,7 +198,7 @@ async function main() {
.create({
max_tokens: 1024,
messages: [{ role: 'user', content: 'Hello, Claude' }],
- model: 'claude-3-opus-20240229',
+ model: 'claude-3-5-sonnet-latest',
})
.catch(async (err) => {
if (err instanceof Anthropic.APIError) {
@@ -227,6 +227,18 @@ Error codes are as followed:
| >=500 | `InternalServerError` |
| N/A | `APIConnectionError` |
+## Request IDs
+
+> For more information on debugging requests, see [these docs](https://docs.anthropic.com/en/api/errors#request-id)
+
+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.
+
+\`\`\`ts
+const message = await client.messages.create({ max_tokens: 1024, messages: [{ role: 'user', content: 'Hello, Claude' }], model: 'claude-3-5-sonnet-latest' });
+console.log(completion._request_id) // req_018EeWyXxfu5pfWkrYcMdjWG
+```
+
+
### Retries
Certain errors will be automatically retried 2 times by default, with a short exponential backoff.
@@ -243,7 +255,7 @@ const client = new Anthropic({
});
// Or, configure per-request:
-await client.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-5-sonnet-latest' }, {
maxRetries: 5,
}); @@ -260,7 +272,7 @@ const client = new Anthropic({ // Override per-request:
@@ -317,7 +329,7 @@ const message = await client.messages.create(
Anthropic+# Shared MessagesTypes: -- Methods: --
+## Batches BetaTypes:
+## Models MessagesTypes:
-## PromptCaching-### Messages-Types:--
|
anthropic debug - [puLL-Merge] - anthropics/[email protected] Diffdiff --git .github/workflows/handle-release-pr-title-edit.yml .github/workflows/handle-release-pr-title-edit.yml
deleted file mode 100644
index 8144aaae..00000000
--- .github/workflows/handle-release-pr-title-edit.yml
+++ /dev/null
@@ -1,26 +0,0 @@
-name: Handle release PR title edits
-on:
- pull_request:
- types:
- - edited
- - unlabeled
-
-jobs:
- update_pr_content:
- name: Update pull request content
- if: |
- ((github.event.action == 'edited' && github.event.changes.title.from != github.event.pull_request.title) ||
- (github.event.action == 'unlabeled' && github.event.label.name == 'autorelease: custom version')) &&
- startsWith(github.event.pull_request.head.ref, 'release-please--') &&
- github.event.pull_request.state == 'open' &&
- github.event.sender.login != 'stainless-bot' &&
- github.event.sender.login != 'stainless-app' &&
- github.repository == 'anthropics/anthropic-sdk-typescript'
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
- - uses: stainless-api/trigger-release-please@v1
- with:
- repo: ${{ github.event.repository.full_name }}
- stainless-api-key: ${{ secrets.STAINLESS_API_KEY }}
-
diff --git .release-please-manifest.json .release-please-manifest.json
index e6b9ab03..2053c67b 100644
--- .release-please-manifest.json
+++ .release-please-manifest.json
@@ -1,5 +1,5 @@
{
- ".": "0.32.1",
- "packages/vertex-sdk": "0.5.2",
- "packages/bedrock-sdk": "0.11.2"
+ ".": "0.33.1",
+ "packages/vertex-sdk": "0.6.1",
+ "packages/bedrock-sdk": "0.12.0"
}
diff --git .stats.yml .stats.yml
index ebe0695a..19e9daeb 100644
--- .stats.yml
+++ .stats.yml
@@ -1,2 +1,2 @@
-configured_endpoints: 10
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/anthropic-25f83d91f601c1962b3701fedf829f678f306aca0758af286ee1586cc9931f75.yml
+configured_endpoints: 19
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/anthropic-be055148d227480fcacc9086c37ac8009dcb487731069ada51af35044f65bee4.yml
diff --git CHANGELOG.md CHANGELOG.md
index f332e42a..a1a57c52 100644
--- CHANGELOG.md
+++ CHANGELOG.md
@@ -1,5 +1,61 @@
# Changelog
+## 0.33.1 (2024-12-17)
+
+Full Changelog: [sdk-v0.33.0...sdk-v0.33.1](https://github.com/anthropics/anthropic-sdk-typescript/compare/sdk-v0.33.0...sdk-v0.33.1)
+
+### Bug Fixes
+
+* **vertex:** remove `anthropic_version` deletion for token counting ([88221be](https://github.com/anthropics/anthropic-sdk-typescript/commit/88221be305d6e13ccf92e6e9cdb00daba45b57db))
+
+
+### Chores
+
+* **internal:** fix some typos ([#633](https://github.com/anthropics/anthropic-sdk-typescript/issues/633)) ([a0298f5](https://github.com/anthropics/anthropic-sdk-typescript/commit/a0298f5f67b8ecd25de416dbb3eada68b86befd7))
+
+## 0.33.0 (2024-12-17)
+
+Full Changelog: [sdk-v0.32.1...sdk-v0.33.0](https://github.com/anthropics/anthropic-sdk-typescript/compare/sdk-v0.32.1...sdk-v0.33.0)
+
+### Features
+
+* **api:** general availability updates ([93d1316](https://github.com/anthropics/anthropic-sdk-typescript/commit/93d13168f950b2cdfc3b7c6664205b06418fea79))
+* **api:** general availability updates ([#631](https://github.com/anthropics/anthropic-sdk-typescript/issues/631)) ([b5c92e5](https://github.com/anthropics/anthropic-sdk-typescript/commit/b5c92e5b74c370ac3f9ba28e915bd54588a42be0))
+* **client:** add ._request_id property to object responses ([#596](https://github.com/anthropics/anthropic-sdk-typescript/issues/596)) ([9d6d584](https://github.com/anthropics/anthropic-sdk-typescript/commit/9d6d58430a216df9888434158bf628ae4b067aba))
+* **internal:** make git install file structure match npm ([#617](https://github.com/anthropics/anthropic-sdk-typescript/issues/617)) ([d3dd7d5](https://github.com/anthropics/anthropic-sdk-typescript/commit/d3dd7d5f8cad460dd18725d5c0f3c8db3f00115d))
+* **vertex:** support token counting ([9e76b4d](https://github.com/anthropics/anthropic-sdk-typescript/commit/9e76b4dc22d62b1239b382bb771b69ad8cff9442))
+
+
+### Bug Fixes
+
+* **docs:** add missing await to pagination example ([#609](https://github.com/anthropics/anthropic-sdk-typescript/issues/609)) ([e303077](https://github.com/anthropics/anthropic-sdk-typescript/commit/e303077ebab73c41adee7d25375b767c3fc78998))
+* **types:** remove anthropic-instant-1.2 model ([#599](https://github.com/anthropics/anthropic-sdk-typescript/issues/599)) ([e222a4d](https://github.com/anthropics/anthropic-sdk-typescript/commit/e222a4d0518aa80671c66ee2a25d87dc87a51316))
+
+
+### Chores
+
+* **api:** update spec version ([#607](https://github.com/anthropics/anthropic-sdk-typescript/issues/607)) ([ea44f9a](https://github.com/anthropics/anthropic-sdk-typescript/commit/ea44f9ac49dcc25a5dfa53880ebf61318ee90f6c))
+* **api:** update spec version ([#629](https://github.com/anthropics/anthropic-sdk-typescript/issues/629)) ([a25295c](https://github.com/anthropics/anthropic-sdk-typescript/commit/a25295cd6db7b57162fdd9049eb8a3c37bb94f08))
+* **bedrock,vertex:** remove unsupported countTokens method ([#597](https://github.com/anthropics/anthropic-sdk-typescript/issues/597)) ([17b7da5](https://github.com/anthropics/anthropic-sdk-typescript/commit/17b7da5ee6f35ea2bdd53a66a662871affae6341))
+* **bedrock:** remove unsupported methods ([6458dc1](https://github.com/anthropics/anthropic-sdk-typescript/commit/6458dc14544c16240a6580a21a36fcf5bde594b2))
+* **ci:** remove unneeded workflow ([#594](https://github.com/anthropics/anthropic-sdk-typescript/issues/594)) ([7572e48](https://github.com/anthropics/anthropic-sdk-typescript/commit/7572e48dbccb2090562399c7ff2d01503c86f445))
+* **client:** drop unused devDependency ([#610](https://github.com/anthropics/anthropic-sdk-typescript/issues/610)) ([5d0d523](https://github.com/anthropics/anthropic-sdk-typescript/commit/5d0d523390d8c34cae836c423940b67defb9d2aa))
+* improve browser error message ([#613](https://github.com/anthropics/anthropic-sdk-typescript/issues/613)) ([c26121e](https://github.com/anthropics/anthropic-sdk-typescript/commit/c26121e84039b7430995b6363876ea9795ba31ed))
+* **internal:** bump cross-spawn to v7.0.6 ([#624](https://github.com/anthropics/anthropic-sdk-typescript/issues/624)) ([e58ba9a](https://github.com/anthropics/anthropic-sdk-typescript/commit/e58ba9a177ec5c8545fd3a3f4fd3d2e7c722f023))
+* **internal:** remove unnecessary getRequestClient function ([#623](https://github.com/anthropics/anthropic-sdk-typescript/issues/623)) ([882c45f](https://github.com/anthropics/anthropic-sdk-typescript/commit/882c45f5a0bd1f4b996d59e6589a205c2111f46b))
+* **internal:** update isAbsoluteURL ([#627](https://github.com/anthropics/anthropic-sdk-typescript/issues/627)) ([2528ea0](https://github.com/anthropics/anthropic-sdk-typescript/commit/2528ea0dcfc83f38e76b58eaadaa5e8c5c0b188d))
+* **internal:** update spec ([#630](https://github.com/anthropics/anthropic-sdk-typescript/issues/630)) ([82cac06](https://github.com/anthropics/anthropic-sdk-typescript/commit/82cac065e2711467773c0ea62848cdf139ed5a11))
+* **internal:** use reexports not destructuring ([#604](https://github.com/anthropics/anthropic-sdk-typescript/issues/604)) ([e4daff2](https://github.com/anthropics/anthropic-sdk-typescript/commit/e4daff2b6a3fb42876ebd06ed4947c88cff919d8))
+* remove redundant word in comment ([#615](https://github.com/anthropics/anthropic-sdk-typescript/issues/615)) ([ef57a10](https://github.com/anthropics/anthropic-sdk-typescript/commit/ef57a103bcfc922a724a7c878f970dbd369b305e))
+* **tests:** limit array example length ([#611](https://github.com/anthropics/anthropic-sdk-typescript/issues/611)) ([91dc181](https://github.com/anthropics/anthropic-sdk-typescript/commit/91dc1812db2cc9e1f4660a13106bad932518b7cf))
+* **types:** nicer error class types + jsdocs ([#626](https://github.com/anthropics/anthropic-sdk-typescript/issues/626)) ([0287993](https://github.com/anthropics/anthropic-sdk-typescript/commit/0287993912ef81bd2c49603d120f49f4f979d75e))
+
+
+### Documentation
+
+* remove suggestion to use `npm` call out ([#614](https://github.com/anthropics/anthropic-sdk-typescript/issues/614)) ([6369261](https://github.com/anthropics/anthropic-sdk-typescript/commit/6369261e3597351f17b8f1a3945ca56b00eba177))
+* use latest sonnet in example snippets ([#625](https://github.com/anthropics/anthropic-sdk-typescript/issues/625)) ([f70882b](https://github.com/anthropics/anthropic-sdk-typescript/commit/f70882b0e8119a414b01b9f0b85fbe1ccb06f122))
+
## 0.32.1 (2024-11-05)
Full Changelog: [sdk-v0.32.0...sdk-v0.32.1](https://github.com/anthropics/anthropic-sdk-typescript/compare/sdk-v0.32.0...sdk-v0.32.1)
diff --git README.md README.md
index daba6e63..da3db48e 100644
--- README.md
+++ README.md
@@ -28,7 +28,7 @@ async function main() {
const message = await client.messages.create({
max_tokens: 1024,
messages: [{ role: 'user', content: 'Hello, Claude' }],
- model: 'claude-3-opus-20240229',
+ model: 'claude-3-5-sonnet-latest',
});
console.log(message.content);
@@ -49,7 +49,7 @@ const client = new Anthropic();
const stream = await client.messages.create({
max_tokens: 1024,
messages: [{ role: 'user', content: 'Hello, Claude' }],
- model: 'claude-3-opus-20240229',
+ model: 'claude-3-5-sonnet-latest',
stream: true,
});
for await (const messageStreamEvent of stream) {
@@ -76,7 +76,7 @@ async function main() {
const params: Anthropic.MessageCreateParams = {
max_tokens: 1024,
messages: [{ role: 'user', content: 'Hello, Claude' }],
- model: 'claude-3-opus-20240229',
+ model: 'claude-3-5-sonnet-latest',
};
const message: Anthropic.Message = await client.messages.create(params);
}
@@ -108,7 +108,7 @@ const anthropic = new Anthropic();
async function main() {
const stream = anthropic.messages
.stream({
- model: 'claude-3-opus-20240229',
+ model: 'claude-3-5-sonnet-latest',
max_tokens: 1024,
messages: [
{
@@ -146,7 +146,7 @@ await anthropic.beta.messages.batches.create({
{
custom_id: 'my-first-request',
params: {
- model: 'claude-3-5-sonnet-20240620',
+ model: 'claude-3-5-sonnet-latest',
max_tokens: 1024,
messages: [{ role: 'user', content: 'Hello, world' }],
},
@@ -154,7 +154,7 @@ await anthropic.beta.messages.batches.create({
{
custom_id: 'my-second-request',
params: {
- model: 'claude-3-5-sonnet-20240620',
+ model: 'claude-3-5-sonnet-latest',
max_tokens: 1024,
messages: [{ role: 'user', content: 'Hi again, friend' }],
},
@@ -198,7 +198,7 @@ async function main() {
.create({
max_tokens: 1024,
messages: [{ role: 'user', content: 'Hello, Claude' }],
- model: 'claude-3-opus-20240229',
+ model: 'claude-3-5-sonnet-latest',
})
.catch(async (err) => {
if (err instanceof Anthropic.APIError) {
@@ -227,6 +227,18 @@ Error codes are as followed:
| >=500 | `InternalServerError` |
| N/A | `APIConnectionError` |
+## Request IDs
+
+> For more information on debugging requests, see [these docs](https://docs.anthropic.com/en/api/errors#request-id)
+
+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.
+
+\`\`\`ts
+const message = await client.messages.create({ max_tokens: 1024, messages: [{ role: 'user', content: 'Hello, Claude' }], model: 'claude-3-5-sonnet-latest' });
+console.log(completion._request_id) // req_018EeWyXxfu5pfWkrYcMdjWG
+```
+
+
### Retries
Certain errors will be automatically retried 2 times by default, with a short exponential backoff.
@@ -243,7 +255,7 @@ const client = new Anthropic({
});
// Or, configure per-request:
-await client.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-5-sonnet-latest' }, {
maxRetries: 5,
}); @@ -260,7 +272,7 @@ const client = new Anthropic({ // Override per-request:
@@ -317,7 +329,7 @@ const message = await client.messages.create(
Anthropic+# Shared MessagesTypes: -- Methods: --
+## Batches BetaTypes:
+## Models MessagesTypes:
-## PromptCaching-### Messages-Types:--
|
bedrock debug - [puLL-Merge] - anthropics/[email protected] Diffdiff --git .github/workflows/handle-release-pr-title-edit.yml .github/workflows/handle-release-pr-title-edit.yml
deleted file mode 100644
index 8144aaae..00000000
--- .github/workflows/handle-release-pr-title-edit.yml
+++ /dev/null
@@ -1,26 +0,0 @@
-name: Handle release PR title edits
-on:
- pull_request:
- types:
- - edited
- - unlabeled
-
-jobs:
- update_pr_content:
- name: Update pull request content
- if: |
- ((github.event.action == 'edited' && github.event.changes.title.from != github.event.pull_request.title) ||
- (github.event.action == 'unlabeled' && github.event.label.name == 'autorelease: custom version')) &&
- startsWith(github.event.pull_request.head.ref, 'release-please--') &&
- github.event.pull_request.state == 'open' &&
- github.event.sender.login != 'stainless-bot' &&
- github.event.sender.login != 'stainless-app' &&
- github.repository == 'anthropics/anthropic-sdk-typescript'
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
- - uses: stainless-api/trigger-release-please@v1
- with:
- repo: ${{ github.event.repository.full_name }}
- stainless-api-key: ${{ secrets.STAINLESS_API_KEY }}
-
diff --git .release-please-manifest.json .release-please-manifest.json
index e6b9ab03..2053c67b 100644
--- .release-please-manifest.json
+++ .release-please-manifest.json
@@ -1,5 +1,5 @@
{
- ".": "0.32.1",
- "packages/vertex-sdk": "0.5.2",
- "packages/bedrock-sdk": "0.11.2"
+ ".": "0.33.1",
+ "packages/vertex-sdk": "0.6.1",
+ "packages/bedrock-sdk": "0.12.0"
}
diff --git .stats.yml .stats.yml
index ebe0695a..19e9daeb 100644
--- .stats.yml
+++ .stats.yml
@@ -1,2 +1,2 @@
-configured_endpoints: 10
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/anthropic-25f83d91f601c1962b3701fedf829f678f306aca0758af286ee1586cc9931f75.yml
+configured_endpoints: 19
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/anthropic-be055148d227480fcacc9086c37ac8009dcb487731069ada51af35044f65bee4.yml
diff --git CHANGELOG.md CHANGELOG.md
index f332e42a..a1a57c52 100644
--- CHANGELOG.md
+++ CHANGELOG.md
@@ -1,5 +1,61 @@
# Changelog
+## 0.33.1 (2024-12-17)
+
+Full Changelog: [sdk-v0.33.0...sdk-v0.33.1](https://github.com/anthropics/anthropic-sdk-typescript/compare/sdk-v0.33.0...sdk-v0.33.1)
+
+### Bug Fixes
+
+* **vertex:** remove `anthropic_version` deletion for token counting ([88221be](https://github.com/anthropics/anthropic-sdk-typescript/commit/88221be305d6e13ccf92e6e9cdb00daba45b57db))
+
+
+### Chores
+
+* **internal:** fix some typos ([#633](https://github.com/anthropics/anthropic-sdk-typescript/issues/633)) ([a0298f5](https://github.com/anthropics/anthropic-sdk-typescript/commit/a0298f5f67b8ecd25de416dbb3eada68b86befd7))
+
+## 0.33.0 (2024-12-17)
+
+Full Changelog: [sdk-v0.32.1...sdk-v0.33.0](https://github.com/anthropics/anthropic-sdk-typescript/compare/sdk-v0.32.1...sdk-v0.33.0)
+
+### Features
+
+* **api:** general availability updates ([93d1316](https://github.com/anthropics/anthropic-sdk-typescript/commit/93d13168f950b2cdfc3b7c6664205b06418fea79))
+* **api:** general availability updates ([#631](https://github.com/anthropics/anthropic-sdk-typescript/issues/631)) ([b5c92e5](https://github.com/anthropics/anthropic-sdk-typescript/commit/b5c92e5b74c370ac3f9ba28e915bd54588a42be0))
+* **client:** add ._request_id property to object responses ([#596](https://github.com/anthropics/anthropic-sdk-typescript/issues/596)) ([9d6d584](https://github.com/anthropics/anthropic-sdk-typescript/commit/9d6d58430a216df9888434158bf628ae4b067aba))
+* **internal:** make git install file structure match npm ([#617](https://github.com/anthropics/anthropic-sdk-typescript/issues/617)) ([d3dd7d5](https://github.com/anthropics/anthropic-sdk-typescript/commit/d3dd7d5f8cad460dd18725d5c0f3c8db3f00115d))
+* **vertex:** support token counting ([9e76b4d](https://github.com/anthropics/anthropic-sdk-typescript/commit/9e76b4dc22d62b1239b382bb771b69ad8cff9442))
+
+
+### Bug Fixes
+
+* **docs:** add missing await to pagination example ([#609](https://github.com/anthropics/anthropic-sdk-typescript/issues/609)) ([e303077](https://github.com/anthropics/anthropic-sdk-typescript/commit/e303077ebab73c41adee7d25375b767c3fc78998))
+* **types:** remove anthropic-instant-1.2 model ([#599](https://github.com/anthropics/anthropic-sdk-typescript/issues/599)) ([e222a4d](https://github.com/anthropics/anthropic-sdk-typescript/commit/e222a4d0518aa80671c66ee2a25d87dc87a51316))
+
+
+### Chores
+
+* **api:** update spec version ([#607](https://github.com/anthropics/anthropic-sdk-typescript/issues/607)) ([ea44f9a](https://github.com/anthropics/anthropic-sdk-typescript/commit/ea44f9ac49dcc25a5dfa53880ebf61318ee90f6c))
+* **api:** update spec version ([#629](https://github.com/anthropics/anthropic-sdk-typescript/issues/629)) ([a25295c](https://github.com/anthropics/anthropic-sdk-typescript/commit/a25295cd6db7b57162fdd9049eb8a3c37bb94f08))
+* **bedrock,vertex:** remove unsupported countTokens method ([#597](https://github.com/anthropics/anthropic-sdk-typescript/issues/597)) ([17b7da5](https://github.com/anthropics/anthropic-sdk-typescript/commit/17b7da5ee6f35ea2bdd53a66a662871affae6341))
+* **bedrock:** remove unsupported methods ([6458dc1](https://github.com/anthropics/anthropic-sdk-typescript/commit/6458dc14544c16240a6580a21a36fcf5bde594b2))
+* **ci:** remove unneeded workflow ([#594](https://github.com/anthropics/anthropic-sdk-typescript/issues/594)) ([7572e48](https://github.com/anthropics/anthropic-sdk-typescript/commit/7572e48dbccb2090562399c7ff2d01503c86f445))
+* **client:** drop unused devDependency ([#610](https://github.com/anthropics/anthropic-sdk-typescript/issues/610)) ([5d0d523](https://github.com/anthropics/anthropic-sdk-typescript/commit/5d0d523390d8c34cae836c423940b67defb9d2aa))
+* improve browser error message ([#613](https://github.com/anthropics/anthropic-sdk-typescript/issues/613)) ([c26121e](https://github.com/anthropics/anthropic-sdk-typescript/commit/c26121e84039b7430995b6363876ea9795ba31ed))
+* **internal:** bump cross-spawn to v7.0.6 ([#624](https://github.com/anthropics/anthropic-sdk-typescript/issues/624)) ([e58ba9a](https://github.com/anthropics/anthropic-sdk-typescript/commit/e58ba9a177ec5c8545fd3a3f4fd3d2e7c722f023))
+* **internal:** remove unnecessary getRequestClient function ([#623](https://github.com/anthropics/anthropic-sdk-typescript/issues/623)) ([882c45f](https://github.com/anthropics/anthropic-sdk-typescript/commit/882c45f5a0bd1f4b996d59e6589a205c2111f46b))
+* **internal:** update isAbsoluteURL ([#627](https://github.com/anthropics/anthropic-sdk-typescript/issues/627)) ([2528ea0](https://github.com/anthropics/anthropic-sdk-typescript/commit/2528ea0dcfc83f38e76b58eaadaa5e8c5c0b188d))
+* **internal:** update spec ([#630](https://github.com/anthropics/anthropic-sdk-typescript/issues/630)) ([82cac06](https://github.com/anthropics/anthropic-sdk-typescript/commit/82cac065e2711467773c0ea62848cdf139ed5a11))
+* **internal:** use reexports not destructuring ([#604](https://github.com/anthropics/anthropic-sdk-typescript/issues/604)) ([e4daff2](https://github.com/anthropics/anthropic-sdk-typescript/commit/e4daff2b6a3fb42876ebd06ed4947c88cff919d8))
+* remove redundant word in comment ([#615](https://github.com/anthropics/anthropic-sdk-typescript/issues/615)) ([ef57a10](https://github.com/anthropics/anthropic-sdk-typescript/commit/ef57a103bcfc922a724a7c878f970dbd369b305e))
+* **tests:** limit array example length ([#611](https://github.com/anthropics/anthropic-sdk-typescript/issues/611)) ([91dc181](https://github.com/anthropics/anthropic-sdk-typescript/commit/91dc1812db2cc9e1f4660a13106bad932518b7cf))
+* **types:** nicer error class types + jsdocs ([#626](https://github.com/anthropics/anthropic-sdk-typescript/issues/626)) ([0287993](https://github.com/anthropics/anthropic-sdk-typescript/commit/0287993912ef81bd2c49603d120f49f4f979d75e))
+
+
+### Documentation
+
+* remove suggestion to use `npm` call out ([#614](https://github.com/anthropics/anthropic-sdk-typescript/issues/614)) ([6369261](https://github.com/anthropics/anthropic-sdk-typescript/commit/6369261e3597351f17b8f1a3945ca56b00eba177))
+* use latest sonnet in example snippets ([#625](https://github.com/anthropics/anthropic-sdk-typescript/issues/625)) ([f70882b](https://github.com/anthropics/anthropic-sdk-typescript/commit/f70882b0e8119a414b01b9f0b85fbe1ccb06f122))
+
## 0.32.1 (2024-11-05)
Full Changelog: [sdk-v0.32.0...sdk-v0.32.1](https://github.com/anthropics/anthropic-sdk-typescript/compare/sdk-v0.32.0...sdk-v0.32.1)
diff --git README.md README.md
index daba6e63..da3db48e 100644
--- README.md
+++ README.md
@@ -28,7 +28,7 @@ async function main() {
const message = await client.messages.create({
max_tokens: 1024,
messages: [{ role: 'user', content: 'Hello, Claude' }],
- model: 'claude-3-opus-20240229',
+ model: 'claude-3-5-sonnet-latest',
});
console.log(message.content);
@@ -49,7 +49,7 @@ const client = new Anthropic();
const stream = await client.messages.create({
max_tokens: 1024,
messages: [{ role: 'user', content: 'Hello, Claude' }],
- model: 'claude-3-opus-20240229',
+ model: 'claude-3-5-sonnet-latest',
stream: true,
});
for await (const messageStreamEvent of stream) {
@@ -76,7 +76,7 @@ async function main() {
const params: Anthropic.MessageCreateParams = {
max_tokens: 1024,
messages: [{ role: 'user', content: 'Hello, Claude' }],
- model: 'claude-3-opus-20240229',
+ model: 'claude-3-5-sonnet-latest',
};
const message: Anthropic.Message = await client.messages.create(params);
}
@@ -108,7 +108,7 @@ const anthropic = new Anthropic();
async function main() {
const stream = anthropic.messages
.stream({
- model: 'claude-3-opus-20240229',
+ model: 'claude-3-5-sonnet-latest',
max_tokens: 1024,
messages: [
{
@@ -146,7 +146,7 @@ await anthropic.beta.messages.batches.create({
{
custom_id: 'my-first-request',
params: {
- model: 'claude-3-5-sonnet-20240620',
+ model: 'claude-3-5-sonnet-latest',
max_tokens: 1024,
messages: [{ role: 'user', content: 'Hello, world' }],
},
@@ -154,7 +154,7 @@ await anthropic.beta.messages.batches.create({
{
custom_id: 'my-second-request',
params: {
- model: 'claude-3-5-sonnet-20240620',
+ model: 'claude-3-5-sonnet-latest',
max_tokens: 1024,
messages: [{ role: 'user', content: 'Hi again, friend' }],
},
@@ -198,7 +198,7 @@ async function main() {
.create({
max_tokens: 1024,
messages: [{ role: 'user', content: 'Hello, Claude' }],
- model: 'claude-3-opus-20240229',
+ model: 'claude-3-5-sonnet-latest',
})
.catch(async (err) => {
if (err instanceof Anthropic.APIError) {
@@ -227,6 +227,18 @@ Error codes are as followed:
| >=500 | `InternalServerError` |
| N/A | `APIConnectionError` |
+## Request IDs
+
+> For more information on debugging requests, see [these docs](https://docs.anthropic.com/en/api/errors#request-id)
+
+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.
+
+\`\`\`ts
+const message = await client.messages.create({ max_tokens: 1024, messages: [{ role: 'user', content: 'Hello, Claude' }], model: 'claude-3-5-sonnet-latest' });
+console.log(completion._request_id) // req_018EeWyXxfu5pfWkrYcMdjWG
+```
+
+
### Retries
Certain errors will be automatically retried 2 times by default, with a short exponential backoff.
@@ -243,7 +255,7 @@ const client = new Anthropic({
});
// Or, configure per-request:
-await client.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-5-sonnet-latest' }, {
maxRetries: 5,
}); @@ -260,7 +272,7 @@ const client = new Anthropic({ // Override per-request:
@@ -317,7 +329,7 @@ const message = await client.messages.create(
Anthropic+# Shared MessagesTypes: -- Methods: --
+## Batches BetaTypes:
+## Models MessagesTypes:
-## PromptCaching-### Messages-Types:--
|
This PR contains the following updates:
0.32.1
->0.33.1
Release Notes
anthropics/anthropic-sdk-typescript (@anthropic-ai/sdk)
v0.33.1
Full Changelog: sdk-v0.33.0...sdk-v0.33.1
Bug Fixes
anthropic_version
deletion for token counting (88221be)Chores
v0.33.0
Full Changelog: sdk-v0.32.1...sdk-v0.33.0
Features
Bug Fixes
Chores
Documentation
npm
call out (#614) (6369261)Configuration
📅 Schedule: Branch creation - "* 0-4 * * 3" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.