2 Building your first generative AI web application
This chapter covers
- Setting up a simple generative AI web app with React
- Interfacing with the OpenAI Client
- Introducing Next.js and adopting it as our backend service
Let’s start our journey by creating a simple but effective conversational app that demonstrates the core principles behind LLM-powered web applications.
By conversational, we mean that users will interact with our AI app using natural language through text inputs, like a chat message interface often found on web pages for support or help. Conversational AI can also involve voice input and spoken answers, but our initial focus will be on text-based interactions. Our app will become more versatile as we progress through this book and add more advanced functions. It will eventually be able to accept sound recordings, generate pictures, employ advanced tooling, and even handle queries related to private data. Our goal is to build an app that is flexible, so it is capable of selecting the right model for the task at hand, as well as highly adaptable, providing us with the freedom to customize its behavior.