Inspiration

Having been a freelance developer from a French-speaking country for 4 years, I have faced some challenges communicating with clients due to English not being my native language.

The development of AI chat tools like Gemini Chat (formerly Bard) has significantly improved my communication with my clients. I typically write my message and then utilize these AI assistants with a prompt such as: "Please correct any spelling errors and suggest improvements to the wording in the following sentence." While helpful, the repetitive task of writing the prompt's beginning became tedious, leading me to create this AI writing assistant to aid both myself and other people facing similar challenges.

What it does

This cross-platform mobile application helps you write and improve your writing skills in a specific language.

Whether you're a native speaker of a language or not, it can sometimes be difficult to produce correct messages. Whether you write slowly or quickly, you're likely to omit some words or write others incorrectly. That's where AI Writing Assistant comes in.

Here is what the application can do:

  • Correct grammar, spelling, and various other types of errors.
  • Support text correction in multiple languages depending on Gemini capability.
  • Specify the words that have been modified with explanations to help the user improve.
  • Provide correction explanations in 5 languages (English, French, Swahili, Lingala, and Hindi) to enhance understanding for individuals unfamiliar with the original language.
  • Suggest a better text while keeping the complete meaning of the original text.
  • Copy the text.

How we built it

The app was built using the Flutter framework for multi-platform compatibility with a single codebase. Initial testing was conducted on Android and iOS mobile devices.

User Interface

The app has two screens: an onboarding screen and a second screen where the entire process takes place.

The second page has four main parts:

  • The language selection area is where there will be explanations for the change.
  • The text editing area.
  • The tooltip on which the change of a word or a group of words is mentioned with the explanations.
  • The suggestion area where the suggestion for better text will be displayed if available.

It utilizes a Quill editor for read-only result display, offering word highlighting and customizable link click actions.

Implementation

I used two different approaches:

Gemini 1.0

With Gemini 1.0, I used structured prompts, allowing it to provide answers in JSON format and retrieve all data within a single request. I began with a prototype in Google AI Studio for optimal results, subsequently implementing it in Flutter using the official Gemini Flutter SDK.

Gemini 1.5

Everything is quite alright with version 1.0 of Gemini, but I also wanted to test the new approach with version 1.5, which can directly answer with JSON by specifying it in the configurations. This option is not available at the moment with the SDK; I used the cURL option.

Challenges we ran into

The first challenge was about finding a way to put all the data in a user-friendly interface; it took me time to find the best options in Flutter.

The second challenge was to manipulate the prompt so Gemini can answer in a well-formatted JSON data; I spent a lot of time with Google AI Studio, giving and testing different inputs and outputs examples.

Accomplishments that we're proud of

The accomplishment that I am proud of is finding a way to have responses in the JSON format with a lot of data at once; even if sometimes it can give badly formatted data, in most cases it gives data as asked.

What we learned

Through refining my prompts, I've learned a great deal about not only achieving better results, but also discerning when to leverage AI and when to stick with conventional coding. While AI is undeniably powerful, it shouldn't handle every aspect of our applications. As developers, it's crucial to identify the areas where AI can truly shine and where it falls short.

What's next for Flutter AI Writing Assistant

Currently, it functions on Android and iOS, with potential compatibility on Windows, Linux, and the Web, although untested. The next phase involves incorporating additional platforms and, most crucially, developing a browser extension to enhance user experience.

Built With

Share this project:

Updates