@@ -72,6 +72,7 @@ describe('processStream', () => {
72
72
} ) ;
73
73
it ( 'streaming response - short' , async ( ) => {
74
74
const fakeResponse = getMockResponseStreaming (
75
+ 'vertexAI' ,
75
76
'streaming-success-basic-reply-short.txt'
76
77
) ;
77
78
const result = processStream ( fakeResponse as Response ) ;
@@ -83,6 +84,7 @@ describe('processStream', () => {
83
84
} ) ;
84
85
it ( 'streaming response - long' , async ( ) => {
85
86
const fakeResponse = getMockResponseStreaming (
87
+ 'vertexAI' ,
86
88
'streaming-success-basic-reply-long.txt'
87
89
) ;
88
90
const result = processStream ( fakeResponse as Response ) ;
@@ -95,6 +97,7 @@ describe('processStream', () => {
95
97
} ) ;
96
98
it ( 'streaming response - long - big chunk' , async ( ) => {
97
99
const fakeResponse = getMockResponseStreaming (
100
+ 'vertexAI' ,
98
101
'streaming-success-basic-reply-long.txt' ,
99
102
1e6
100
103
) ;
@@ -107,7 +110,10 @@ describe('processStream', () => {
107
110
expect ( aggregatedResponse . text ( ) ) . to . include ( 'to their owners.' ) ;
108
111
} ) ;
109
112
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
+ ) ;
111
117
const result = processStream ( fakeResponse as Response ) ;
112
118
for await ( const response of result . stream ) {
113
119
expect ( response . text ( ) ) . to . not . be . empty ;
@@ -118,6 +124,7 @@ describe('processStream', () => {
118
124
} ) ;
119
125
it ( 'streaming response - functioncall' , async ( ) => {
120
126
const fakeResponse = getMockResponseStreaming (
127
+ 'vertexAI' ,
121
128
'streaming-success-function-call-short.txt'
122
129
) ;
123
130
const result = processStream ( fakeResponse as Response ) ;
@@ -141,6 +148,7 @@ describe('processStream', () => {
141
148
} ) ;
142
149
it ( 'candidate had finishReason' , async ( ) => {
143
150
const fakeResponse = getMockResponseStreaming (
151
+ 'vertexAI' ,
144
152
'streaming-failure-finish-reason-safety.txt'
145
153
) ;
146
154
const result = processStream ( fakeResponse as Response ) ;
@@ -153,6 +161,7 @@ describe('processStream', () => {
153
161
} ) ;
154
162
it ( 'prompt was blocked' , async ( ) => {
155
163
const fakeResponse = getMockResponseStreaming (
164
+ 'vertexAI' ,
156
165
'streaming-failure-prompt-blocked-safety.txt'
157
166
) ;
158
167
const result = processStream ( fakeResponse as Response ) ;
@@ -165,6 +174,7 @@ describe('processStream', () => {
165
174
} ) ;
166
175
it ( 'empty content' , async ( ) => {
167
176
const fakeResponse = getMockResponseStreaming (
177
+ 'vertexAI' ,
168
178
'streaming-failure-empty-content.txt'
169
179
) ;
170
180
const result = processStream ( fakeResponse as Response ) ;
@@ -176,6 +186,7 @@ describe('processStream', () => {
176
186
} ) ;
177
187
it ( 'unknown enum - should ignore' , async ( ) => {
178
188
const fakeResponse = getMockResponseStreaming (
189
+ 'vertexAI' ,
179
190
'streaming-success-unknown-safety-enum.txt'
180
191
) ;
181
192
const result = processStream ( fakeResponse as Response ) ;
@@ -187,6 +198,7 @@ describe('processStream', () => {
187
198
} ) ;
188
199
it ( 'recitation ending with a missing content field' , async ( ) => {
189
200
const fakeResponse = getMockResponseStreaming (
201
+ 'vertexAI' ,
190
202
'streaming-failure-recitation-no-content.txt'
191
203
) ;
192
204
const result = processStream ( fakeResponse as Response ) ;
@@ -205,6 +217,7 @@ describe('processStream', () => {
205
217
} ) ;
206
218
it ( 'handles citations' , async ( ) => {
207
219
const fakeResponse = getMockResponseStreaming (
220
+ 'vertexAI' ,
208
221
'streaming-success-citations.txt'
209
222
) ;
210
223
const result = processStream ( fakeResponse as Response ) ;
@@ -224,6 +237,7 @@ describe('processStream', () => {
224
237
} ) ;
225
238
it ( 'removes empty text parts' , async ( ) => {
226
239
const fakeResponse = getMockResponseStreaming (
240
+ 'vertexAI' ,
227
241
'streaming-success-empty-text-part.txt'
228
242
) ;
229
243
const result = processStream ( fakeResponse as Response ) ;
0 commit comments