flutter_gemini 0.0.1-dev-1 flutter_gemini: ^0.0.1-dev-1 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.
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());
}
Now you can create an instance
final gemini = Gemini.instance;
Content-based APIs #
Text-only input #
This feature lets you perform natural language processing (NLP) tasks such as text completion and summarization.
gemini.textInput("Write a story about a magic backpack.")
.then((value) => print(value?.content?.parts?.last.text))
.catchError((e) => print(e));
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.
// In progress
Gemini Response #
// In progress
Gemini Methods #
// In progress