Skip to content

Commit cfca9c6

Browse files
authored
VertexAI: use updated set of mock responses (#8421)
1 parent e6b8525 commit cfca9c6

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

packages/vertexai/src/methods/generate-content.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,9 @@ describe('generateContent()', () => {
188188
);
189189
});
190190
it('unknown enum - should ignore', async () => {
191-
const mockResponse = getMockResponse('unary-success-unknown-enum.json');
191+
const mockResponse = getMockResponse(
192+
'unary-success-unknown-enum-safety-ratings.json'
193+
);
192194
const makeRequestStub = stub(request, 'makeRequest').resolves(
193195
mockResponse as Response
194196
);
@@ -197,7 +199,7 @@ describe('generateContent()', () => {
197199
'model',
198200
fakeRequestParams
199201
);
200-
expect(result.response.text()).to.include('30 minutes of brewing');
202+
expect(result.response.text()).to.include('Some text');
201203
expect(makeRequestStub).to.be.calledWith(
202204
'model',
203205
Task.GENERATE_CONTENT,

packages/vertexai/src/requests/stream-reader.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ describe('processStream', () => {
174174
});
175175
it('unknown enum - should ignore', async () => {
176176
const fakeResponse = getMockResponseStreaming(
177-
'streaming-success-unknown-enum.txt'
177+
'streaming-success-unknown-safety-enum.txt'
178178
);
179179
const result = processStream(fakeResponse as Response);
180180
const aggregatedResponse = await result.response;

scripts/update_vertexai_responses.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# This script replaces mock response files for Vertex AI unit tests with a fresh
1818
# clone of the shared repository of Vertex AI test data.
1919

20-
RESPONSES_VERSION='v1.*' # The major version of mock responses to use
20+
RESPONSES_VERSION='v2.*' # The major version of mock responses to use
2121
REPO_NAME="vertexai-sdk-test-data"
2222
REPO_LINK="https://github.com/FirebaseExtended/$REPO_NAME.git"
2323

0 commit comments

Comments
 (0)