Skip to content

[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

Open
wants to merge 17 commits into
base: peterfriese/firebase-ai-quickstart-refresh
Choose a base branch
from

Conversation

YoungHypo
Copy link
Contributor

UIComponents
├── Models
│   ├── Sample.swift
│   └── UseCase.swift
└── Views
    ├── ConversationView.swift
    ├── InputField.swift
    ├── MessageComposerVIew.swift
    └── MultimodalInputField.swift
  • Introduced and integrated a new ConversationView component to the primary chat UI., copy from ConversationKit (https://github.com/peterfriese/ConversationKit).
  • Renamed the original chatExample/Screen/ConversationScreen.swift to ChatScreen.swift to differ it from the new ConversationView.
  • Refactored the function calling example to use the weather prediction logic as in quickstart-android.
simulator_screenshot_552EBA86-CE86-4B8B-B1FF-EBF0A59B1007 simulator_screenshot_56114694-E983-48A4-AD78-860B160B1BBE simulator_screenshot_3511E03C-FED7-4131-86B3-68A7E4588AC0

@YoungHypo YoungHypo changed the title [FirebaseAI ]Integrate conversationkit [FirebaseAI ] Integrate conversationkit Aug 7, 2025
Copy link

@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.

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 new UIComponents 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 existing ConversationScreen.swift to ChatScreen.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

  1. 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.

Copy link

@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 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.

@@ -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;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The IPHONEOS_DEPLOYMENT_TARGET has been increased from 16.0 to 17.0. This is a significant change as it drops support for iOS 16. Please confirm if this was intentional and consider mentioning it in the pull request description as it's a breaking change for users on older OS versions.

Copy link
Contributor Author

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

@@ -0,0 +1,27 @@
// Copyright 2025 Google LLC

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The copyright year is set to 2025, which is in the future. This is likely a typo and should be corrected to the current year.

Suggested change
// Copyright 2025 Google LLC
// Copyright 2024 Google LLC

@Binding var userPrompt: String

var body: some View {
if #available(iOS 26.0, *) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

@YoungHypo
Copy link
Contributor Author

YoungHypo commented Aug 14, 2025

Thanks @peterfriese for the new error view logic. I followed the same way for the error view in imagen example.

Simulator Screenshot - iPhone 16 Pro - 2025-08-14 at 00 52 17 Simulator Screenshot - iPhone 16 Pro - 2025-08-14 at 00 52 22

@peterfriese peterfriese self-requested a review August 14, 2025 14:23
@peterfriese
Copy link
Contributor

/gemini review

Copy link

@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 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;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

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.

Copy link
Contributor

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

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.

peterfriese and others added 5 commits August 14, 2025 16:28
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants