Skip to content

fix(ailogic): xcode 27 renaming deprecation#16297

Open
ncooke3 wants to merge 2 commits into
mainfrom
nc.xcode27.ailogic.1
Open

fix(ailogic): xcode 27 renaming deprecation#16297
ncooke3 wants to merge 2 commits into
mainfrom
nc.xcode27.ailogic.1

Conversation

@ncooke3

@ncooke3 ncooke3 commented Jun 18, 2026

Copy link
Copy Markdown
Member

Param name for sampling is slightly different. Old: sampling New: samplingMode

- sampling:
+ samplingMode:
Screenshot 2026-06-18 at 4 55 40 PM

https://github.com/firebase/firebase-ios-sdk/pull/16297/changes?w=1

#no-changelog

@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.

@ncooke3 ncooke3 marked this pull request as ready for review June 18, 2026 20:57
@ncooke3 ncooke3 requested a review from a team as a code owner June 18, 2026 20:57
@ncooke3 ncooke3 requested a review from andrewheard June 18, 2026 20:57
Comment thread FirebaseAI/Sources/Types/Public/GenerationOptions.swift Outdated
@ncooke3

ncooke3 commented Jun 18, 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 introduces conditional compilation (#if compiler(>=6.4)) in GenerationOptions.swift to handle API differences in FoundationModels.GenerationOptions (specifically the transition from sampling to samplingMode). The review feedback suggests a cleaner, more idiomatic Swift approach by directly instantiating the options within each conditional branch instead of dynamically referencing the initializer via a local variable.

Comment thread FirebaseAI/Sources/Types/Public/GenerationOptions.swift Outdated
)
#else
return FoundationModels.GenerationOptions(
sampling: sampling?.samplingMode,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks the same?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Param name for sampling is slightly different. Old: sampling New: samplingMode

diff --git a/FirebaseAI/Sources/Types/Public/GenerationOptions.swift b/FirebaseAI/Sources/Types/Public/GenerationOptions.swift
index 99c62360ac3..2f7db8d16a3 100644
--- a/FirebaseAI/Sources/Types/Public/GenerationOptions.swift
+++ b/FirebaseAI/Sources/Types/Public/GenerationOptions.swift
@@ -171,11 +178,20 @@
             return generationOptions
           }
 
-          return FoundationModels.GenerationOptions(
-            sampling: sampling?.samplingMode,
+            return FoundationModels.GenerationOptions(
+              samplingMode: sampling?.samplingMode,
+            return FoundationModels.GenerationOptions(
+              sampling: sampling?.samplingMode,
 

@paulb777 paulb777 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I see it now. Thanks!

@andrewheard

Copy link
Copy Markdown
Contributor

Could we match the formatting in main...wwdc26-preview#diff-3232ba7f8f to avoid merge conflicts?

@ncooke3

ncooke3 commented Jun 19, 2026

Copy link
Copy Markdown
Member Author

Could we match the formatting in main...wwdc26-preview#diff-3232ba7f8f to avoid merge conflicts?

My bad, didn't realize it was already fixed in there. Will the merge to main be coming soon-ish? If so, I'll just close this PR.

@andrewheard

Copy link
Copy Markdown
Contributor

Could we match the formatting in main...wwdc26-preview#diff-3232ba7f8f to avoid merge conflicts?

My bad, didn't realize it was already fixed in there. Will the merge to main be coming soon-ish? If so, I'll just close this PR.

@ncooke3 Np. Let's discuss offline. I'm not a fan of long-lived feature branches but we can't really merge to main (without additional steps) until the Xcode 27 RC in September since the Foundation Models APIs could have breaking changes before then.

Some options are an XcodeBeta trait that we use for pre-release features or a define in SwiftSettings and we enable it in the wwdc26-preview branch. Although they are an option, I think environment variables are too painful to use with Xcode so I'd like to avoid them.

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.

3 participants