Skip to content

Latest commit

 

History

History

firebase_ai

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

This is a sample Flutter application demonstrating how to use the genkit_firebase_ai plugin.

Prerequisites

Setup

  1. Install Dependencies

    flutter pub get
  2. Configure Firebase This project requires firebase_options.dart which is git-ignored. Generate it using flutterfire:

    flutterfire configure

    Select your project and platforms (iOS, Android, macOS, Web).

  3. Register an App Check debug token Firebase AI Logic enforces App Check, and the app uses the App Check debug providers. Run the app once, copy the debug token it logs (the browser console on web), and add it in the Firebase console under App Check > Apps > Manage debug tokens.

  4. Run the App with Observability (Telemetry) To see Genkit traces and telemetry during development:

    First, start the Genkit Developer UI:

    genkit start

    Look for the output line: Telemetry API running on http://localhost:4033. (Usually it's port 4033, but it can be different).

    Then, in another terminal, run your Flutter app and pass the telemetry server address:

    flutter run --dart-define=GENKIT_ENV=dev --dart-define=GENKIT_TELEMETRY_SERVER=http://localhost:4033

    (Adjust the port if Genkit assigned a different one)

    Open http://localhost:4000 in your browser to see the Genkit Developer UI.

    Standard Flutter run (No Telemetry)

    flutter run

Features

  • Chat with Gemini using Firebase AI.
  • Tool calling demonstration (e.g., getWeather).