diff --git a/packages/vertex-sdk/src/client.ts b/packages/vertex-sdk/src/client.ts index 6328d2b3..30258db6 100644 --- a/packages/vertex-sdk/src/client.ts +++ b/packages/vertex-sdk/src/client.ts @@ -83,6 +83,7 @@ export class AnthropicVertex extends Core.APIClient { } messages: Resources.Messages = new Resources.Messages(this); + beta: BetaResource = makeBetaResource(this); protected override defaultQuery(): Core.DefaultQuery | undefined { return this._options.defaultQuery; @@ -142,3 +143,22 @@ export class AnthropicVertex extends Core.APIClient { return super.buildRequest(options); } } + +/** + * The Vertex API does not currently support prompt caching or the Batch API. + */ +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; + + return resource; +}