From the course: Build a JavaScript AI App with React and the OpenAI API

Unlock the full course today

Join today to access over 24,400 courses taught by industry experts.

Create a location string from a prompt

Create a location string from a prompt

- [Instructor] All right, we now have all the pieces in place to start integrating the OpenAI API into our app. As a refresher, the first thing I want to do is extend our app so that instead of just putting in location information in this input field, I'll be able to put in a question or a sentence and then the AI can derive from that sentence what location we're talking about and pass just the location string back. You'll also remember I found a prompt that worked for this that looks like this, "Act like a location string generator based on my prompt," et cetera, et cetera, that provides an example. And I figured out that if I take this prompt and I place it into the Playground under the system tag, I'll be able to generate the output every time I pass in a new message with a new request. So now the question becomes, "How do I convert this setup into an API call in my REST client that I can then migrate over into my…

Contents