File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,8 @@ export class Client {
3535 vertexai : true ,
3636 httpOptions : options . apiEndpoint ? { baseUrl : options . apiEndpoint } :
3737 undefined ,
38- userAgentExtra : `vertex-genai-modules/${ SDK_VERSION } ` ,
38+ userAgentExtra :
39+ `vertex-genai-modules/${ SDK_VERSION } ` , // gl-node/${process.version}
3940 } ) ;
4041
4142 this . _agentEnginesInternal = new AgentEngines ( this . apiClient ) ;
Original file line number Diff line number Diff line change @@ -86,6 +86,18 @@ export class ReplayClient extends Client {
8686 }
8787
8888 const [ url , init ] = actualArgs ;
89+
90+
91+ const actualHeaders = new Headers ( init ?. headers || { } ) ;
92+ const xGoogApiClient = actualHeaders . get ( 'x-goog-api-client' ) || '' ;
93+ const userAgent = actualHeaders . get ( 'user-agent' ) || '' ;
94+
95+ // Validate that the required identifiers are present
96+ expect ( xGoogApiClient ) . toContain ( 'vertex-genai-modules/' ) ;
97+ expect ( xGoogApiClient ) . toContain ( 'gl-node/' ) ;
98+ expect ( userAgent ) . toContain ( 'vertex-genai-modules/' ) ;
99+ expect ( userAgent ) . toContain ( 'gl-node/' ) ;
100+
89101 const normalizedActual = normalizeRequest ( init || { } , url . toString ( ) ) ;
90102 assertMessagesEqual ( normalizedActual , expectedRequestCamel ) ;
91103 }
You can’t perform that action at this time.
0 commit comments