From b566edce2fb6fed6c83da8bbe037c18f1c90d33b Mon Sep 17 00:00:00 2001 From: Andrew Heard Date: Wed, 30 Apr 2025 11:29:19 -0400 Subject: [PATCH 1/3] Stop checking exact token counts in `testCountTokens_functionCalling` --- .../Tests/TestApp/Tests/Integration/IntegrationTests.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/FirebaseAI/Tests/TestApp/Tests/Integration/IntegrationTests.swift b/FirebaseAI/Tests/TestApp/Tests/Integration/IntegrationTests.swift index 9b62326dfd6..e61b5ed3470 100644 --- a/FirebaseAI/Tests/TestApp/Tests/Integration/IntegrationTests.swift +++ b/FirebaseAI/Tests/TestApp/Tests/Integration/IntegrationTests.swift @@ -190,12 +190,12 @@ final class IntegrationTests: XCTestCase { ModelContent(role: "function", parts: sumResponse), ]) - XCTAssertEqual(response.totalTokens, 24) + XCTAssertGreaterThan(response.totalTokens, 0) XCTAssertEqual(response.totalBillableCharacters, 71) XCTAssertEqual(response.promptTokensDetails.count, 1) let promptTokensDetails = try XCTUnwrap(response.promptTokensDetails.first) XCTAssertEqual(promptTokensDetails.modality, .text) - XCTAssertEqual(promptTokensDetails.tokenCount, 24) + XCTAssertEqual(promptTokensDetails.tokenCount, response.totalTokens) } func testCountTokens_appCheckNotConfigured_shouldFail() async throws { From b99d6ec20e897a5e49968bc13d3dbde17749ce8f Mon Sep 17 00:00:00 2001 From: Andrew Heard Date: Wed, 30 Apr 2025 11:32:03 -0400 Subject: [PATCH 2/3] Re-enable `developerV1Beta` configs --- .../Integration/GenerateContentIntegrationTests.swift | 5 ++--- .../Tests/TestApp/Tests/Utilities/InstanceConfig.swift | 10 ++++------ 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/FirebaseAI/Tests/TestApp/Tests/Integration/GenerateContentIntegrationTests.swift b/FirebaseAI/Tests/TestApp/Tests/Integration/GenerateContentIntegrationTests.swift index 885a6d980dd..2c711b5a7eb 100644 --- a/FirebaseAI/Tests/TestApp/Tests/Integration/GenerateContentIntegrationTests.swift +++ b/FirebaseAI/Tests/TestApp/Tests/Integration/GenerateContentIntegrationTests.swift @@ -116,9 +116,8 @@ struct GenerateContentIntegrationTests { @Test(arguments: [ InstanceConfig.vertexV1Beta, - // TODO(andrewheard): Configs temporarily disabled due to backend issue. - // InstanceConfig.developerV1Beta, - // InstanceConfig.developerV1BetaStaging + InstanceConfig.developerV1Beta, + InstanceConfig.developerV1BetaStaging, InstanceConfig.developerV1BetaSpark, ]) func generateImage(_ config: InstanceConfig) async throws { diff --git a/FirebaseAI/Tests/TestApp/Tests/Utilities/InstanceConfig.swift b/FirebaseAI/Tests/TestApp/Tests/Utilities/InstanceConfig.swift index a0f2279dbcb..86d024c7a87 100644 --- a/FirebaseAI/Tests/TestApp/Tests/Utilities/InstanceConfig.swift +++ b/FirebaseAI/Tests/TestApp/Tests/Utilities/InstanceConfig.swift @@ -51,9 +51,8 @@ struct InstanceConfig { vertexV1Staging, vertexV1Beta, vertexV1BetaStaging, - // TODO(andrewheard): Configs temporarily disabled due to backend issue: - // developerV1Beta, - // developerV1BetaStaging, + developerV1Beta, + developerV1BetaStaging, developerV1Spark, developerV1BetaSpark, ] @@ -63,9 +62,8 @@ struct InstanceConfig { vertexV1Staging, vertexV1Beta, vertexV1BetaStaging, - // TODO(andrewheard): Configs temporarily disabled due to backend issue: - // developerV1Beta, - // developerV1BetaStaging, + developerV1Beta, + developerV1BetaStaging, developerV1BetaSpark, ] From c736cbfed3a7e32b810572e86cc6c538ddbd3bba Mon Sep 17 00:00:00 2001 From: Andrew Heard Date: Wed, 30 Apr 2025 11:32:56 -0400 Subject: [PATCH 3/3] Disable Vertex AI configs in `generateImage` due to `SafetyRatings` bug --- .../Tests/Integration/GenerateContentIntegrationTests.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/FirebaseAI/Tests/TestApp/Tests/Integration/GenerateContentIntegrationTests.swift b/FirebaseAI/Tests/TestApp/Tests/Integration/GenerateContentIntegrationTests.swift index 2c711b5a7eb..d8bc9395d02 100644 --- a/FirebaseAI/Tests/TestApp/Tests/Integration/GenerateContentIntegrationTests.swift +++ b/FirebaseAI/Tests/TestApp/Tests/Integration/GenerateContentIntegrationTests.swift @@ -115,7 +115,9 @@ struct GenerateContentIntegrationTests { } @Test(arguments: [ - InstanceConfig.vertexV1Beta, + // TODO(andrewheard): Vertex AI configs temporarily disabled to due empty SafetyRatings bug. + // InstanceConfig.vertexV1, + // InstanceConfig.vertexV1Beta, InstanceConfig.developerV1Beta, InstanceConfig.developerV1BetaStaging, InstanceConfig.developerV1BetaSpark,