Skip to content

Commit 3bfcfa7

Browse files
committed
Merge branch 'dl/vertex-integration' of https://github.com/firebase/firebase-js-sdk into dl/vertex-integration
2 parents 46e910d + 9f908d2 commit 3bfcfa7

File tree

3 files changed

+17
-13
lines changed

3 files changed

+17
-13
lines changed

packages/ai/integration/chat.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,4 +129,4 @@ describe('Chat Session', () => {
129129
});
130130
});
131131
});
132-
});
132+
});

packages/ai/integration/count-tokens.test.ts

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -131,18 +131,21 @@ describe('Count Tokens', () => {
131131
modality: Modality.IMAGE,
132132
tokenCount: 258
133133
});
134-
} else if (testConfig.ai.backend.backendType === BackendType.VERTEX_AI) {
134+
} else if (
135+
testConfig.ai.backend.backendType === BackendType.VERTEX_AI
136+
) {
135137
const expectedImageTokens = 258;
136138
expect(response.totalTokens).to.equal(expectedImageTokens);
137-
expect(
138-
response.totalBillableCharacters,
139-
).to.be.undefined; // Incorrect behavior
140-
expect(
141-
response.promptTokensDetails!.length,
142-
).to.equal(1);
139+
expect(response.totalBillableCharacters).to.be.undefined; // Incorrect behavior
140+
expect(response.promptTokensDetails!.length).to.equal(1);
143141
// Note: No text tokens are present for Vertex AI with image-only input.
144-
expect(response.promptTokensDetails![0]).to.deep.equal({ modality: Modality.IMAGE, tokenCount: 258 })
145-
expect(response.promptTokensDetails![0].tokenCount).to.equal(expectedImageTokens);
142+
expect(response.promptTokensDetails![0]).to.deep.equal({
143+
modality: Modality.IMAGE,
144+
tokenCount: 258
145+
});
146+
expect(response.promptTokensDetails![0].tokenCount).to.equal(
147+
expectedImageTokens
148+
);
146149
}
147150
});
148151

@@ -242,7 +245,9 @@ describe('Count Tokens', () => {
242245
tokenCount: 3
243246
});
244247
const expectedText = 'Describe these:';
245-
expect(response.totalBillableCharacters).to.equal(expectedText.length - 1); // Note: BillableCharacters observed as (text length - 1) for Vertex AI.
248+
expect(response.totalBillableCharacters).to.equal(
249+
expectedText.length - 1
250+
); // Note: BillableCharacters observed as (text length - 1) for Vertex AI.
246251
expect(audioDetails).to.deep.equal({ modality: Modality.AUDIO }); // Incorrect behavior because there's no tokenCount
247252
}
248253
});

packages/ai/integration/generate-content.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import {
2727
} from '../src';
2828
import { testConfigs, TOKEN_COUNT_DELTA } from './constants';
2929

30-
3130
describe('Generate Content', () => {
3231
testConfigs.forEach(testConfig => {
3332
describe(`${testConfig.toString()}`, () => {
@@ -174,4 +173,4 @@ describe('Generate Content', () => {
174173
});
175174
});
176175
});
177-
});
176+
});

0 commit comments

Comments
 (0)