Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Vertex AI] Fix testCountTokens_jsonSchema integration test #14049

Merged
merged 2 commits into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions FirebaseVertexAI/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Unreleased
- [changed] The token counts from `GenerativeModel.countTokens(...)` now include
tokens from the schema for JSON output and function calling; reported token
counts will now be higher if using these features.

# 11.5.0
- [fixed] Fixed an issue where `VertexAI.vertexAI(app: app1)` and
`VertexAI.vertexAI(app: app2)` would return the same instance if their
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,8 @@ final class IntegrationTests: XCTestCase {

let response = try await model.countTokens(prompt)

XCTAssertEqual(response.totalTokens, 34)
XCTAssertEqual(response.totalBillableCharacters, 59)
XCTAssertEqual(response.totalTokens, 58)
XCTAssertEqual(response.totalBillableCharacters, 160)
}

func testCountTokens_appCheckNotConfigured_shouldFail() async throws {
Expand Down
Loading