Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   Index   Templates   Seminars   TechHelp   Forums   Help   Contact   Join   Order   Logon  
 
Home > TechHelp > Directory > Access > AI Chef Helper < Application Parts | AI Chef Helper 2 >
Back to AI Chef Helper    Comments List
Transcript Pinned    Upload Images   Link   Email  
Richard Rost              
7 months ago
Got a good one for you today, folks. We're going to take the Chef's Kitchen Helper and we're going to AI it. We're going to integrate it with ChatGPT OpenAI, and we're going to use it to say, "Hey, this is the stuff I have in my kitchen pantry. Alright, I got milk, I got marinara sauce, I got pepperoni, I got whatever. Alright, here's my list of ingredients. You tell me what I can make with it," and we'll have ChatGPT do the hard work.

Today's question comes from Nolan in Evanston, Illinois, one of my Platinum members. Nolan says, "I've been using your Chef's Kitchen Helper database for over a year now, and it works great. But, I got to thinking that I could use ChatGPT to help me come up with some new recipe ideas based on what I have in my pantry. I can copy and paste my list of ingredients into the GPT interface, but is there a way I can just integrate this into my database directly? I know you showed us how to do some stuff with GPT before with Access. How would I put these two things together?"

Well, that's a great idea, Nolan. With the Chef's Kitchen Helper that I showed you how to build before, you've got a list of all the products that are in your pantry right now, all the different ingredients. We could literally take that, build a text string out of it, send that text string to OpenAI, and say, with some instructions, "Hey, based on these ingredients, give me three dishes or five dishes or whatever that I can make out of this stuff." And then there you go. And we'll have ChatGPT do all the hard work.

So, what do we need to know? Well, first off, this is going to be a developer-level video, which means we're going to need a decent amount of VBA with this one. This is more of an advanced level VBA video for you. And in fact, we're going to have to use record sets in today's video. Record sets allow us to say, "OK, here are the records in my table. I want to loop through them and read in the data into VB, right, and to create a text string that's got one or more records worth of data in it that I can then take that text string and do stuff with it, like send it to OpenAI." OK, so definitely go watch my record sets video if you haven't worked with record sets before.

This is pretty much the only way that I can think of to do this. And I love record sets. I use them all the time. So definitely a good tool to have in your box. If you haven't watched my Chef’s Kitchen Helper video, this one's about four years old. This was a popular one back in the day. Go watch this. In fact, this one came up even before I had my TechHelp free template. So it's just a couple of tables and some queries. But basically, in this database, I show you how to put in your list of ingredients. You specify the recipes, right, like a pizza requires this much flour, this much marinara sauce, this much pepperoni, this much mozzarella cheese. And then the database will tell you, based on what the required quantities are and what you have on hand, what you can make.

So, go watch this just to get a feel for it if you want to. This is kind of optional because all you need really is a product table. This is definitely the big one though. Definitely go watch the OpenAI video. There's two parts to it. I will teach you how to build a database where you can send information to OpenAI, get a response back, display that in your form. We're going to be working with a copy of this database for today. So if you haven't built this yet, go build it now. Go watch this video and follow along. Build it.

If you're a Gold member, you can download the database off my website. That's one of the benefits of being a member and then, once you've done what you got and then come on back. All right, I'm going to start with grabbing a copy of the Chef's Kitchen Helper database since I'm a Gold member on my own website. I can do that. Here's the download right there. I'm going to click on that. It'll download the file. There it is, right there; let's open her up, and this database is pretty simple. We got a list of products, and this is really all we need for today.

We've got a product ID, which we really don't care about; product name, that's your products; your quantity on hand; and your unit type, ounces, cups, pounds, whatever. That's all we need. The rest of the stuff in this database is if you want to put in your own recipes like cereal, pancakes, chicken parm, and then you specify the ingredients required for each recipe. I cover this in that other video. All we really need for today is this because we're going to make ChatGPT tell us what to do.

Now, you could do this yourself manually using the ChatGPT web interface if you want to. Let me show you an example. Alright, here I am in ChatGPT on the web. You can use GPT-3.5; it works just fine. I've tried it in both of them. GPT-4 is a little more advanced, of course. By the time you're watching this, it could be the year 2030, and we're up to GPT-85. I don't know. But anyways, we're just going to come down here, okay? We're going to type in a basic prompt, like "I'm going to give you the contents of my food pantry. Please suggest three dishes that I can make using these ingredients."

Now, don't hit enter yet. Hit shift enter a couple of times so you're on a blank line. Go up to your product table, select these columns like that, copy it, Ctrl+C, come back over here, and then paste that in. There's your stuff, and yeah, GPT can make sense out of that; then send it. And then right away, there you go. There are three dishes for you: Chicken Parm, Spinach Pasta; yeah, I got that stuff. Chicken breast, flour, eggs, Parmesan cheese, spinach; Pancakes with eggs, I don't know if that sounds kind of okay; Creamy Chicken Alfredo Pasta, sure. Sounds great.

Okay, so what we want to do with today's lesson is to make Access do this. So I can just, from my database, you know, keep your product list up to date, update your pantry, whatever. And then when you're ready for some ideas for dinner, click the button and have it tell you some different ideas.

