File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
providers/google-vertex-ai Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -940,6 +940,7 @@ export function constructConfigFromRequestHeaders(
940940 vertexModelName : requestHeaders [ `x-${ POWERED_BY } -provider-model` ] ,
941941 vertexBatchEndpoint :
942942 requestHeaders [ `x-${ POWERED_BY } -provider-batch-endpoint` ] ,
943+ anthropicBeta : requestHeaders [ `x-${ POWERED_BY } -anthropic-beta` ] ,
943944 } ;
944945
945946 const fireworksConfig = {
Original file line number Diff line number Diff line change @@ -62,16 +62,23 @@ export const GoogleApiConfig: ProviderAPIConfig = {
6262 }
6363 return `https://${ vertexRegion } -aiplatform.googleapis.com` ;
6464 } ,
65- headers : async ( { c, providerOptions } ) => {
65+ headers : async ( { c, providerOptions, gatewayRequestBody } ) => {
6666 const { apiKey, vertexServiceAccountJson } = providerOptions ;
6767 let authToken = apiKey ;
6868 if ( vertexServiceAccountJson ) {
6969 authToken = await getAccessToken ( c , vertexServiceAccountJson ) ;
7070 }
7171
72+ const anthropicBeta =
73+ providerOptions ?. [ 'anthropicBeta' ] ??
74+ gatewayRequestBody ?. [ 'anthropic_beta' ] ;
75+
7276 return {
7377 'Content-Type' : 'application/json' ,
7478 Authorization : `Bearer ${ authToken } ` ,
79+ ...( anthropicBeta && {
80+ 'anthropic-beta' : anthropicBeta ,
81+ } ) ,
7582 } ;
7683 } ,
7784 getEndpoint : ( {
You can’t perform that action at this time.
0 commit comments