-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Migrates the VertexAI sample to the FirebaseAI sample #1689
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @paulb777, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
Summary of Changes
This pull request migrates the VertexAI sample to a FirebaseAI sample, updating naming conventions and switching the backend from vertexAI to googleAI. The original quickstart functionality is verified with the latest SDK, and the README is updated, with a TODO to add links to new documentation.
Highlights
- Migration: The sample is migrated from VertexAI to FirebaseAI, aligning with the new Firebase AI branding and SDK.
- Backend Switch: The backend is switched from vertexAI to googleAI, while retaining the vertexAI configuration as a commented-out option.
- Readme Update: The Readme file is updated to reflect the changes, with a note to include links to new documentation.
Changelog
Click here to see the changelog
- firebaseai/ChatSample/Assets.xcassets/AccentColor.colorset/Contents.json
- Added a new asset file for accent color.
- firebaseai/ChatSample/Assets.xcassets/AppIcon.appiconset/Contents.json
- Added a new asset file for the app icon.
- firebaseai/ChatSample/Assets.xcassets/Contents.json
- Added a new asset catalog content file.
- firebaseai/ChatSample/Models/ChatMessage.swift
- Created a new
ChatMessage
model to represent chat messages with properties likeid
,message
,participant
, andpending
status. - Added sample messages for testing and preview purposes.
- Created a new
- firebaseai/ChatSample/Preview Content/Preview Assets.xcassets/Contents.json
- Added a new asset catalog content file for preview assets.
- firebaseai/ChatSample/Screens/ConversationScreen.swift
- Created a
ConversationScreen
view for displaying the chat interface. - Implemented message display using
MessageView
and error handling withErrorView
. - Added input field and send/stop functionality.
- Implemented scrolling to the latest message or error view.
- Created a
- firebaseai/ChatSample/ViewModels/ConversationViewModel.swift
- Created a
ConversationViewModel
to manage chat messages and interact with the Generative AI model. - Implemented methods for sending messages, starting new chats, and stopping message generation.
- Added error handling and streaming support.
- Created a
- firebaseai/ChatSample/Views/BouncingDots.swift
- Created a
BouncingDots
view to indicate loading or pending status.
- Created a
- firebaseai/ChatSample/Views/ErrorDetailsView.swift
- Created an
ErrorDetailsView
to display detailed information about errors, including safety ratings and block reasons.
- Created an
- firebaseai/ChatSample/Views/ErrorView.swift
- Created an
ErrorView
to display error messages and provide access to error details.
- Created an
- firebaseai/ChatSample/Views/MessageView.swift
- Created a
MessageView
to display individual chat messages with Markdown support and styling based on the participant.
- Created a
- firebaseai/FirebaseAIExample.xcodeproj/project.pbxproj
- Updated project settings to include new files and frameworks.
- Modified build phases and configurations to support the new FirebaseAI sample.
- firebaseai/FirebaseAIExample.xcodeproj/xcshareddata/xcschemes/FirebaseAISample.xcscheme
- Added a shared scheme for the FirebaseAISample target.
- firebaseai/FirebaseAISample/Assets.xcassets/AccentColor.colorset/Contents.json
- Added accent color assets for the FirebaseAISample target.
- firebaseai/FirebaseAISample/Assets.xcassets/AppIcon.appiconset/Contents.json
- Added app icon assets for the FirebaseAISample target.
- firebaseai/FirebaseAISample/Assets.xcassets/Contents.json
- Added asset catalog contents for the FirebaseAISample target.
- firebaseai/FirebaseAISample/ContentView.swift
- Updated the main content view to include a navigation link to the new ChatSample.
- Added state objects for the view models.
- firebaseai/FirebaseAISample/FirebaseAISampleApp.swift
- Updated the main app file to configure Firebase and AppCheck.
- firebaseai/FirebaseAISample/Preview Content/Preview Assets.xcassets/Contents.json
- Added preview assets for the FirebaseAISample target.
- firebaseai/FunctionCallingSample/Screens/FunctionCallingScreen.swift
- Added function calling screen
- firebaseai/FunctionCallingSample/ViewModels/FunctionCallingViewModel.swift
- Added function calling view model
- firebaseai/GenerativeAIMultimodalSample/Assets.xcassets/AccentColor.colorset/Contents.json
- Added accent color assets for the GenerativeAIMultimodalSample target.
- firebaseai/GenerativeAIMultimodalSample/Assets.xcassets/AppIcon.appiconset/Contents.json
- Added app icon assets for the GenerativeAIMultimodalSample target.
- firebaseai/GenerativeAIMultimodalSample/Assets.xcassets/Contents.json
- Added asset catalog contents for the GenerativeAIMultimodalSample target.
- firebaseai/GenerativeAIMultimodalSample/Preview Content/Preview Assets.xcassets/Contents.json
- Added preview assets for the GenerativeAIMultimodalSample target.
- firebaseai/GenerativeAIMultimodalSample/Screens/PhotoReasoningScreen.swift
- Added photo reasoning screen
- firebaseai/GenerativeAIMultimodalSample/ViewModels/PhotoReasoningViewModel.swift
- Added photo reasoning view model
- firebaseai/GenerativeAITextSample/Assets.xcassets/AccentColor.colorset/Contents.json
- Added accent color assets for the GenerativeAITextSample target.
- firebaseai/GenerativeAITextSample/Assets.xcassets/AppIcon.appiconset/Contents.json
- Added app icon assets for the GenerativeAITextSample target.
- firebaseai/GenerativeAITextSample/Assets.xcassets/Contents.json
- Added asset catalog contents for the GenerativeAITextSample target.
- firebaseai/GenerativeAITextSample/Preview Content/Preview Assets.xcassets/Contents.json
- Added preview assets for the GenerativeAITextSample target.
- firebaseai/GenerativeAITextSample/Screens/SummarizeScreen.swift
- Added summarize screen
- firebaseai/GenerativeAITextSample/ViewModels/SummarizeViewModel.swift
- Added summarize view model
- firebaseai/GenerativeAIUIComponents/Package.swift
- Added package file
- firebaseai/GenerativeAIUIComponents/Sources/GenerativeAIUIComponents/InputField.swift
- Added input field file
- firebaseai/GenerativeAIUIComponents/Sources/GenerativeAIUIComponents/MultimodalInputField.swift
- Added multimodal input field file
- firebaseai/ImagenScreen/ImagenScreen.swift
- Added imagen screen file
- firebaseai/ImagenScreen/ImagenViewModel.swift
- Added imagen view model file
- firebaseai/README.md
- Updated the README file to reflect the migration and new features.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command>
or @gemini-code-assist <command>
. Below is a summary of the supported commands.
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 issue comments and review comments. |
Help | /gemini help |
Displays a list of available commands. |
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 is currently in preview and 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 to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
From Vertex's peak to Firebase's grace,
A new sample finds its place.
With Gemini's might,
It shines so bright,
A digital, AI embrace.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
The pull request migrates the VertexAI sample to the FirebaseAI sample, updating naming, switching backends, and updating the README. The changes look good overall, but there are a few areas that could be improved.
Summary of Findings
- TODO in README: The pull request description mentions a TODO item to update the README with links to new documentation. This should be addressed before merging.
- Backend Configuration: The code comments out the VertexAI backend configuration while enabling the googleAI backend. It would be beneficial to provide a more detailed explanation in the comments about why this change was made and how to switch back to the VertexAI backend if needed.
Merge Readiness
The pull request is almost ready for merging. The TODO item in the README should be addressed before merging. Additionally, consider adding more context to the code comments regarding the backend configuration change. I am unable to directly approve this pull request, and users should have others review and approve this code before merging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, Paul!
Co-authored-by: Andrew Heard <[email protected]>
See commits for step by step updates.
TODO: Update Readme with links to new documentation