Skip to content

Commit

Permalink
VertexAI: use updated set of mock responses (#8421)
Browse files Browse the repository at this point in the history
  • Loading branch information
tanzimfh authored Aug 13, 2024
1 parent e6b8525 commit cfca9c6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions packages/vertexai/src/methods/generate-content.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,9 @@ describe('generateContent()', () => {
);
});
it('unknown enum - should ignore', async () => {
const mockResponse = getMockResponse('unary-success-unknown-enum.json');
const mockResponse = getMockResponse(
'unary-success-unknown-enum-safety-ratings.json'
);
const makeRequestStub = stub(request, 'makeRequest').resolves(
mockResponse as Response
);
Expand All @@ -197,7 +199,7 @@ describe('generateContent()', () => {
'model',
fakeRequestParams
);
expect(result.response.text()).to.include('30 minutes of brewing');
expect(result.response.text()).to.include('Some text');
expect(makeRequestStub).to.be.calledWith(
'model',
Task.GENERATE_CONTENT,
Expand Down
2 changes: 1 addition & 1 deletion packages/vertexai/src/requests/stream-reader.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ describe('processStream', () => {
});
it('unknown enum - should ignore', async () => {
const fakeResponse = getMockResponseStreaming(
'streaming-success-unknown-enum.txt'
'streaming-success-unknown-safety-enum.txt'
);
const result = processStream(fakeResponse as Response);
const aggregatedResponse = await result.response;
Expand Down
2 changes: 1 addition & 1 deletion scripts/update_vertexai_responses.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# This script replaces mock response files for Vertex AI unit tests with a fresh
# clone of the shared repository of Vertex AI test data.

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

Expand Down

0 comments on commit cfca9c6

Please sign in to comment.