When treated as a platform, LLMs such as ChatGPT become powerful building blocks for custom, conversational agents. In this talk, we use the OpenAI API and Vercel AI SDK to build a digital sommelier that recommends the perfect wine.
Building a Digital Sommelier on Top of ChatGPT and the OpenAI API
FAQ
Jan's main purpose is to demonstrate how to build a digital AI-powered sommelier using the Bracel.ai SDK and OpenAI API, showcasing the ease of creating applications with generative AI.
According to Jan, starting to build with the Bracel.ai SDK is really simple and can be initiated in less than five minutes.
Jan uses the Bracel.ai SDK, OpenAI API, Next.js, and ShadeCN to build the digital sommelier.
Jan provided examples of wine pairings with foods such as fresh oysters on ice, roast duck with red wine sauce, and Mousse au chocolat during his presentation.
Developers play a crucial role in shaping how generative AI tools are integrated and utilized, by building and designing interfaces that facilitate user interactions with these technologies.
The server sends a streaming response, which is turned into a readable stream that displays on the client side, simulating the AI typing out the response.
Jan mentioned the temporary ousting of Sam Altman as CEO of OpenAI and a strike by most of its employees, which raised concerns about the longevity of the API's availability.
While Jan's digital sommelier can suggest wine pairings effectively, he does not claim that it will completely replace traditional sommeliers anytime soon.
Jan recommends deploying AI projects on platforms like RSL or Netlify to test and see how they perform.
Video Summary and Transcription
Today's Talk introduces the concept of building a digital AI-powered sommelier using the Bracel.ai SDK. The speaker emphasizes the role of developers in shaping the impact of AI, particularly generative AI, on our work. The Talk showcases a simple digital sommelier built using the Resell AI SDK and OpenAI API, highlighting the ease of implementation and the potential of open source tools. The speaker encourages users to explore the possibilities of generative AI responsibly and recommends checking out And Why, a design and technology studio from Munich.
1. Introduction to AI-powered Sommelier
Today I want to show you how to build a digital AI-powered sommelier through Bracel.ai SDK. AI, especially generative AI, will have a profound effect on how we work. We as developers can shape that how. We are the ones building and designing the interfaces that facilitate between users and large language models. It's really simple to get started.
Yes, thank you so much for having me. My name is Jan. I'm a lead developer at EddDwye and today I want to show you how to build a digital AI-powered sommelier through Bracel.ai SDK. And initially it was planned that this talk is part of the Remote Day on Tuesday. So when I recorded the first version a couple of weeks back, I talked about the frantic pace at which things are changing in the AI space. And I guess the latest development really proved that point. And I thought, is my talk still relevant? Because a couple of weeks back, we received custom versions of JetGPT. Maybe you have tried it out. You can build your own versions of JetGPT for any kind of topic. And guess what? There are plenty of sommeliers among them and they are actually pretty good. So I thought, great. What does it mean for my talk? And then Sam Altman was ousted as CEO at OpenAI. Most of its employees went on strike and I thought, okay, how long will this API still be around? But since then things calmed down a bit. Altman is back as CEO at OpenAI. And yeah, I think when I thought about it, the underlying message of my talk is still true. That is that AI, especially generative AI, will have a profound effect on how we work. The good thing is, we as developers can shape that how. We are the ones building and designing the interfaces that facilitate between users and large language models. And that gives us a really good position in this transition to using generative AI tools. The best thing is, it's actually really simple to get started. It doesn't take more than five minutes. So let's pick a challenge and see how far we get.
2. Building a Simple Digital Sommelier
We can build a simple digital sommelier using the Resell AI SDK and the OpenAI API. The UI consists of two columns: a menu for food and a wine list for pairing. The code is straightforward, utilizing the Resell AI SDK's chat hook and helper functions. The server-side code involves initiating a client for the OpenAI API and specifying the model (GPT 3.5 TORGO). After sending the dish data to the API, we receive a streaming response that is rendered on the screen using the chat hook. It's a great example of what can be achieved with open source tools.
So maybe you guessed it from the topic. I am really into wine and I like pairing food and wine, but there are literally millions of possibilities from various regions and countries, France, Spain, Italy, you name it. So finding the right pairing can be really challenging. But we can build a really simple, hopefully smart, digital sommelier that helps us with finding that perfect pairing.
So let's do that in the next five minutes with the Resell AI SDK and the OpenAI API. So we'll start with a really simple UI. I'm not lying if I tell you that this took the longest to put together. So we have two columns, there is a menu on the left, so the food, and there is a wine list on the right to pair with the food. And on the bottom, you have a small form, a text area where you can add new dishes to the menu.
If you look at the code, it's really simple. We make use of the use chat hook provided by the Resell AI SDK, and it gives us a set of helper functions to interact with large language models. So it does all the heavy lifting, there's not much we need to do here. And we have the form itself, which uses some of these helper functions to send the data off to an API road. That is also actually quite simple. On the server, we have three things, we initiate a client to interact with the OpenAI API, we specify the model. In this case, it's GPT 3.5 TORGO. We provide our OpenAI API key. Unfortunately, it's not free. And that's it.
We read the form data from the request, so the dish in this case we want to pair a wine with, and we send it off to the OpenAI API. What we get back is a streaming response, or a response that we turn into a readable screen that we send back to the client. And here, there's not a lot more to it. Again, we use chat hook to render this streaming response on the screen. And that gives us that nice effect that looks like the AI is actually typing the response. Probably if you use chat GPT, you've seen it before. And that's really all there is to it. Maybe a hundred lines of code. But I think it's a good showcase of what you can do really quickly with open source tools. But let's see if that actually works. So I prepared a little example.
Check out more articles and videos
We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career
Workshops on related topic
In the workshop they'll be a mix of presentation and hands on exercises to cover topics including:
- GPT fundamentals- Pitfalls of LLMs- Prompt engineering best practices and techniques- Using the playground effectively- Installing and configuring the OpenAI SDK- Approaches to working with the API and prompt management- Implementing the API to build an AI powered customer facing application- Fine tuning and embeddings- Emerging best practice on LLMOps
Key Concepts: Generative AI, Retrieval Augmented Generation
Technologies: OpenAI, LangChain, AstraDB Vector Store, Streamlit, Langflow
Key Takeaways:
- Practical experience in creating an AI-driven documentation site.- Understanding the integration of AI into user experiences.- Hands-on skills with the latest web development technologies.- Strategies for deploying and maintaining intelligent documentation resources.
Table of contents:- Introduction to AI in Documentation- Setting Up the Environment- Building the Documentation Structure- Integrating ChatGPT for Interactive Docs
After this session you will have insights around what LLMs are and how they can practically be used to improve your own applications.
Table of contents: - Interactive demo implementing basic LLM powered features in a demo app- Discuss how to decide where to leverage LLMs in a product- Lessons learned around integrating with OpenAI / overview of OpenAI API- Best practices for prompt engineering- Common challenges specific to React (state management :D / good UX practices)
Comments