Skip to content

[AI] Rename vertexAI to agentPlatform#16372

Draft
paulb777 wants to merge 12 commits into
mainfrom
pb-agent-platform
Draft

[AI] Rename vertexAI to agentPlatform#16372
paulb777 wants to merge 12 commits into
mainfrom
pb-agent-platform

Conversation

@paulb777

@paulb777 paulb777 commented Jul 8, 2026

Copy link
Copy Markdown
Member

Description

This PR deprecates the Vertex AI backend configuration (Backend.vertexAI) in favor of the Gemini Enterprise Agent Platform (Backend.agentPlatform). In addition to renaming the public builders, this PR updates the internal representation and shifts the default location from "us-central1" to "global".

The internal code is systematically renamed to fully replace all non-public occurrences of the string vertexAI with agentPlatform (including staging endpoints, logging message codes, error configurations, and unit tests).

Backward compatibility is preserved: the deprecated public Backend.vertexAI() methods are kept functional (and verified in BackendTests.swift) by mapping them to the new .agentPlatform service case under the hood.

Note: A few tweaks to the pod_lib_tests are done to bypass warnings so we can continue to test the deprecated API.


Changes

Public API & Documentation

  • Backend.swift:
    • Deprecated Backend.vertexAI() (without arguments), directing developers to Backend.agentPlatform() and informing them of the default location change to "global".
    • Deprecated Backend.vertexAI(location:), adding the @available(*, deprecated, renamed: "agentPlatform(location:)") compiler attribute for Xcode automatic Fix-It refactoring.
    • Added the new recommended builder: public static func agentPlatform(location: String = "global") -> Backend.
  • CHANGELOG.md:
    • Added a change entry detailing the deprecation of Backend.vertexAI in favor of Backend.agentPlatform.

Internal Service & Error Renaming (vertexAI -> agentPlatform)

  • APIConfig.swift:
    • Renamed the internal enum case APIConfig.Service.vertexAI to Service.agentPlatform.
    • Renamed the debug staging bypass case Endpoint.vertexAIStagingBypassProxy to Endpoint.agentPlatformStagingBypassProxy.
  • FirebaseAI.swift:
    • Renamed internal helper function vertexAIModelResourceName to agentPlatformModelResourceName.
    • Updated pattern match switches to handle .agentPlatform and .agentPlatformStagingBypassProxy.
  • GenerativeModel.swift:
    • Updated the debug staging bypass proxy case to .googleAI(endpoint: .agentPlatformStagingBypassProxy).
  • AILog.swift & GenerativeAIService.swift:
    • Renamed the logging error code case vertexAIInFirebaseAPIDisabled to agentPlatformInFirebaseAPIDisabled.
  • Request & Connection Modules:
    • Updated URL/path compilation matching in TemplateGenerateContentRequest.swift, TemplateImagenGenerationRequest.swift, LiveSessionService.swift, and CountTokensRequest.swift to match on .agentPlatform.

Test Suites & Snippets

  • InstanceConfig.swift:
    • Renamed all configuration constants from vertexAI_v1beta... to agentPlatform_v1beta... and updated serviceName display values to "Agent Platform".
  • VertexComponentTests.swift:
    • Renamed test cases (testModelResourceName_agentPlatform, testGenerativeModel_deprecatedVertexAI_defaultLocation, testGenerativeModel_deprecatedVertexAI_customLocation) and updated matching logic.
  • Test Case Names:
    • Renamed testGenerateContentStream_failure_vertexAIInFirebaseAPINotEnabled() to testGenerateContentStream_failure_agentPlatformInFirebaseAPINotEnabled() in GenerativeModelVertexAITests.swift.
    • Renamed testGenerateContent_success_mapsGrounding_vertexAI() to testGenerateContent_success_mapsGrounding_agentPlatform() in TemplateGenerativeModelTests.swift.
    • Renamed testDecodeCitationMetadata_vertexAIFormat() to testDecodeCitationMetadata_agentPlatformFormat() in CitationMetadataTests.swift.
    • Renamed testEncodeCountTokensRequest_vertexAI_minimal() to testEncodeCountTokensRequest_agentPlatform_minimal() in CountTokensRequestTests.swift.
    • Updated all integration tests and snippets to use agentPlatform configurations instead of vertexAI.

Verification Plan

Automated Tests

  • Verified compilation checks for the deprecated API endpoints remain intact in APITests.swift.
  • Verified functional mapping of deprecated methods continues to work in BackendTests.swift.

@gemini-code-assist

Copy link
Copy Markdown
Contributor
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

@paulb777

paulb777 commented Jul 9, 2026

Copy link
Copy Markdown
Member Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request deprecates Backend.vertexAI in favor of Backend.agentPlatform (with the default location changing from "us-central1" to "global") and renames references to Vertex AI to Gemini Enterprise Agent Platform across the codebase. The review feedback highlights several unit tests that were incorrectly updated to use the new .agentPlatform backend, which removes test coverage for the deprecated .vertexAI methods they were originally designed to verify.

Comment thread FirebaseAI/Tests/Unit/VertexComponentTests.swift Outdated
Comment thread FirebaseAI/Tests/Unit/VertexComponentTests.swift Outdated
Comment thread FirebaseAI/Tests/Unit/VertexComponentTests.swift
Comment thread FirebaseAI/Tests/Unit/VertexComponentTests.swift Outdated
Comment thread FirebaseAI/Tests/Unit/VertexComponentTests.swift Outdated
@paulb777

paulb777 commented Jul 9, 2026

Copy link
Copy Markdown
Member Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request renames Vertex AI to Gemini Enterprise Agent Platform (using agentPlatform internally) across the codebase, deprecating the old Backend.vertexAI methods in favor of Backend.agentPlatform with a new default location of "global". The review feedback primarily advises against excluding unit test files from the CocoaPods podspec to bypass deprecation warnings. Instead, the reviewer recommends keeping the tests active by marking the deprecated test cases with @available(*, deprecated) and ensuring that backward compatibility for the deprecated vertexAI method is still actively tested.

Comment thread FirebaseAILogic.podspec
Comment thread FirebaseAI/Tests/Unit/VertexComponentTests.swift Outdated
Comment thread FirebaseAI/Tests/Unit/VertexComponentTests.swift
Comment thread FirebaseAI/Tests/Unit/Types/BackendTests.swift
Comment thread FirebaseAI/Tests/Unit/Types/BackendTests.swift
Comment thread FirebaseAI/Tests/Unit/APITests.swift
@paulb777 paulb777 requested a review from andrewheard July 9, 2026 15:56
@paulb777

paulb777 commented Jul 9, 2026

Copy link
Copy Markdown
Member Author

/gemin review

@andrewheard andrewheard left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Feel free to ignore the CHANGELOG suggestion.

Comment thread FirebaseAI/CHANGELOG.md Outdated
Co-authored-by: Andrew Heard <andrewheard@google.com>
@paulb777 paulb777 added this to the 12.17.0 - M184 milestone Jul 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants