diff --git a/packages/bedrock-sdk/src/client.ts b/packages/bedrock-sdk/src/client.ts index 952854d7..86bd17ef 100644 --- a/packages/bedrock-sdk/src/client.ts +++ b/packages/bedrock-sdk/src/client.ts @@ -74,7 +74,7 @@ export class AnthropicBedrock extends Core.APIClient { this.awsSessionToken = awsSessionToken; } - messages: Resources.Messages = new Resources.Messages(this); + messages: MessagesResource = makeMessagesResource(this); completions: Resources.Completions = new Resources.Completions(this); beta: BetaResource = makeBetaResource(this); @@ -158,6 +158,23 @@ export class AnthropicBedrock extends Core.APIClient { } } +/** + * The Bedrock API does not currently support token counting or the Batch API. + */ +type MessagesResource = Omit; + +function makeMessagesResource(client: AnthropicBedrock): MessagesResource { + const resource = new Resources.Messages(client); + + // @ts-expect-error we're deleting non-optional properties + delete resource.batches; + + // @ts-expect-error we're deleting non-optional properties + delete resource.countTokens; + + return resource; +} + /** * The Bedrock API does not currently support prompt caching, token counting or the Batch API. */