Skip to content

Commit 32a6788

Browse files
authored
[Vertex AI] Fix testCountTokens_jsonSchema integration test (#14049)
1 parent 869c7f5 commit 32a6788

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

FirebaseVertexAI/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Unreleased
2+
- [changed] The token counts from `GenerativeModel.countTokens(...)` now include
3+
tokens from the schema for JSON output and function calling; reported token
4+
counts will now be higher if using these features.
5+
16
# 11.5.0
27
- [fixed] Fixed an issue where `VertexAI.vertexAI(app: app1)` and
38
`VertexAI.vertexAI(app: app2)` would return the same instance if their

FirebaseVertexAI/Tests/TestApp/Tests/Integration/IntegrationTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,8 @@ final class IntegrationTests: XCTestCase {
217217

218218
let response = try await model.countTokens(prompt)
219219

220-
XCTAssertEqual(response.totalTokens, 34)
221-
XCTAssertEqual(response.totalBillableCharacters, 59)
220+
XCTAssertEqual(response.totalTokens, 58)
221+
XCTAssertEqual(response.totalBillableCharacters, 160)
222222
}
223223

224224
func testCountTokens_appCheckNotConfigured_shouldFail() async throws {

0 commit comments

Comments
 (0)