@@ -159,35 +159,38 @@ describe("VertexHandler", () => {
159159 outputTokens : 5 ,
160160 } )
161161
162- expect ( mockCreate ) . toHaveBeenCalledWith ( {
163- model : "claude-3-5-sonnet-v2@20241022" ,
164- max_tokens : 8192 ,
165- temperature : 0 ,
166- system : [
167- {
168- type : "text" ,
169- text : "You are a helpful assistant" ,
170- cache_control : { type : "ephemeral" } ,
171- } ,
172- ] ,
173- messages : [
174- {
175- role : "user" ,
176- content : [
177- {
178- type : "text" ,
179- text : "Hello" ,
180- cache_control : { type : "ephemeral" } ,
181- } ,
182- ] ,
183- } ,
184- {
185- role : "assistant" ,
186- content : "Hi there!" ,
187- } ,
188- ] ,
189- stream : true ,
190- } )
162+ expect ( mockCreate ) . toHaveBeenCalledWith (
163+ {
164+ model : "claude-3-5-sonnet-v2@20241022" ,
165+ max_tokens : 8192 ,
166+ temperature : 0 ,
167+ system : [
168+ {
169+ type : "text" ,
170+ text : "You are a helpful assistant" ,
171+ cache_control : { type : "ephemeral" } ,
172+ } ,
173+ ] ,
174+ messages : [
175+ {
176+ role : "user" ,
177+ content : [
178+ {
179+ type : "text" ,
180+ text : "Hello" ,
181+ cache_control : { type : "ephemeral" } ,
182+ } ,
183+ ] ,
184+ } ,
185+ {
186+ role : "assistant" ,
187+ content : "Hi there!" ,
188+ } ,
189+ ] ,
190+ stream : true ,
191+ } ,
192+ { } ,
193+ )
191194 } )
192195
193196 it ( "should handle multiple content blocks with line breaks for Claude" , async ( ) => {
@@ -401,6 +404,7 @@ describe("VertexHandler", () => {
401404 } ) ,
402405 ] ,
403406 } ) ,
407+ { signal : undefined } ,
404408 )
405409 } )
406410
@@ -613,18 +617,21 @@ describe("VertexHandler", () => {
613617
614618 const result = await handler . completePrompt ( "Test prompt" )
615619 expect ( result ) . toBe ( "Test response" )
616- expect ( handler [ "client" ] . messages . create ) . toHaveBeenCalledWith ( {
617- model : "claude-3-5-sonnet-v2@20241022" ,
618- max_tokens : 8192 ,
619- temperature : 0 ,
620- messages : [
621- {
622- role : "user" ,
623- content : [ { type : "text" , text : "Test prompt" , cache_control : { type : "ephemeral" } } ] ,
624- } ,
625- ] ,
626- stream : false ,
627- } )
620+ expect ( handler [ "client" ] . messages . create ) . toHaveBeenCalledWith (
621+ {
622+ model : "claude-3-5-sonnet-v2@20241022" ,
623+ max_tokens : 8192 ,
624+ temperature : 0 ,
625+ messages : [
626+ {
627+ role : "user" ,
628+ content : [ { type : "text" , text : "Test prompt" , cache_control : { type : "ephemeral" } } ] ,
629+ } ,
630+ ] ,
631+ stream : false ,
632+ } ,
633+ { } ,
634+ )
628635 } )
629636
630637 it ( "should handle API errors for Claude" , async ( ) => {
@@ -806,6 +813,7 @@ describe("VertexHandler", () => {
806813 thinking : { type : "enabled" , budget_tokens : 4096 } ,
807814 temperature : 1.0 , // Thinking requires temperature 1.0
808815 } ) ,
816+ { } ,
809817 )
810818 } )
811819 } )
0 commit comments