Skip to content

Commit 8bb04ed

Browse files
RobertCraigiestainless-app[bot]
authored andcommitted
chore(bedrock): remove unsupported methods
1 parent a4a3729 commit 8bb04ed

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

packages/bedrock-sdk/src/client.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export class AnthropicBedrock extends Core.APIClient {
7474
this.awsSessionToken = awsSessionToken;
7575
}
7676

77-
messages: Resources.Messages = new Resources.Messages(this);
77+
messages: MessagesResource = makeMessagesResource(this);
7878
completions: Resources.Completions = new Resources.Completions(this);
7979
beta: BetaResource = makeBetaResource(this);
8080

@@ -158,6 +158,23 @@ export class AnthropicBedrock extends Core.APIClient {
158158
}
159159
}
160160

161+
/**
162+
* The Bedrock API does not currently support token counting or the Batch API.
163+
*/
164+
type MessagesResource = Omit<Resources.Messages, 'batches' | 'countTokens'>;
165+
166+
function makeMessagesResource(client: AnthropicBedrock): MessagesResource {
167+
const resource = new Resources.Messages(client);
168+
169+
// @ts-expect-error we're deleting non-optional properties
170+
delete resource.batches;
171+
172+
// @ts-expect-error we're deleting non-optional properties
173+
delete resource.countTokens;
174+
175+
return resource;
176+
}
177+
161178
/**
162179
* The Bedrock API does not currently support prompt caching, token counting or the Batch API.
163180
*/

0 commit comments

Comments
 (0)