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 building a simple yet effective conversational app that demonstrates the core principles of large language model (LLM)–powered web applications. By “conversational,” I mean that users will interact with our AI app using natural language through text inputs, such as 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 a flexible app that can select the right model for the task at hand and is highly adaptable, giving us the freedom to customize its behavior.