- Learn some options for adding a text generating AI (chatbot) to your app
- Learn some options for adding image generating AI to your app
These are the activities for this lesson:
GEN AI COMPONENTS
While we have covered how to build a machine learning model that will classify images, sound, and text, there is another way to bring AI to your app. You can basically embed a chatbot like ChatGPT or Gemini into your app so your users can take advantage of that AI power.
Generative AI components allow the app to create new, original content in response to user input, rather than simply retrieving or displaying existing information. These components are typically powered by advanced machine learning models—such as large language models for text and diffusion models for images. So, essentially you are using a pre-trained model when using a GenAI component in your app.
When integrated into an app, they can take many forms. Here are some examples:
- AI chatbot that provides personalized answers,
- writing assistant that drafts or edits text,
- creative tool that generates images
- productivity feature that summarizes, translates, or adapts content to a user’s needs.
ADDING GENAI TO YOUR APP
There are ways to add a generative AI chatbot or an image generator on almost all coding platforms or languages.
- App Inventor has Chatbot and Imagebot components that can be easily added and coded.
- Chatbot – for testing purposes you can use the Default option which gives you access to a certain amount of free tokens through MIT.
- Imagebot – you will have to sign up for an OpenAI API key, which costs money, in order to use the Imagebot.
- Thunkable has OpenAI Services that you can add to your project to use the OpenAI chatbot features
- The use of the OpenAI Services requires you to set up an OpenAI API key, which costs money. You do get free credits when you sign up
- Text-based languages like Python, Java, Javascript have many options to utilize large language models. You can search around to find LLM APIs that have a free option for testing and educational purposes.
- Google AI Studio offers free access to Gemini API
- Hugging Face provides access to many LLM models for text and diffusion models for images through their inference APIs
- Full list of free LLM API resources on Github
The activity below uses MIT App Inventor as the coding platform. If you want are interested in adding an AI chatbot to an app using a text-based language, try this tutorial, Flip the Switch (React/Javascript) or this tutorial, JusticePath (Python/Streamlit).
ACTIVITY: Personal Tutor App
Follow the video tutorial
REFLECTION
You have learned about some ways to include generative AI features in your own app.
Can your users benefit from having a generative AI feature in your app?
REVIEW OF KEY TERMS
- Generative AI – technology that has the ability to create content like text, images, and and sound
- Large Language Model – an AI model that predicts and generates text, trained using enormous amounts of data
- Diffusion model – AI model that generates images, by first being trained on millions of images, adding noise to them, learning patterns to then remove the noise in order to generate new images
ADDITIONAL RESOURCES
Want to explore some more ways to add generative AI to your app?
- App Inventor AI tutorials (look for ones on the page that mention generative AI)
- Using GenAI in Thunkable
