flutter_gemini 0.0.1-dev-2 copy "flutter_gemini: ^0.0.1-dev-2" to clipboard
flutter_gemini: ^0.0.1-dev-2 copied to clipboard

Flutter Google Gemini SDK. Google Gemini is a set of cutting-edge large language models (LLMs) designed to be the driving force behind Google's future AI initiatives.

Flutter Google Gemini #

Google Gemini is a set of cutting-edge large language models (LLMs) designed to be the driving force behind Google's future AI initiatives.

gemini_github_cover

This package provides a powerful bridge between your Flutter application and Google's revolutionary Gemini AI. It empowers you to seamlessly integrate Gemini's capabilities into your app, unlocking possibilities for building innovative, intelligent, and engaging experiences that redefine user interaction.

Features #

Getting started #

To use the Gemini API, you'll need an API key. If you don't already have one, create a key in Google AI Studio. Get an API key.

Initialize Gemini #

To initialize Gemini you must add an init factory in the main function.

void main() {

  /// Add this line
  Gemini.init(apiKey: '--- Your Gemini Api Key ---');

  runApp(const MyApp());
}
copied to clipboard

Now you can create an instance

final gemini = Gemini.instance;
copied to clipboard

Content-based APIs #

Text-only input #

This feature lets you perform natural language processing (NLP) tasks such as text completion and summarization.

  gemini.text("Write a story about a magic backpack.")
    .then((value) => print(value?.content?.parts?.last.text))
    .catchError((e) => print(e));
copied to clipboard

Text-and-image input #

If the input contains both text and image, You can send a text prompt with an image to the gemini-pro-vision model to perform a vision-related task. For example, captioning an image or identifying what's in an image.

    final file = File('assets/img.png');
    gemini
        .textAndImageInput(
          text: "What is this picture?",
          image: file.readAsBytesSync(),
        )
        .then((value) => log(value?.content?.parts?.last.text ?? ''))
        .catchError((e) => log('textAndImageInput exception', error: e));
copied to clipboard

Gemini Response #

// In progress
copied to clipboard

Gemini Methods #

// In progress
copied to clipboard
390
likes
0
points
5.07k
downloads

Publisher

verified publisherbabakcode.com

Weekly Downloads

2024.09.27 - 2025.04.11

Flutter Google Gemini SDK. Google Gemini is a set of cutting-edge large language models (LLMs) designed to be the driving force behind Google's future AI initiatives.

Repository (GitHub)
View/report issues

Topics

#gemini #ai #google-gemini #flutter-gemini

License

unknown (license)

Dependencies

dio, flutter, freezed_annotation, json_annotation

More

Packages that depend on flutter_gemini