Skip to content

Conversation

@paulb777
Copy link
Member

@paulb777 paulb777 commented Jan 2, 2026

Proof of concept of hybrid that successfully runs a hybrid end to end test

@gemini-code-assist
Copy link
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.

@paulb777 paulb777 marked this pull request as draft January 2, 2026 23:46
@paulb777
Copy link
Member Author

paulb777 commented Jan 2, 2026

/gemini review

Copy link
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 support for on-device generative AI models (Apple Foundation Models) by refactoring the APIConfig from a struct to an enum with .cloud and .onDevice cases. This change necessitated updates across the codebase to handle the new APIConfig structure, including FirebaseAI initialization, model resource name resolution, URL generation, and token counting logic, ensuring that on-device models are handled separately from cloud-based ones. New error codes for unsupported configurations were added, and integration tests were updated and expanded to cover both cloud and on-device scenarios, including a new HybridAIIntegrationTests file. A review comment highlighted the use of iOS 26.0 and macOS 26.0 in an availability check for on-device models, suggesting it's a placeholder for future OS versions and recommending a clarifying comment.

@paulb777
Copy link
Member Author

paulb777 commented Jan 2, 2026

/gemini review

Copy link
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 support for on-device generative AI models by refactoring the APIConfig from a struct into an enum with .cloud(CloudConfig) and .onDevice cases. This change allows the SDK to differentiate between cloud-based and on-device inference. The core GenerativeModel.generateContent method now includes logic for on-device execution using Apple's Foundation Models, with conditional compilation and OS version checks. Various API request methods (getURL, encode, createWebsocket) and internal functions (modelResourceName, developerModelResourceName) have been updated to handle the new APIConfig enum, explicitly throwing unsupportedConfig errors for operations not supported by on-device models (e.g., URL generation, templates, Imagen, Live API, token counting encoding). A new unsupportedConfig error code was added to AILog.swift. Integration tests were updated to reflect the APIConfig change and a new HybridAIIntegrationTests file was added to test both cloud and on-device model inference. Review comments suggested improving the countTokens implementation for on-device models to explicitly throw an 'unsupported' error instead of attempting a network request, using map instead of compactMap for a non-optional string transformation, and adding an AILog.error call before throwing an NSError for consistency.

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.

1 participant