So now, the next step is to go get my OpenAI database. I believe it's on part two. Yeah. So usually, you'll find links to multiple parts on here. There's part two, and usually, the database is on the last part. This is a two-part series. There's the database right there. I'm going to click on that bad boy, and have that download. Alright, we can open up the OpenAI database.

All right, here we are. Now, this is the members' version of it. So if you're not a member, there have been a few changes to this. Basically, what I did was in the free version, we just had one command, which was "please correct for spelling and grammar." Well, in the extended cut, we made it so you could have different bots. So you could pick, "OK, reply as if you're Jean-Luc Picard." If I say, "please go to the store," and you can say, "please reply as if you're Jean-Luc Picard," it will come back with that answer. And of course, I'm getting an error unauthorized because, and I was going to bring this up, but I jumped the gun. We have to go into the secret key mod, and in here is where you have to put your API key. Remember, if you're going to do this, you need an API key from OpenAI. So, you put that right in here.

I'm going to put mine in now, and you're not going to know what it is because it's mine. And I don't want you running up my bill, but go ahead and put your API key in here now. And now that my API key is in there, it should come back. There we go: "Make it so, Engage! Make your way to the store and proceed with your mission." So, that's what we did in the other one. Or, you could say, "reply as Mr. Spock." Let's see what that comes back with. "Oh, this is indeed fascinating. You're suggesting physical visits to acquire goods." I love it.

Anyways, so that's basically what we added in the extended cut. All right, so next up, let's take the product table from our Chef database and bring that over here. OK, that's all you've got to do. Now, we really don't need this other database anymore. We can close that and get it out of the way. All right, so we got our list of products from our pantry in our AI database. Now, we're going to set up a bot for the instructions for the chef.

So, I'm going to go to the bot table. If you're building this off the free database, you're not going to use a bot. You're just going to replace the instructions, your system message, with this. We'll call this the Chef's Helper. And I'll put that same set of instructions in here that I gave to ChatGPT.

Now what we're essentially going to do is we're going to take this and send it as a system message. And then we're going to send our list of products as the user message. Now, members, note that this is ID 7 for our send to OpenAI function. So instead of using this send to OpenAI, which uses these bots here, what we're going to do is we're going to make another button. In fact, I'm going to get rid of these. We don't need all these buttons. And let's just rename this guy Chef's Helper. In fact, what I'm going to do is, we can keep this stuff around, if you want to keep it around, just kind of bring it over here and make it smaller. Let's send to OpenAI. We'll put our little bot over here. Yeah, we'll just change this to Chef’s Helper, whatever you want to do, make it look pretty. I make it look pretty for the slide. Chef's Helper, whatever. OK, but we want a nice big area over here so we can see what the response is, so we can see all the dishes. OK, we'll do it like that.

OK, now, we're going to use our custom button to send this stuff. All right, we're not going to use these. We'll keep these around in case you want to use them for something else. But this is the button that's going to be sending our stuff to OpenAI and getting the response. Let's rename the button. It's Customer List Button right now. Let's call this the Chef Button. Now we're going to take the code out of the Send to OpenAI button. All right, so go in here, build event. All right, this is the code here for the members. The non-member version, all I did was I took all that code in the button and I just encapsulated it into this function called AskOpenAI. All right, which sends to it the text, which is the user message, and the bot information, which is the instructions. All right, that's all that does; you should be able to figure out how to work with that.

We're going to copy that stuff there, and we're going to drop it in this button here. OK, now our bot combo, we're not going to use the bot combo; we're just going to put in there our ID 7. We're going to use the Chef bot. And the stuff we're going to send to it is not going to be my text. My text is the textbox; we don't want to send that. We want to send our product string. All right, what's the product string? Well, the product string is a string we're going to build up for all of our products. All right, so we're going to Dim that as a string. OK, so we're going to build up a product string, which is a list of all the products out of the ProductT, which we'll use a record set for. OK, and then we're going to send that as the data with the instructions from the bot, bot 7, and that's going to go to OpenAI, and we'll get our reply back.

And we're going to build that product string in tomorrow's class. So, tune in tomorrow, same bat time, same bat channel. Or if you're a member, you can watch it now because I'm going to record it in just a few minutes. And in part two, we will continue on by building our string of products to send to OpenAI and make sure this whole thing works. Alright? So that's going to be your TechHelp video for today. Hope you learned something, live long and prosper, my friends, and I'll see you tomorrow for part two.

TOPICS:
AI integration with ChatGPT OpenAI
Using ChatGPT for recipe suggestions
Chef's Kitchen Helper database usage
Accessing ChatGPT with a list of ingredients
VBA advanced level tutorial
Using record sets in VBA
Building a text string for OpenAI interaction
Revisiting the Chef's Kitchen Helper video
Creating an OpenAI Access database
Downloading Access databases for Gold members
Integrating product tables from Access databases
Access database membership benefits
Instruction building for ChatGPT prompts
Setting up a bot for recipe instructions
Sending system messages to OpenAI
Generating product strings from Access tables
Capturing OpenAI response in Access
Building an Access form for ChatGPT interaction
Customizing Access buttons for OpenAI communication
Configuring API keys for OpenAI access
Continuation in part two of the tutorial

This thread is now CLOSED. If you wish to comment, start a NEW discussion in AI Chef Helper.
 

 
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2024 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 10/13/2024 8:35:59 PM. PLT: 1s