From 6f6db164d2526c2fb272151f4d68140da27ce1ea Mon Sep 17 00:00:00 2001 From: Robert Craigie Date: Fri, 8 Nov 2024 18:26:41 +0000 Subject: [PATCH] chore(bedrock,vertex): remove unsupported countTokens method (#597) --- packages/bedrock-sdk/src/client.ts | 7 +++++-- packages/vertex-sdk/src/client.ts | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/packages/bedrock-sdk/src/client.ts b/packages/bedrock-sdk/src/client.ts index 523df8ba..952854d7 100644 --- a/packages/bedrock-sdk/src/client.ts +++ b/packages/bedrock-sdk/src/client.ts @@ -159,10 +159,10 @@ export class AnthropicBedrock extends Core.APIClient { } /** - * The Bedrock API does not currently support prompt caching or the Batch API. + * The Bedrock API does not currently support prompt caching, token counting or the Batch API. */ type BetaResource = Omit & { - messages: Omit; + messages: Omit; }; function makeBetaResource(client: AnthropicBedrock): BetaResource { @@ -174,5 +174,8 @@ function makeBetaResource(client: AnthropicBedrock): BetaResource { // @ts-expect-error we're deleting non-optional properties delete resource.messages.batches; + // @ts-expect-error we're deleting non-optional properties + delete resource.messages.countTokens; + return resource; } diff --git a/packages/vertex-sdk/src/client.ts b/packages/vertex-sdk/src/client.ts index 06231649..685be178 100644 --- a/packages/vertex-sdk/src/client.ts +++ b/packages/vertex-sdk/src/client.ts @@ -152,10 +152,10 @@ export class AnthropicVertex extends Core.APIClient { } /** - * The Vertex API does not currently support prompt caching or the Batch API. + * The Vertex API does not currently support prompt caching, token counting or the Batch API. */ type BetaResource = Omit & { - messages: Omit; + messages: Omit; }; function makeBetaResource(client: AnthropicVertex): BetaResource { @@ -167,5 +167,8 @@ function makeBetaResource(client: AnthropicVertex): BetaResource { // @ts-expect-error we're deleting non-optional properties delete resource.messages.batches; + // @ts-expect-error we're deleting non-optional properties + delete resource.messages.countTokens; + return resource; }