diff --git a/.release-please-manifest.json b/.release-please-manifest.json index ac67746e..a39c3989 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,5 +1,5 @@ { - ".": "0.24.0", + ".": "0.24.1", "packages/vertex-sdk": "0.4.0", - "packages/bedrock-sdk": "0.10.0" + "packages/bedrock-sdk": "0.10.1" } diff --git a/.stats.yml b/.stats.yml index 68c3aa80..ff322255 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-70873642f89316fbc45ceaccd3583971d0eb59d433f7864ca2fa8c321a320b4c.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/anthropic-ce067ae8303fa9b7aae2e8ebf0b6e9e41509f169ba93c1807e6ed9c9e541be1a.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f07cedd..d9528dff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## 0.24.1 (2024-06-25) + +Full Changelog: [sdk-v0.24.0...sdk-v0.24.1](https://github.com/anthropics/anthropic-sdk-typescript/compare/sdk-v0.24.0...sdk-v0.24.1) + +### Bug Fixes + +* **api:** add string to tool result block ([#448](https://github.com/anthropics/anthropic-sdk-typescript/issues/448)) ([87af4e9](https://github.com/anthropics/anthropic-sdk-typescript/commit/87af4e9280923ac73295f9b32086f82c2ed0c6f2)) + + +### Chores + +* **internal:** minor reformatting ([#444](https://github.com/anthropics/anthropic-sdk-typescript/issues/444)) ([46790bb](https://github.com/anthropics/anthropic-sdk-typescript/commit/46790bb462db01ae1725e120f2bdca0a89c8f722)) +* **internal:** replace deprecated aws-sdk packages with [@smithy](https://github.com/smithy) ([#447](https://github.com/anthropics/anthropic-sdk-typescript/issues/447)) ([4328cbf](https://github.com/anthropics/anthropic-sdk-typescript/commit/4328cbf9e64f8bfc9b95a9048b18729c9a938ba5)) + ## 0.24.0 (2024-06-20) Full Changelog: [sdk-v0.23.0...sdk-v0.24.0](https://github.com/anthropics/anthropic-sdk-typescript/compare/sdk-v0.23.0...sdk-v0.24.0) diff --git a/package.json b/package.json index b5229e4f..c48fbc2b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@anthropic-ai/sdk", - "version": "0.24.0", + "version": "0.24.1", "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 44b37edb..760001ba 100644 --- a/packages/bedrock-sdk/CHANGELOG.md +++ b/packages/bedrock-sdk/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 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) + +### Chores + +* **internal:** replace deprecated aws-sdk packages with [@smithy](https://github.com/smithy) ([#447](https://github.com/anthropics/anthropic-sdk-typescript/issues/447)) ([4328cbf](https://github.com/anthropics/anthropic-sdk-typescript/commit/4328cbf9e64f8bfc9b95a9048b18729c9a938ba5)) + ## 0.10.0 (2024-05-30) Full Changelog: [bedrock-sdk-v0.9.8...bedrock-sdk-v0.10.0](https://github.com/anthropics/anthropic-sdk-typescript/compare/bedrock-sdk-v0.9.8...bedrock-sdk-v0.10.0) diff --git a/packages/bedrock-sdk/package.json b/packages/bedrock-sdk/package.json index 019cf65e..60903cd6 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.0", + "version": "0.10.1", "description": "The official TypeScript library for the Anthropic Bedrock API", "author": "Anthropic ", "types": "dist/index.d.ts", @@ -26,11 +26,10 @@ "@aws-crypto/sha256-js": "^4.0.0", "@aws-sdk/client-bedrock-runtime": "^3.423.0", "@aws-sdk/credential-providers": "^3.341.0", - "@aws-sdk/protocol-http": "^3.341.0", - "@aws-sdk/signature-v4": "^3.341.0", "@smithy/eventstream-serde-node": "^2.0.10", "@smithy/fetch-http-handler": "^2.2.1", "@smithy/protocol-http": "^3.0.6", + "@smithy/signature-v4": "^3.1.1", "@smithy/smithy-client": "^2.1.9", "@smithy/types": "^2.3.4", "@smithy/util-base64": "^2.0.0" diff --git a/packages/bedrock-sdk/src/auth.ts b/packages/bedrock-sdk/src/auth.ts index ad122a10..357f6e50 100644 --- a/packages/bedrock-sdk/src/auth.ts +++ b/packages/bedrock-sdk/src/auth.ts @@ -1,7 +1,7 @@ import assert from 'assert'; -import { SignatureV4 } from '@aws-sdk/signature-v4'; +import { SignatureV4 } from '@smithy/signature-v4'; import { fromNodeProviderChain } from '@aws-sdk/credential-providers'; -import { HttpRequest } from '@aws-sdk/protocol-http'; +import { HttpRequest } from '@smithy/protocol-http'; import { Sha256 } from '@aws-crypto/sha256-js'; import type { RequestInit } from '@anthropic-ai/sdk/_shims/index'; diff --git a/packages/bedrock-sdk/yarn.lock b/packages/bedrock-sdk/yarn.lock index d811805a..b95a21cd 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.0" + version "0.24.1" # x-release-please-end-version dependencies: "@types/node" "^18.11.18" @@ -477,14 +477,6 @@ "@smithy/types" "^2.9.1" tslib "^2.5.0" -"@aws-sdk/protocol-http@^3.341.0": - version "3.374.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/protocol-http/-/protocol-http-3.374.0.tgz#e35e76096b995bbed803897a9f4587d11ca34088" - integrity sha512-9WpRUbINdGroV3HiZZIBoJvL2ndoWk39OfwxWs2otxByppJZNN14bg/lvCx5e8ggHUti7IBk5rb0nqQZ4m05pg== - dependencies: - "@smithy/protocol-http" "^1.1.0" - tslib "^2.5.0" - "@aws-sdk/region-config-resolver@3.496.0": version "3.496.0" resolved "https://registry.yarnpkg.com/@aws-sdk/region-config-resolver/-/region-config-resolver-3.496.0.tgz#133c8a4a6d5e7672077ba124751f40b2d6efc3ed" @@ -497,14 +489,6 @@ "@smithy/util-middleware" "^2.1.1" tslib "^2.5.0" -"@aws-sdk/signature-v4@^3.341.0": - version "3.374.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/signature-v4/-/signature-v4-3.374.0.tgz#bd727f4c392acb81bc667aa4cfceeba608250771" - integrity sha512-2xLJvSdzcZZAg0lsDLUAuSQuihzK0dcxIK7WmfuJeF7DGKJFmp9czQmz5f3qiDz6IDQzvgK1M9vtJSVCslJbyQ== - dependencies: - "@smithy/signature-v4" "^1.0.1" - tslib "^2.5.0" - "@aws-sdk/token-providers@3.496.0": version "3.496.0" resolved "https://registry.yarnpkg.com/@aws-sdk/token-providers/-/token-providers-3.496.0.tgz#5b5baf0801fd591de4a28146afbdc8250197f9fa" @@ -1282,16 +1266,6 @@ "@smithy/url-parser" "^2.1.1" tslib "^2.5.0" -"@smithy/eventstream-codec@^1.1.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@smithy/eventstream-codec/-/eventstream-codec-1.1.0.tgz#bfe1308ba84ff3db3e79dc1ced8231c52ac0fc36" - integrity sha512-3tEbUb8t8an226jKB6V/Q2XU/J53lCwCzULuBPEaF4JjSh+FlCMp7TmogE/Aij5J9DwlsZ4VAD/IRDuQ/0ZtMw== - dependencies: - "@aws-crypto/crc32" "3.0.0" - "@smithy/types" "^1.2.0" - "@smithy/util-hex-encoding" "^1.1.0" - tslib "^2.5.0" - "@smithy/eventstream-codec@^2.1.1": version "2.1.1" resolved "https://registry.yarnpkg.com/@smithy/eventstream-codec/-/eventstream-codec-2.1.1.tgz#4405ab0f9c77d439c575560c4886e59ee17d6d38" @@ -1366,13 +1340,6 @@ "@smithy/types" "^2.9.1" tslib "^2.5.0" -"@smithy/is-array-buffer@^1.1.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@smithy/is-array-buffer/-/is-array-buffer-1.1.0.tgz#29948072da2b57575aa9898cda863932e842ab11" - integrity sha512-twpQ/n+3OWZJ7Z+xu43MJErmhB/WO/mMTnqR6PwWQShvSJ/emx5d1N59LQZk6ZpTAeuRWrc+eHhkzTp9NFjNRQ== - dependencies: - tslib "^2.5.0" - "@smithy/is-array-buffer@^2.1.1": version "2.1.1" resolved "https://registry.yarnpkg.com/@smithy/is-array-buffer/-/is-array-buffer-2.1.1.tgz#07b4c77ae67ed58a84400c76edd482271f9f957b" @@ -1380,6 +1347,13 @@ dependencies: tslib "^2.5.0" +"@smithy/is-array-buffer@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@smithy/is-array-buffer/-/is-array-buffer-3.0.0.tgz#9a95c2d46b8768946a9eec7f935feaddcffa5e7a" + integrity sha512-+Fsu6Q6C4RSJiy81Y8eApjEB5gVtM+oFKTffg+jSuwtvomJJrhUJBu2zS8wjXSgH/g1MKEWrzyChTBe6clb5FQ== + dependencies: + tslib "^2.6.2" + "@smithy/middleware-content-length@^2.1.1": version "2.1.1" resolved "https://registry.yarnpkg.com/@smithy/middleware-content-length/-/middleware-content-length-2.1.1.tgz#df767de12d594bc5622009fb0fc8343522697d8c" @@ -1462,14 +1436,6 @@ "@smithy/types" "^2.9.1" tslib "^2.5.0" -"@smithy/protocol-http@^1.1.0": - version "1.2.0" - resolved "https://registry.yarnpkg.com/@smithy/protocol-http/-/protocol-http-1.2.0.tgz#a554e4dabb14508f0bc2cdef9c3710e2b294be04" - integrity sha512-GfGfruksi3nXdFok5RhgtOnWe5f6BndzYfmEXISD+5gAGdayFGpjWu5pIqIweTudMtse20bGbc+7MFZXT1Tb8Q== - dependencies: - "@smithy/types" "^1.2.0" - tslib "^2.5.0" - "@smithy/protocol-http@^3.0.6", "@smithy/protocol-http@^3.1.1": version "3.1.1" resolved "https://registry.yarnpkg.com/@smithy/protocol-http/-/protocol-http-3.1.1.tgz#eee522d0ed964a72b735d64925e07bcfb7a7806f" @@ -1510,20 +1476,6 @@ "@smithy/types" "^2.9.1" tslib "^2.5.0" -"@smithy/signature-v4@^1.0.1": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@smithy/signature-v4/-/signature-v4-1.1.0.tgz#e85309995c2475d39598a4f56e68b7ed856bdfa6" - integrity sha512-fDo3m7YqXBs7neciOePPd/X9LPm5QLlDMdIC4m1H6dgNLnXfLMFNIxEfPyohGA8VW9Wn4X8lygnPSGxDZSmp0Q== - dependencies: - "@smithy/eventstream-codec" "^1.1.0" - "@smithy/is-array-buffer" "^1.1.0" - "@smithy/types" "^1.2.0" - "@smithy/util-hex-encoding" "^1.1.0" - "@smithy/util-middleware" "^1.1.0" - "@smithy/util-uri-escape" "^1.1.0" - "@smithy/util-utf8" "^1.1.0" - tslib "^2.5.0" - "@smithy/signature-v4@^2.1.1": version "2.1.1" resolved "https://registry.yarnpkg.com/@smithy/signature-v4/-/signature-v4-2.1.1.tgz#6080171e3d694f40d3f553bbc236c5c433efd4d2" @@ -1538,6 +1490,19 @@ "@smithy/util-utf8" "^2.1.1" tslib "^2.5.0" +"@smithy/signature-v4@^3.1.1": + version "3.1.1" + resolved "https://registry.yarnpkg.com/@smithy/signature-v4/-/signature-v4-3.1.1.tgz#4882aacb3260a47b8279b2ffc6a135e03e225260" + integrity sha512-2/vlG86Sr489XX8TA/F+VDA+P04ESef04pSz0wRtlQBExcSPjqO08rvrkcas2zLnJ51i+7ukOURCkgqixBYjSQ== + dependencies: + "@smithy/is-array-buffer" "^3.0.0" + "@smithy/types" "^3.2.0" + "@smithy/util-hex-encoding" "^3.0.0" + "@smithy/util-middleware" "^3.0.2" + "@smithy/util-uri-escape" "^3.0.0" + "@smithy/util-utf8" "^3.0.0" + tslib "^2.6.2" + "@smithy/smithy-client@^2.1.9", "@smithy/smithy-client@^2.3.1": version "2.3.1" resolved "https://registry.yarnpkg.com/@smithy/smithy-client/-/smithy-client-2.3.1.tgz#0c3a4a0d3935c7ad2240cc23181f276705212b1f" @@ -1550,13 +1515,6 @@ "@smithy/util-stream" "^2.1.1" tslib "^2.5.0" -"@smithy/types@^1.2.0": - version "1.2.0" - resolved "https://registry.yarnpkg.com/@smithy/types/-/types-1.2.0.tgz#9dc65767b0ee3d6681704fcc67665d6fc9b6a34e" - integrity sha512-z1r00TvBqF3dh4aHhya7nz1HhvCg4TRmw51fjMrh5do3h+ngSstt/yKlNbHeb9QxJmFbmN8KEVSWgb1bRvfEoA== - dependencies: - tslib "^2.5.0" - "@smithy/types@^2.3.4", "@smithy/types@^2.9.1": version "2.9.1" resolved "https://registry.yarnpkg.com/@smithy/types/-/types-2.9.1.tgz#ed04d4144eed3b8bd26d20fc85aae8d6e357ebb9" @@ -1564,6 +1522,13 @@ dependencies: tslib "^2.5.0" +"@smithy/types@^3.2.0": + version "3.2.0" + resolved "https://registry.yarnpkg.com/@smithy/types/-/types-3.2.0.tgz#1350fe8a50d5e35e12ffb34be46d946860b2b5ab" + integrity sha512-cKyeKAPazZRVqm7QPvcPD2jEIt2wqDPAL1KJKb0f/5I7uhollvsWZuZKLclmyP6a+Jwmr3OV3t+X0pZUUHS9BA== + dependencies: + tslib "^2.6.2" + "@smithy/url-parser@^2.1.1": version "2.1.1" resolved "https://registry.yarnpkg.com/@smithy/url-parser/-/url-parser-2.1.1.tgz#a30de227b6734650d740b6dff74d488b874e85e3" @@ -1595,14 +1560,6 @@ dependencies: tslib "^2.5.0" -"@smithy/util-buffer-from@^1.1.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@smithy/util-buffer-from/-/util-buffer-from-1.1.0.tgz#a000bd9f95c0e8d5b0edb0112f2a586daa5bed49" - integrity sha512-9m6NXE0ww+ra5HKHCHig20T+FAwxBAm7DIdwc/767uGWbRcY720ybgPacQNB96JMOI7xVr/CDa3oMzKmW4a+kw== - dependencies: - "@smithy/is-array-buffer" "^1.1.0" - tslib "^2.5.0" - "@smithy/util-buffer-from@^2.1.1": version "2.1.1" resolved "https://registry.yarnpkg.com/@smithy/util-buffer-from/-/util-buffer-from-2.1.1.tgz#f9346bf8b23c5ba6f6bdb61dd9db779441ba8d08" @@ -1611,6 +1568,14 @@ "@smithy/is-array-buffer" "^2.1.1" tslib "^2.5.0" +"@smithy/util-buffer-from@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@smithy/util-buffer-from/-/util-buffer-from-3.0.0.tgz#559fc1c86138a89b2edaefc1e6677780c24594e3" + integrity sha512-aEOHCgq5RWFbP+UDPvPot26EJHjOC+bRgse5A8V3FSShqd5E5UN4qc7zkwsvJPPAVsf73QwYcHN1/gt/rtLwQA== + dependencies: + "@smithy/is-array-buffer" "^3.0.0" + tslib "^2.6.2" + "@smithy/util-config-provider@^2.2.1": version "2.2.1" resolved "https://registry.yarnpkg.com/@smithy/util-config-provider/-/util-config-provider-2.2.1.tgz#aea0a80236d6cedaee60473802899cff4a8cc0ba" @@ -1651,13 +1616,6 @@ "@smithy/types" "^2.9.1" tslib "^2.5.0" -"@smithy/util-hex-encoding@^1.1.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@smithy/util-hex-encoding/-/util-hex-encoding-1.1.0.tgz#b5ba919aa076a3fd5e93e368e34ae2b732fa2090" - integrity sha512-7UtIE9eH0u41zpB60Jzr0oNCQ3hMJUabMcKRUVjmyHTXiWDE4vjSqN6qlih7rCNeKGbioS7f/y2Jgym4QZcKFg== - dependencies: - tslib "^2.5.0" - "@smithy/util-hex-encoding@^2.1.1": version "2.1.1" resolved "https://registry.yarnpkg.com/@smithy/util-hex-encoding/-/util-hex-encoding-2.1.1.tgz#978252b9fb242e0a59bae4ead491210688e0d15f" @@ -1665,12 +1623,12 @@ dependencies: tslib "^2.5.0" -"@smithy/util-middleware@^1.1.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@smithy/util-middleware/-/util-middleware-1.1.0.tgz#9f186489437ca2ef753c5e1de2930f76fd1edc14" - integrity sha512-6hhckcBqVgjWAqLy2vqlPZ3rfxLDhFWEmM7oLh2POGvsi7j0tHkbN7w4DFhuBExVJAbJ/qqxqZdRY6Fu7/OezQ== +"@smithy/util-hex-encoding@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@smithy/util-hex-encoding/-/util-hex-encoding-3.0.0.tgz#32938b33d5bf2a15796cd3f178a55b4155c535e6" + integrity sha512-eFndh1WEK5YMUYvy3lPlVmYY/fZcQE1D8oSf41Id2vCeIkKJXPcYDCZD+4+xViI6b1XSd7tE+s5AmXzz5ilabQ== dependencies: - tslib "^2.5.0" + tslib "^2.6.2" "@smithy/util-middleware@^2.1.1": version "2.1.1" @@ -1680,6 +1638,14 @@ "@smithy/types" "^2.9.1" tslib "^2.5.0" +"@smithy/util-middleware@^3.0.2": + version "3.0.2" + resolved "https://registry.yarnpkg.com/@smithy/util-middleware/-/util-middleware-3.0.2.tgz#6daeb9db060552d851801cd7a0afd68769e2f98b" + integrity sha512-7WW5SD0XVrpfqljBYzS5rLR+EiDzl7wCVJZ9Lo6ChNFV4VYDk37Z1QI5w/LnYtU/QKnSawYoHRd7VjSyC8QRQQ== + dependencies: + "@smithy/types" "^3.2.0" + tslib "^2.6.2" + "@smithy/util-retry@^2.1.1": version "2.1.1" resolved "https://registry.yarnpkg.com/@smithy/util-retry/-/util-retry-2.1.1.tgz#f2d3566b6e5b841028c7240c852007d4037e49b2" @@ -1703,13 +1669,6 @@ "@smithy/util-utf8" "^2.1.1" tslib "^2.5.0" -"@smithy/util-uri-escape@^1.1.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@smithy/util-uri-escape/-/util-uri-escape-1.1.0.tgz#a8c5edaf19c0efdb9b51661e840549cf600a1808" - integrity sha512-/jL/V1xdVRt5XppwiaEU8Etp5WHZj609n0xMTuehmCqdoOFbId1M+aEeDWZsQ+8JbEB/BJ6ynY2SlYmOaKtt8w== - dependencies: - tslib "^2.5.0" - "@smithy/util-uri-escape@^2.1.1": version "2.1.1" resolved "https://registry.yarnpkg.com/@smithy/util-uri-escape/-/util-uri-escape-2.1.1.tgz#7eedc93b73ecda68f12fb9cf92e9fa0fbbed4d83" @@ -1717,13 +1676,12 @@ dependencies: tslib "^2.5.0" -"@smithy/util-utf8@^1.1.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@smithy/util-utf8/-/util-utf8-1.1.0.tgz#b791ab1e3f694374edfe22811e39dd8424a1be69" - integrity sha512-p/MYV+JmqmPyjdgyN2UxAeYDj9cBqCjp0C/NsTWnnjoZUVqoeZ6IrW915L9CAKWVECgv9lVQGc4u/yz26/bI1A== +"@smithy/util-uri-escape@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@smithy/util-uri-escape/-/util-uri-escape-3.0.0.tgz#e43358a78bf45d50bb736770077f0f09195b6f54" + integrity sha512-LqR7qYLgZTD7nWLBecUi4aqolw8Mhza9ArpNEQ881MJJIU2sE5iHCK6TdyqqzcDLy0OPe10IY4T8ctVdtynubg== dependencies: - "@smithy/util-buffer-from" "^1.1.0" - tslib "^2.5.0" + tslib "^2.6.2" "@smithy/util-utf8@^2.1.1": version "2.1.1" @@ -1733,6 +1691,14 @@ "@smithy/util-buffer-from" "^2.1.1" tslib "^2.5.0" +"@smithy/util-utf8@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@smithy/util-utf8/-/util-utf8-3.0.0.tgz#1a6a823d47cbec1fd6933e5fc87df975286d9d6a" + integrity sha512-rUeT12bxFnplYDe815GXbq/oixEGHfRFFtcTF3YdDi/JaENIM6aSYYLJydG83UNzLXeRI5K8abYd/8Sp/QM0kA== + dependencies: + "@smithy/util-buffer-from" "^3.0.0" + tslib "^2.6.2" + "@ts-morph/common@~0.20.0": version "0.20.0" resolved "https://registry.yarnpkg.com/@ts-morph/common/-/common-0.20.0.tgz#3f161996b085ba4519731e4d24c35f6cba5b80af" diff --git a/packages/vertex-sdk/yarn.lock b/packages/vertex-sdk/yarn.lock index 56dee258..ae127081 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.0" + version "0.24.1" # x-release-please-end-version dependencies: "@types/node" "^18.11.18" diff --git a/src/index.ts b/src/index.ts index 65c0bc20..0976766d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,9 +1,9 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import * as Core from './core'; import * as Errors from './error'; -import { type Agent } from './_shims/index'; 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'; export interface ClientOptions { @@ -74,7 +74,9 @@ export interface ClientOptions { defaultQuery?: Core.DefaultQuery; } -/** API Client for interfacing with the Anthropic API. */ +/** + * API Client for interfacing with the Anthropic API. + */ export class Anthropic extends Core.APIClient { apiKey: string | null; authToken: string | null; @@ -114,6 +116,7 @@ export class Anthropic extends Core.APIClient { maxRetries: options.maxRetries, fetch: options.fetch, }); + this._options = options; this.apiKey = apiKey; diff --git a/src/resources/completions.ts b/src/resources/completions.ts index d8e810e2..fb3479a2 100644 --- a/src/resources/completions.ts +++ b/src/resources/completions.ts @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import * as Core from '@anthropic-ai/sdk/core'; -import { APIPromise } from '@anthropic-ai/sdk/core'; 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'; diff --git a/src/resources/messages.ts b/src/resources/messages.ts index 03497af4..e55c3c6a 100644 --- a/src/resources/messages.ts +++ b/src/resources/messages.ts @@ -1,13 +1,14 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import * as Core from '@anthropic-ai/sdk/core'; -import { APIPromise } from '@anthropic-ai/sdk/core'; 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'; -export { 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'; + export class Messages extends APIResource { /** * Create a Message. @@ -331,7 +332,7 @@ export interface ToolResultBlockParam { type: 'tool_result'; - content?: Array; + content?: string | Array; is_error?: boolean; } diff --git a/src/version.ts b/src/version.ts index 7434729b..9979ad8b 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '0.24.0'; // x-release-please-version +export const VERSION = '0.24.1'; // x-release-please-version diff --git a/tests/stringifyQuery.test.ts b/tests/stringifyQuery.test.ts index 82320845..1fef3436 100644 --- a/tests/stringifyQuery.test.ts +++ b/tests/stringifyQuery.test.ts @@ -1,8 +1,10 @@ -import { APIClient } from '@anthropic-ai/sdk/core'; +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -const { stringifyQuery } = APIClient.prototype as any; +import { Anthropic } from '@anthropic-ai/sdk'; -describe('APIClient.stringifyQuery', () => { +const { stringifyQuery } = Anthropic.prototype as any; + +describe(stringifyQuery, () => { for (const [input, expected] of [ [{ a: '1', b: 2, c: true }, 'a=1&b=2&c=true'], [{ a: null, b: false, c: undefined }, 'a=&b=false'], @@ -18,6 +20,7 @@ describe('APIClient.stringifyQuery', () => { expect(stringifyQuery(input)).toEqual(expected); }); } + for (const value of [[], {}, new Date()]) { it(`${JSON.stringify(value)} -> `, () => { expect(() => stringifyQuery({ value })).toThrow(`Cannot stringify type ${typeof value}`);