From 2cbeabc6f0175297c98b5d706a0038d793150e8e Mon Sep 17 00:00:00 2001 From: Robert Craigie Date: Mon, 20 Jan 2025 21:23:00 +0000 Subject: [PATCH] fix(vertex): add beta.messages.countTokens method --- packages/vertex-sdk/src/client.ts | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/packages/vertex-sdk/src/client.ts b/packages/vertex-sdk/src/client.ts index f1046455..0f8a1626 100644 --- a/packages/vertex-sdk/src/client.ts +++ b/packages/vertex-sdk/src/client.ts @@ -179,23 +179,17 @@ function makeMessagesResource(client: AnthropicVertex): MessagesResource { } /** - * The Vertex API does not currently support prompt caching, token counting or the Batch API. + * The Vertex API does not currently support the Batch API. */ -type BetaResource = Omit & { - messages: Omit; +type BetaResource = Omit & { + messages: Omit; }; function makeBetaResource(client: AnthropicVertex): BetaResource { const resource = new Resources.Beta(client); - // @ts-expect-error we're deleting non-optional properties - delete resource.promptCaching; - // @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; }