Skip to content
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

chore(bedrock,vertex): remove unsupported countTokens method #597

Merged
merged 2 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions packages/bedrock-sdk/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Resources.Beta, 'promptCaching' | 'messages'> & {
messages: Omit<Resources.Beta['messages'], 'batches'>;
messages: Omit<Resources.Beta['messages'], 'batches' | 'countTokens'>;
};

function makeBetaResource(client: AnthropicBedrock): BetaResource {
Expand All @@ -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;
}
7 changes: 5 additions & 2 deletions packages/vertex-sdk/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Resources.Beta, 'promptCaching' | 'messages'> & {
messages: Omit<Resources.Beta['messages'], 'batches'>;
messages: Omit<Resources.Beta['messages'], 'batches' | 'countTokens'>;
};

function makeBetaResource(client: AnthropicVertex): BetaResource {
Expand All @@ -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;
}