Skip to content

[AI] Add wrapper for FoundationModels.GenerationOptions#16103

Merged
andrewheard merged 5 commits intomainfrom
ah/ai-generation-options
Apr 21, 2026
Merged

[AI] Add wrapper for FoundationModels.GenerationOptions#16103
andrewheard merged 5 commits intomainfrom
ah/ai-generation-options

Conversation

@andrewheard
Copy link
Copy Markdown
Contributor

Added a thin wrapper class FirebaseAI.GenerationOptions to facilitate usage of FoundationModels.GenerationOptions on iOS 15+, macOS 10.15+, tvOS 15+, watchOS 8+ and visionOS 1+ in #16043. The wrapped FoundationModels.GenerationOptions is only available on iOS/macOS/visionOS 26+.

#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

Customization

To customize 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 counter productive. 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.

@danger-firebase-ios
Copy link
Copy Markdown

1 Warning
⚠️ New public headers were added, did you remember to add them to the umbrella header?

Generated by 🚫 Danger

Copy link
Copy Markdown
Contributor

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

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 GenerationOptions and SamplingMode types as thin wrappers for FoundationModels to control model response generation, along with corresponding unit tests. Feedback focuses on ensuring consistent platform support by adding visionOS 26.0 to several @available attributes, matching the availability of the underlying FoundationModels types.

Comment thread FirebaseAI/Sources/Types/Public/GenerationOptions.swift
Comment thread FirebaseAI/Sources/Types/Public/GenerationOptions.swift
Comment thread FirebaseAI/Sources/Types/Public/GenerationOptions.swift
Comment thread FirebaseAI/Sources/Types/Public/GenerationOptions.swift
Comment thread FirebaseAI/Sources/Types/Public/GenerationOptions.swift
Comment thread FirebaseAI/Sources/Types/Public/GenerationOptions.swift
@andrewheard andrewheard marked this pull request as ready for review April 20, 2026 20:31
@andrewheard andrewheard requested a review from a team as a code owner April 20, 2026 20:31
@andrewheard andrewheard requested a review from paulb777 April 20, 2026 20:31
@paulb777
Copy link
Copy Markdown
Member

Please clear CI issues.

@andrewheard andrewheard merged commit dbe3b1b into main Apr 21, 2026
175 of 179 checks passed
@andrewheard andrewheard deleted the ah/ai-generation-options branch April 21, 2026 14:42
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