Skip to content

Update FirebaseAI quickstart to use agentPlatform - #1866

Merged
paulb777 merged 3 commits into
mainfrom
update-firebaseai-agent-platform
Aug 4, 2026
Merged

Update FirebaseAI quickstart to use agentPlatform#1866
paulb777 merged 3 commits into
mainfrom
update-firebaseai-agent-platform

Conversation

@paulb777

@paulb777 paulb777 commented Aug 4, 2026

Copy link
Copy Markdown
Member

Updates vertexAI to agentPlatform after its introduction in Firebase Apple SDK 12.17.0.

@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 migrates the backend option from "Firebase Vertex AI" (.vertexAI) to "Agent Platform Gemini API" (.agentPlatform) across multiple view models in the Firebase AI example application. The review feedback identifies a potential issue in MultimodalViewModel.swift where an empty but non-nil fileDataParts array evaluates to true, causing local attachments to be ignored. It is recommended to add a !fileDataParts.isEmpty check to ensure the application correctly falls back to processing local attachments when no Cloud Storage parts are present.

@paulb777

paulb777 commented Aug 4, 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 migrates the backend option from Vertex AI to the Agent Platform Gemini API across multiple view models. In MultimodalViewModel.swift, the logic is updated to check for .agentPlatform and verify that fileDataParts is not empty. The review feedback points out an issue in MultimodalViewModel.swift where local attachments are silently ignored when fileDataParts is not empty under the .agentPlatform backend, and provides a code suggestion to correctly process and append local attachments.

@paulb777
paulb777 requested a review from andrewheard August 4, 2026 20:42
@paulb777
paulb777 merged commit db9d655 into main Aug 4, 2026
18 checks passed
@paulb777
paulb777 deleted the update-firebaseai-agent-platform branch August 4, 2026 22:08
let firebaseService = backendType == .googleAI
? FirebaseAI.firebaseAI(backend: .googleAI())
: FirebaseAI.firebaseAI(backend: .vertexAI(location: "global"))
: FirebaseAI.firebaseAI(backend: .agentPlatform(location: "global"))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

We don't need the location setting anymore for the Agent Platform syntax (especially if it's just setting to global)... wanna remove it?

Note that we DO need to keep the location setting for the Live models. It must be explicitly set to us-central1.

@@ -16,7 +16,7 @@ import Foundation

enum BackendOption: String, CaseIterable, Identifiable {
case googleAI = "Google AI"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

out of scope for this PR, but noting it so that it can be updated

Should this be:

case googleAI = "Gemini Developer API"

@paulb777

paulb777 commented Aug 4, 2026

Copy link
Copy Markdown
Member Author

Feedback addressed in #1867

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants