Building a Digital Sommelier on Top of ChatGPT and the OpenAI API

Rate this content
Bookmark
Slides

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.

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.

Jan Demmerle
Jan Demmerle
8 min
07 Dec, 2023

Comments

Sign in or register to post your comment.

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

Short description:

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

Short description:

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

Building a Voice-Enabled AI Assistant With Javascript
JSNation 2023JSNation 2023
21 min
Building a Voice-Enabled AI Assistant With Javascript
Top Content
In this talk, we'll build our own Jarvis using Web APIs and langchain. There will be live coding.
AI and Web Development: Hype or Reality
JSNation 2023JSNation 2023
24 min
AI and Web Development: Hype or Reality
In this talk, we'll take a look at the growing intersection of AI and web development. There's a lot of buzz around the potential uses of AI in writing, understanding, and debugging code, and integrating it into our applications is becoming easier and more affordable. But there are also questions about the future of AI in app development, and whether it will make us more productive or take our jobs.
There's a lot of excitement, skepticism, and concern about the rise of AI in web development. We'll explore the real potential for AI in creating new web development frameworks, and separate fact from fiction.
So if you're interested in the future of web development and the role of AI in it, this talk is for you. Oh, and this talk abstract was written by AI after I gave it several of my unstructured thoughts.
The Rise of the AI Engineer
React Summit US 2023React Summit US 2023
30 min
The Rise of the AI Engineer
We are observing a once in a generation “shift right” of applied AI, fueled by the emergent capabilities and open source/API availability of Foundation Models. A wide range of AI tasks that used to take 5 years and a research team to accomplish in 2013, now just require API docs and a spare afternoon in 2023. Emergent capabilities are creating an emerging title: to wield them, we'll have to go beyond the Prompt Engineer and write *software*. Let's explore the wide array of new opportunities in the age of Software 3.0!
Web Apps of the Future With Web AI
JSNation 2024JSNation 2024
32 min
Web Apps of the Future With Web AI
AI is everywhere, but why should you care, as a web developer? Join Jason Mayes, Web AI Lead at Google, who will get you on track by demystifying common terminology ensuring no one is left behind, and then take you through some of the latest machine learning models, tools, and frameworks you can use right in the browser via JavaScript to help you bring your creative web app ideas to life for almost any industry you may be working in. By moving AI to the client side, there is no reliance on the server after the page load, bringing you benefits such as privacy, low latency, offline solutions, and lower costs which will be of growing importance as the field develops. This talk is suitable for everyone with a curiosity for web and machine learning, so come along and learn something new to put in your web engineering toolkit for 2024.
Building the AI for Athena Crisis
JS GameDev Summit 2023JS GameDev Summit 2023
37 min
Building the AI for Athena Crisis
This talk will dive into how to build an AI for a turn based strategy game from scratch. When I started building Athena Crisis, I had no idea how to build an AI. All the available resources were too complex or confusing, so I just started building it based on how I would play the game. If you would like to learn how to build an AI, check out this talk!
Code coverage with AI
TestJS Summit 2023TestJS Summit 2023
8 min
Code coverage with AI
In this lightning demo I will showcase how Codium, a cutting-edge generative AI tool, is revolutionizing code integrity. We will demonstrate Codium's ability to generate useful Mocha tests, taken from a public repository and highlight the seamless integration. You can see Codium as it transforms complex test scenarios into actionable insights, propelling code coverage forward. Join us for an insightful peek into the future of automated testing where speed meets quality!

Workshops on related topic

AI on Demand: Serverless AI
DevOps.js Conf 2024DevOps.js Conf 2024
163 min
AI on Demand: Serverless AI
Top Content
Featured WorkshopFree
Nathan Disidore
Nathan Disidore
In this workshop, we discuss the merits of serverless architecture and how it can be applied to the AI space. We'll explore options around building serverless RAG applications for a more lambda-esque approach to AI. Next, we'll get hands on and build a sample CRUD app that allows you to store information and query it using an LLM with Workers AI, Vectorize, D1, and Cloudflare Workers.
Working With OpenAI and Prompt Engineering for React Developers
React Advanced Conference 2023React Advanced Conference 2023
98 min
Working With OpenAI and Prompt Engineering for React Developers
Top Content
Workshop
Richard Moss
Richard Moss
In this workshop we'll take a tour of applied AI from the perspective of front end developers, zooming in on the emerging best practices when it comes to working with LLMs to build great products. This workshop is based on learnings from working with the OpenAI API from its debut last November to build out a working MVP which became PowerModeAI (A customer facing ideation and slide creation tool).
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
Building Your Generative AI Application
React Summit 2024React Summit 2024
82 min
Building Your Generative AI Application
WorkshopFree
Dieter Flick
Dieter Flick
Generative AI is exciting tech enthusiasts and businesses with its vast potential. In this session, we will introduce Retrieval Augmented Generation (RAG), a framework that provides context to Large Language Models (LLMs) without retraining them. We will guide you step-by-step in building your own RAG app, culminating in a fully functional chatbot.
Key Concepts: Generative AI, Retrieval Augmented Generation
Technologies: OpenAI, LangChain, AstraDB Vector Store, Streamlit, Langflow
Leveraging LLMs to Build Intuitive AI Experiences With JavaScript
JSNation 2024JSNation 2024
108 min
Leveraging LLMs to Build Intuitive AI Experiences With JavaScript
Workshop
Roy Derks
Shivay Lamba
2 authors
Today every developer is using LLMs in different forms and shapes, from ChatGPT to code assistants like GitHub CoPilot. Following this, lots of products have introduced embedded AI capabilities, and in this workshop we will make LLMs understandable for web developers. And we'll get into coding your own AI-driven application. No prior experience in working with LLMs or machine learning is needed. Instead, we'll use web technologies such as JavaScript, React which you already know and love while also learning about some new libraries like OpenAI, Transformers.js
Let AI Be Your Docs
JSNation 2024JSNation 2024
69 min
Let AI Be Your Docs
Workshop
Jesse Hall
Jesse Hall
Join our dynamic workshop to craft an AI-powered documentation portal. Learn to integrate OpenAI's ChatGPT with Next.js 14, Tailwind CSS, and cutting-edge tech to deliver instant code solutions and summaries. This hands-on session will equip you with the knowledge to revolutionize how users interact with documentation, turning tedious searches into efficient, intelligent discovery.
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
Llms Workshop: What They Are and How to Leverage Them
React Summit 2024React Summit 2024
66 min
Llms Workshop: What They Are and How to Leverage Them
Workshop
Nathan Marrs
Haris Rozajac
2 authors
Join Nathan in this hands-on session where you will first learn at a high level what large language models (LLMs) are and how they work. Then dive into an interactive coding exercise where you will implement LLM functionality into a basic example application. During this exercise you will get a feel for key skills for working with LLMs in your own applications such as prompt engineering and exposure to OpenAI's API.
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)