-
Notifications
You must be signed in to change notification settings - Fork 1.5k
[FirebaseAI ] Integrate conversationkit #1745
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
base: peterfriese/firebase-ai-quickstart-refresh
Are you sure you want to change the base?
[FirebaseAI ] Integrate conversationkit #1745
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.
Summary of Changes
Hello @YoungHypo, 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!
I've completed a significant refactoring of the chat and UI components within the Firebase AI example application. The primary goal was to streamline UI component management by moving away from a Swift Package Manager dependency and integrating the components directly. This change also facilitated the integration of a new, more robust ConversationView
for the chat interface. Additionally, I've updated the function calling example to showcase weather prediction, providing a fresh and relevant demonstration of this capability.
Highlights
- UI Component Management Refactor: I've removed the
GenerativeAIUIComponents
Swift Package Manager dependency and integrated its source files directly into a newUIComponents
folder. This provides more direct control and simplifies the project structure. - New Chat UI Integration: I've integrated the
ConversationView
component, adapted from ConversationKit, into the main chat UI. This new component streamlines the chat interface and improves the user experience. - File Renaming for Clarity: To avoid naming conflicts with the new
ConversationView
, I've renamed the existingConversationScreen.swift
toChatScreen.swift
. - Function Calling Example Update: The function calling example has been updated to demonstrate weather prediction logic, replacing the previous currency conversion example. This includes a new
WeatherService
and corresponding ViewModel changes.
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 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 or fill out our survey 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.
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
This pull request successfully integrates ConversationKit
by replacing the previous UI components with a more robust and unified ConversationView
. The refactoring of the function calling example to a weather service use case is also a great improvement. The overall changes enhance modularity and simplify the UI code.
I've identified a critical issue that could lead to an app crash, along with a couple of high-severity logic bugs in the function call handling. Additionally, there are several medium-severity items related to project configuration, typos, and code clarity that should be addressed. Please review the detailed comments for suggestions.
firebaseai/FunctionCallingExample/ViewModels/FunctionCallingViewModel.swift
Outdated
Show resolved
Hide resolved
@@ -478,7 +486,7 @@ | |||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; | |||
GCC_WARN_UNUSED_FUNCTION = YES; | |||
GCC_WARN_UNUSED_VARIABLE = YES; | |||
IPHONEOS_DEPLOYMENT_TARGET = 16.0; | |||
IPHONEOS_DEPLOYMENT_TARGET = 17.0; |
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.
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.
Upgrade required due to conversationkit
firebaseai/FunctionCallingExample/ViewModels/FunctionCallingViewModel.swift
Outdated
Show resolved
Hide resolved
@@ -0,0 +1,27 @@ | |||
// Copyright 2025 Google LLC |
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.
@Binding var userPrompt: String | ||
|
||
var body: some View { | ||
if #available(iOS 26.0, *) { |
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.
The availability check if #available(iOS 26.0, *)
is confusing. iOS 26 does not exist, and this condition will currently never be true. It seems this block is intended for visionOS, as it uses visionOS-specific modifiers like .glassEffect
. It would be clearer to use conditional compilation, like #if os(visionOS)
, to target visionOS explicitly.
…nkit Use ConversationKit v0.0.2
Thanks @peterfriese for the new error view logic. I followed the same way for the error view in imagen example. ![]() ![]() |
/gemini review |
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
This pull request is a significant and well-executed refactoring that integrates ConversationKit
into the application. The replacement of custom UI components with ConversationView
brings a more consistent and robust user experience to the chat features. I appreciate the improved error handling and the update to the function calling example, which now demonstrates a more practical use case with the weather service. The codebase is cleaner and more maintainable as a result of these changes. I have a couple of minor suggestions: one regarding a typo and another about the change in the iOS deployment target, which is a significant modification that should be highlighted.
@@ -478,7 +481,7 @@ | |||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; | |||
GCC_WARN_UNUSED_FUNCTION = YES; | |||
GCC_WARN_UNUSED_VARIABLE = YES; | |||
IPHONEOS_DEPLOYMENT_TARGET = 16.0; | |||
IPHONEOS_DEPLOYMENT_TARGET = 17.0; |
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.
The iOS deployment target has been increased from 16.0 to 17.0. This is a significant change that may prevent users on older iOS versions from running the example app. If this change is intentional and required by a new dependency like ConversationKit
, it would be good to mention this in the pull request description.
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.
/gemini add a hint to the README file
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.
I understand you'd like a hint added to the README.md
file. As an AI, I am unable to directly modify files or perform tasks like adding content to the README.md
. However, I can provide a suggestion for the text you could add:
**Note on iOS Deployment Target:**
This example now requires iOS 17.0 or later due to the integration of the `ConversationKit` dependency. Users on older iOS versions will not be able to run this example.
This text would inform users about the increased deployment target and the reason behind it.
firebaseai/FunctionCallingExample/ViewModels/FunctionCallingViewModel.swift
Outdated
Show resolved
Hide resolved
firebaseai/FunctionCallingExample/ViewModels/FunctionCallingViewModel.swift
Outdated
Show resolved
Hide resolved
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
GenerativeAIUIComponents
, and replaced it with aUIComponents
folder for direct management. Related issue [FirebaseAI] Convert GenerativeAIUIComponents from Package to Folder Structure #1739ConversationView
component to the primary chat UI., copy from ConversationKit (https://github.com/peterfriese/ConversationKit).chatExample/Screen/ConversationScreen.swift
toChatScreen.swift
to differ it from the new ConversationView.quickstart-android
.