Skip to content

Commit a41193d

Browse files
RobertCraigiestainless-app[bot]
authored andcommitted
fix(vertex): correct messages beta handling
1 parent 0f8b00c commit a41193d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/vertex-sdk/src/client.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { type RequestInit } from '@anthropic-ai/sdk/_shims/index';
55
import { GoogleAuth } from 'google-auth-library';
66

77
const DEFAULT_VERSION = 'vertex-2023-10-16';
8+
const MODEL_ENDPOINTS = new Set<string>(['/v1/messages', '/v1/messages?beta=true']);
89

910
export type ClientOptions = Omit<API.ClientOptions, 'apiKey' | 'authToken'> & {
1011
region?: string | null | undefined;
@@ -119,7 +120,7 @@ export class AnthropicVertex extends Core.APIClient {
119120
}
120121
}
121122

122-
if (options.path === '/v1/messages' && options.method === 'post') {
123+
if (MODEL_ENDPOINTS.has(options.path) && options.method === 'post') {
123124
if (!this.projectId) {
124125
throw new Error(
125126
'No projectId was given and it could not be resolved from credentials. The client should be instantiated with the `projectId` option or the `ANTHROPIC_VERTEX_PROJECT_ID` environment variable should be set.',

0 commit comments

Comments
 (0)