> For the complete documentation index, see [llms.txt](https://flutter-boilerplate.gitbook.io/flutter-boilerplate-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://flutter-boilerplate.gitbook.io/flutter-boilerplate-docs/features/ai/gemini-google.md).

# Gemini (Google)

If you want to integrate Gemini (Google) in your app you need an Gemini API key. You can get a Gemini API key here <https://aistudio.google.com/prompts/new_chat>. To use your own own API key in the app you can store it in the `.env` file in the `secrets/` folder, which lays in the root folder of the project. The `secrets/.env` file must be created by you. In the `.env` file add this line with your own Gemini API key:

```properties
gemini_api_key=[YOUR GEMINI API KEY]
```

If you build an app where users sign up and must use their own Gemini API key, there is no need to store your Gemini API key in the `.env` file. Rather access the users API key form their user data in the database. Storing your Gemini API key is only needed when you want to provide a Gemini function that users can use without having to insert their own API key.

Afterwards the API key from the `.env` file can be accessed via

```dart
EnvironmentRepository().geminiApiKey
```

### Chatbot

There is already an implementation for a basic chatbot powered by Gemini in the widget

```dart
GeminiComponent1()
```

The logic for the implemented chatbot can be found in class

```dart
GeminiRepository()
```
