yaviral17 / paysa

A Splitwize alternative app that intend to provide all Splitwize features fully free and also facilitates more features like personalized Daily Spending's list with insight graph
MIT License
5 stars 2 forks source link

Integration of Gemini API #9

Open yaviral17 opened 4 months ago

yaviral17 commented 4 months ago

In Google I/O 2024 Gemini API has been launched and we can use it to give suggestion to users based on their data

How to use it :

To use promt with image data .

final model = GenerativeModel(model: "gemini-1.5-flash-latest", apiKey: apiKey);

final response = await model.generateContent([
  Content.text("What's in this photo?"),
  Content.data("image/png", imageBytes),
]);

Visit Generate API Key to get the api key

you can change the model from these options

- gemini-1.5-flash-latest

- gimini-1.0-pro

- gimini-1.5-pro-latest

image

To use only promt.

final model = GenerativeModel(model: "gemini-1.5-flash-latest", apiKey: apiKey);

final response = await model.generateContent([
  Content.text("What's in this photo?"),
]);

For more information visit Gemini API Docs