@@ -92,7 +92,7 @@ describe('Google AI Mappers', () => {
9292 } ;
9393 const mappedRequest = mapGenerateContentRequest ( request ) ;
9494 expect ( loggerWarnStub ) . to . have . been . calledOnceWith (
95- 'topK in GenerationConfig has been rounded to the nearest integer.'
95+ 'topK in GenerationConfig has been rounded to the nearest integer to match the format for Google AI requests .'
9696 ) ;
9797 expect ( mappedRequest . generationConfig ?. topK ) . to . equal ( 16 ) ;
9898 } ) ;
@@ -133,12 +133,8 @@ describe('Google AI Mappers', () => {
133133 const googleAIMockResponse : GoogleAIGenerateContentResponse = await (
134134 getMockResponse ( 'googleAI' , 'unary-success-citations.txt' ) as Response
135135 ) . json ( ) ;
136- console . log ( JSON . stringify ( googleAIMockResponse ) ) ;
137136 const mappedResponse = mapGenerateContentResponse ( googleAIMockResponse ) ;
138137
139- console . log ( JSON . stringify ( googleAIMockResponse ) ) ;
140- console . log ( JSON . stringify ( mappedResponse ) ) ;
141-
142138 expect ( mappedResponse . candidates ) . to . exist ;
143139 expect ( mappedResponse . candidates ?. [ 0 ] . content . parts [ 0 ] . text ) . to . contain (
144140 'quantum mechanics'
@@ -242,16 +238,17 @@ describe('Google AI Mappers', () => {
242238
243239 it ( 'should map a minimal Vertex AI CountTokensRequest' , ( ) => {
244240 const vertexRequest : CountTokensRequest = {
245- contents : fakeContents
241+ contents : fakeContents ,
242+ systemInstruction : { role : 'system' , parts : [ { text : 'Be nice' } ] } ,
243+ generationConfig : { temperature : 0.8 }
246244 } ;
247245
248246 const expectedGoogleAIRequest : GoogleAICountTokensRequest = {
249247 generateContentRequest : {
250248 model : fakeModel ,
251249 contents : vertexRequest . contents ,
252- systemInstruction : undefined ,
253- tools : undefined ,
254- generationConfig : undefined
250+ systemInstruction : { role : 'system' , parts : [ { text : 'Be nice' } ] } ,
251+ generationConfig : { temperature : 0.8 }
255252 }
256253 } ;
257254
0 commit comments