@@ -165,19 +165,6 @@ describe('GenerativeModel', () => {
165
165
) ;
166
166
restore ( ) ;
167
167
} ) ;
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
- } ) ;
181
168
it ( 'overrides base model params with startChatParams' , ( ) => {
182
169
const genModel = new GenerativeModel ( fakeVertexAI , {
183
170
model : 'my-model' ,
@@ -201,7 +188,10 @@ describe('GenerativeModel', () => {
201
188
{ functionDeclarations : [ { name : 'myfunc' , description : 'mydesc' } ] }
202
189
] ,
203
190
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
+ }
205
195
} ) ;
206
196
expect ( genModel . tools ?. length ) . to . equal ( 1 ) ;
207
197
expect ( genModel . toolConfig ?. functionCallingConfig ?. mode ) . to . equal (
@@ -225,7 +215,8 @@ describe('GenerativeModel', () => {
225
215
return (
226
216
value . includes ( 'myfunc' ) &&
227
217
value . includes ( FunctionCallingMode . NONE ) &&
228
- value . includes ( 'be friendly' )
218
+ value . includes ( 'be friendly' ) &&
219
+ value . includes ( 'topK' )
229
220
) ;
230
221
} ) ,
231
222
{ }
0 commit comments