WriteMyMLA is a web application that can be used by canadians to search for and write their provincial MLA’s, MPP’s, MNA’s, or MHA’s. The application will return the name, party, and contact information for the representative, and provide the user with the opportunity to create an AI-generated letter. This is a not-for-profit project intended to aid citizens with finding and writing their representatives.
For ease of deployment and duplication by other not-for-profits, the application has been written in Python and deployed on Streamlit.io. Users may easily duplicate and deploy a version of the web application themselves.
This project was an exercise in utilizing the OpenAI API to create a controlled response and return a consistent, specific product. The goal was to utilize this api to prove that LLMs can be utilized by non-profits to provide citizens with additional support in engaging with their provincial representatives. A self-deployment option is available, and individuals can also use the web platform in tandem with a local instance of GPT4All to run the application for free from their local device.
This application uses three APIs to provide citizens with the correct information and generate a letter.
- Geocoder.ca Provides the API used to accurately search using postal code information.
- Represent Civic Information API Provides the API used to search for representatives based on location.
- OpenAI Provides the letter generation based on the user details
- GPT4All Integration provides an open-source alternative for letter generation based on the user details