From the course: AI Programming for JavaScript Developers
Unlock the full course today
Join today to access over 24,600 courses taught by industry experts.
Solution: Customizing questions - JavaScript Tutorial
From the course: AI Programming for JavaScript Developers
Solution: Customizing questions
(upbeat music) - All right, let us finish this challenge. So we want to create a prompt that's going to generate these questions. So the first thing I need to do here in our hello function is make use of this completion object value. We will await OpenAI.chat.completions.create. And then within this object we're going to send the messages array. We're going to spell messages correctly, and then we're going to place a few different roles here. So the system role and content will say you'll be asked to create job interview questions. Then we're going to handle the question. So we'll say inside of a string, give me three interview questions for a JavaScript developer. We need to specify the model as well. So model, we'll stick with the one we've been using. If you wanted to make this 4.0, you could as well. Okay. And then let's go ahead and console log completion just to see what we get. Alright, so we want to run this…
Contents
-
-
-
-
(Locked)
Writing functions2m 25s
-
(Locked)
Working with streams2m 29s
-
(Locked)
Creating a prompt3m 22s
-
(Locked)
Refactoring functions with code prompts3m 21s
-
(Locked)
Setting templates3m 27s
-
(Locked)
Challenge: Customizing questions44s
-
(Locked)
Solution: Customizing questions4m 24s
-
(Locked)
Solution: Building OpenAI prompts2m 20s
-
(Locked)
-
-
-
-