[AI] Rename vertexAI to agentPlatform#16372
Conversation
Using Gemini Code AssistThe 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
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 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. |
|
/gemini review |
There was a problem hiding this comment.
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.
|
/gemini review |
There was a problem hiding this comment.
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.
|
/gemin review |
andrewheard
left a comment
There was a problem hiding this comment.
LGTM. Feel free to ignore the CHANGELOG suggestion.
Co-authored-by: Andrew Heard <andrewheard@google.com>
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
vertexAIwithagentPlatform(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 inBackendTests.swift) by mapping them to the new.agentPlatformservice 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:Backend.vertexAI()(without arguments), directing developers toBackend.agentPlatform()and informing them of the default location change to"global".Backend.vertexAI(location:), adding the@available(*, deprecated, renamed: "agentPlatform(location:)")compiler attribute for Xcode automatic Fix-It refactoring.public static func agentPlatform(location: String = "global") -> Backend.CHANGELOG.md:Backend.vertexAIin favor ofBackend.agentPlatform.Internal Service & Error Renaming (
vertexAI->agentPlatform)APIConfig.swift:APIConfig.Service.vertexAItoService.agentPlatform.Endpoint.vertexAIStagingBypassProxytoEndpoint.agentPlatformStagingBypassProxy.FirebaseAI.swift:vertexAIModelResourceNametoagentPlatformModelResourceName..agentPlatformand.agentPlatformStagingBypassProxy.GenerativeModel.swift:.googleAI(endpoint: .agentPlatformStagingBypassProxy).AILog.swift&GenerativeAIService.swift:vertexAIInFirebaseAPIDisabledtoagentPlatformInFirebaseAPIDisabled.TemplateGenerateContentRequest.swift,TemplateImagenGenerationRequest.swift,LiveSessionService.swift, andCountTokensRequest.swiftto match on.agentPlatform.Test Suites & Snippets
InstanceConfig.swift:vertexAI_v1beta...toagentPlatform_v1beta...and updatedserviceNamedisplay values to"Agent Platform".VertexComponentTests.swift:testModelResourceName_agentPlatform,testGenerativeModel_deprecatedVertexAI_defaultLocation,testGenerativeModel_deprecatedVertexAI_customLocation) and updated matching logic.testGenerateContentStream_failure_vertexAIInFirebaseAPINotEnabled()totestGenerateContentStream_failure_agentPlatformInFirebaseAPINotEnabled()inGenerativeModelVertexAITests.swift.testGenerateContent_success_mapsGrounding_vertexAI()totestGenerateContent_success_mapsGrounding_agentPlatform()inTemplateGenerativeModelTests.swift.testDecodeCitationMetadata_vertexAIFormat()totestDecodeCitationMetadata_agentPlatformFormat()inCitationMetadataTests.swift.testEncodeCountTokensRequest_vertexAI_minimal()totestEncodeCountTokensRequest_agentPlatform_minimal()inCountTokensRequestTests.swift.agentPlatformconfigurations instead ofvertexAI.Verification Plan
Automated Tests
APITests.swift.BackendTests.swift.