From the course: Introduction to Prompt Engineering for Generative AI (2023)

Unlock the full course today

Join today to access over 23,700 courses taught by industry experts.

Interacting with language models using an API

Interacting with language models using an API

- [Instructor] So here I am at the example section at OpenAI. And what I'm about to show you here is very similar in AI21's Jurassic model examples. So I'm going to choose this Summarize for a 2nd Grader here and you'll notice that there is code you can paste here, in a few languages. But what I like to do is open a playground up and you can make modifications. You can say something like, summarize for a second grader with rhyme. I'm going to go ahead and say View Code. And like magic, you have this code you can use in your project. You can do Python or Node.js. You can do curl, which basically means you can do anything. And now, I'm going to go ahead and copy this. Now, I'll head over to my editor of choice. I'm using VS Code. I've created a file called rhymerize and I'm going to go ahead and paste this. And finally, I'll say print response. Now, it's going to need the OpenAI library and to install that I'm going…

Contents