A Flutter project showing how to use Celest to connect to Google's Gemini API. This project demonstrates:
- How to build Celest Functions
- How to manage environment variables with Celest Functions
- How to use custom model types with Celest Functions
- How to connect your Flutter app to your Celest backend
- How to use your Celest backend to serve configuration such as "supported models", so that you can dynamically update them without deploying another version of your app
Clone or download this repo. Then, navigate to the examples/gemini
folder in your console, and run the following command:
$ flutter pub get
Download Celest from the Celest download page, and run the installer to get the Celest CLI.
Open this folder (examples/gemini
) in your favorite IDE, navigate to the celest
folder, and create a .env
file. This will contain your Gemini API key. To learn more about obtaining an Gemini API key, follow this guide.
The .env
file you created should contain the following key-value pair:
GEMINI_API_KEY=<your-gemini-api-key>
You are now ready to run your backend locally.
In your console, and run the following command to start the local Celest environment:
$ celest start
This command will keep running in your console to watch for changes to your Celest backend.
Now, run your Flutter app and enjoy experimenting with Celest!