@@ -72,6 +72,7 @@ describe('processStream', () => {
7272 } ) ;
7373 it ( 'streaming response - short' , async ( ) => {
7474 const fakeResponse = getMockResponseStreaming (
75+ 'vertexAI' ,
7576 'streaming-success-basic-reply-short.txt'
7677 ) ;
7778 const result = processStream ( fakeResponse as Response ) ;
@@ -83,6 +84,7 @@ describe('processStream', () => {
8384 } ) ;
8485 it ( 'streaming response - long' , async ( ) => {
8586 const fakeResponse = getMockResponseStreaming (
87+ 'vertexAI' ,
8688 'streaming-success-basic-reply-long.txt'
8789 ) ;
8890 const result = processStream ( fakeResponse as Response ) ;
@@ -95,6 +97,7 @@ describe('processStream', () => {
9597 } ) ;
9698 it ( 'streaming response - long - big chunk' , async ( ) => {
9799 const fakeResponse = getMockResponseStreaming (
100+ 'vertexAI' ,
98101 'streaming-success-basic-reply-long.txt' ,
99102 1e6
100103 ) ;
@@ -107,7 +110,10 @@ describe('processStream', () => {
107110 expect ( aggregatedResponse . text ( ) ) . to . include ( 'to their owners.' ) ;
108111 } ) ;
109112 it ( 'streaming response - utf8' , async ( ) => {
110- const fakeResponse = getMockResponseStreaming ( 'streaming-success-utf8.txt' ) ;
113+ const fakeResponse = getMockResponseStreaming (
114+ 'vertexAI' ,
115+ 'streaming-success-utf8.txt'
116+ ) ;
111117 const result = processStream ( fakeResponse as Response ) ;
112118 for await ( const response of result . stream ) {
113119 expect ( response . text ( ) ) . to . not . be . empty ;
@@ -118,6 +124,7 @@ describe('processStream', () => {
118124 } ) ;
119125 it ( 'streaming response - functioncall' , async ( ) => {
120126 const fakeResponse = getMockResponseStreaming (
127+ 'vertexAI' ,
121128 'streaming-success-function-call-short.txt'
122129 ) ;
123130 const result = processStream ( fakeResponse as Response ) ;
@@ -141,6 +148,7 @@ describe('processStream', () => {
141148 } ) ;
142149 it ( 'candidate had finishReason' , async ( ) => {
143150 const fakeResponse = getMockResponseStreaming (
151+ 'vertexAI' ,
144152 'streaming-failure-finish-reason-safety.txt'
145153 ) ;
146154 const result = processStream ( fakeResponse as Response ) ;
@@ -153,6 +161,7 @@ describe('processStream', () => {
153161 } ) ;
154162 it ( 'prompt was blocked' , async ( ) => {
155163 const fakeResponse = getMockResponseStreaming (
164+ 'vertexAI' ,
156165 'streaming-failure-prompt-blocked-safety.txt'
157166 ) ;
158167 const result = processStream ( fakeResponse as Response ) ;
@@ -165,6 +174,7 @@ describe('processStream', () => {
165174 } ) ;
166175 it ( 'empty content' , async ( ) => {
167176 const fakeResponse = getMockResponseStreaming (
177+ 'vertexAI' ,
168178 'streaming-failure-empty-content.txt'
169179 ) ;
170180 const result = processStream ( fakeResponse as Response ) ;
@@ -176,6 +186,7 @@ describe('processStream', () => {
176186 } ) ;
177187 it ( 'unknown enum - should ignore' , async ( ) => {
178188 const fakeResponse = getMockResponseStreaming (
189+ 'vertexAI' ,
179190 'streaming-success-unknown-safety-enum.txt'
180191 ) ;
181192 const result = processStream ( fakeResponse as Response ) ;
@@ -187,6 +198,7 @@ describe('processStream', () => {
187198 } ) ;
188199 it ( 'recitation ending with a missing content field' , async ( ) => {
189200 const fakeResponse = getMockResponseStreaming (
201+ 'vertexAI' ,
190202 'streaming-failure-recitation-no-content.txt'
191203 ) ;
192204 const result = processStream ( fakeResponse as Response ) ;
@@ -205,6 +217,7 @@ describe('processStream', () => {
205217 } ) ;
206218 it ( 'handles citations' , async ( ) => {
207219 const fakeResponse = getMockResponseStreaming (
220+ 'vertexAI' ,
208221 'streaming-success-citations.txt'
209222 ) ;
210223 const result = processStream ( fakeResponse as Response ) ;
@@ -224,6 +237,7 @@ describe('processStream', () => {
224237 } ) ;
225238 it ( 'removes empty text parts' , async ( ) => {
226239 const fakeResponse = getMockResponseStreaming (
240+ 'vertexAI' ,
227241 'streaming-success-empty-text-part.txt'
228242 ) ;
229243 const result = processStream ( fakeResponse as Response ) ;
0 commit comments