fix(ailogic): xcode 27 renaming deprecation#16297
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 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.
| ) | ||
| #else | ||
| return FoundationModels.GenerationOptions( | ||
| sampling: sampling?.samplingMode, |
There was a problem hiding this comment.
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,
|
Could we match the formatting in |
My bad, didn't realize it was already fixed in there. Will the merge to |
@ncooke3 Np. Let's discuss offline. I'm not a fan of long-lived feature branches but we can't really merge to Some options are an |
Param name for sampling is slightly different. Old:
samplingNew:samplingModehttps://github.com/firebase/firebase-ios-sdk/pull/16297/changes?w=1
#no-changelog