An AI writing assistant like Grammarly using the Gemini AI API. It gets the text from the user and sends it to the Gemini AI API to:
- Fix grammar mistakes
- Display the reason for the correction
- Specify the language of correction
- Suggest alternative sentence if needed
To use this project, you need to have the Flutter SDK installed. You can find the installation instructions.
To use the Gemini AI, you need to have an API key. Get an API Key.
To add your API key to the project, you have to add it to pass it to the flutter run command:
flutter run --dart-define=API_KEY=$YOUR_API_KEY
Replace $YOUR_API_KEY with your API key.
You can set your IDE's run configuration to pass the API key.
- Open the project in Android Studio.
- Click on the
main.dart
dropdown at the top of the window. - Click on
Edit Configurations...
. - In the
Additional run args
field, add `--dart-define=API_KEY - Click on
Apply
andOK
.
Your configuration should look like this:
- Open the project in VS Code.
- Click on
Run and Debug
from the left sidebar. - Click on
create a launch.json file
. - Select
Dart & Flutter
. - Add `"args": ["--dart-define=API_KEY"] in the first configuration object.
- Save the file.
Your file should look like this:
You can run the tests using the following command:
flutter test --name="Test check method" test/assistant_test.dart --dart-define=API_KEY=YOUR_API_KEY --dart-define=SENTENCE="YOUR_TEXT"
Replace YOUR_API_KEY with your API key and YOUR_TEXT with the text you want to test.
To learn more about this project, check out these links: