Skip to content

simonwell-flutter/flutter_generative_ai_example

 
 

Repository files navigation

Generative AI Example

Chinese Version

A Flutter project demonstrating the integration of Google Generative AI.

Table of Contents

Introduction

This project showcases how to use Google Generative AI within a Flutter application. It includes examples of generating text responses and streaming responses based on user input.

Features

  • Generate text responses using Google Generative AI.
  • Stream text responses in real-time.
  • Simple and intuitive UI.

Installation

To get started with this project, follow these steps:

  1. Clone the repository:

    git clone https://github.com/your-username/generative_ai_example.git
    cd generative_ai_example
  2. Install dependencies:

    flutter pub get
  3. Run the app:

    flutter run --dart-define=AI_API_KEY=your_api_key_here

Usage

  1. Enter a prompt: Type a prompt into the text field.
  2. Get Response: Click on the "Get Response" button to receive a text response.
  3. Get Stream Response: Click on the "Get Stream Response" button to receive a streaming response.

Screenshots

Screenshot 1 Screenshot 2

Contributing

Contributions are welcome! Please fork the repository and submit a pull request.

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature-branch).
  3. Commit your changes (git commit -m 'Add some feature').
  4. Push to the branch (git push origin feature-branch).
  5. Open a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Using Generative AI in Dart for Flutter application

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 44.4%
  • CMake 36.5%
  • Dart 10.5%
  • Swift 3.2%
  • C 2.7%
  • HTML 2.3%
  • Other 0.4%