@@ -165,19 +165,6 @@ describe('GenerativeModel', () => {
165165 ) ;
166166 restore ( ) ;
167167 } ) ;
168- it ( 'passes base model params through to ChatSession when there are no startChatParams' , async ( ) => {
169- const genModel = new GenerativeModel ( fakeVertexAI , {
170- model : 'my-model' ,
171- generationConfig : {
172- topK : 1
173- }
174- } ) ;
175- const chatSession = genModel . startChat ( ) ;
176- expect ( chatSession . params ?. generationConfig ) . to . deep . equal ( {
177- topK : 1
178- } ) ;
179- restore ( ) ;
180- } ) ;
181168 it ( 'overrides base model params with startChatParams' , ( ) => {
182169 const genModel = new GenerativeModel ( fakeVertexAI , {
183170 model : 'my-model' ,
@@ -201,7 +188,10 @@ describe('GenerativeModel', () => {
201188 { functionDeclarations : [ { name : 'myfunc' , description : 'mydesc' } ] }
202189 ] ,
203190 toolConfig : { functionCallingConfig : { mode : FunctionCallingMode . NONE } } ,
204- systemInstruction : { role : 'system' , parts : [ { text : 'be friendly' } ] }
191+ systemInstruction : { role : 'system' , parts : [ { text : 'be friendly' } ] } ,
192+ generationConfig : {
193+ topK : 1
194+ }
205195 } ) ;
206196 expect ( genModel . tools ?. length ) . to . equal ( 1 ) ;
207197 expect ( genModel . toolConfig ?. functionCallingConfig ?. mode ) . to . equal (
@@ -225,7 +215,8 @@ describe('GenerativeModel', () => {
225215 return (
226216 value . includes ( 'myfunc' ) &&
227217 value . includes ( FunctionCallingMode . NONE ) &&
228- value . includes ( 'be friendly' )
218+ value . includes ( 'be friendly' ) &&
219+ value . includes ( 'topK' )
229220 ) ;
230221 } ) ,
231222 { }
0 commit comments