Tom Chant
InstructorTom Chant
Share this video with your friends

Social Share Links

Send Tweet

Congratulations on completing the MoviePitch project and gaining the necessary foundation to work with the OpenAI API in your applications!

[00:00] Congratulations on finishing MoviePitch. Now you've got all of the foundations you need to work with the OpenAI API in your apps. Let's just quickly recap what we've studied. So we set up the OpenAI API and you can see that right here on lines 1 to 11.

[00:19] And we used the TextDaVinci 003 model with the CreateCompletions endpoint. And you can see that down here on lines 25 and 26. Now we started off using the zero-shot approach. So we made a simple prompt request to the API with just a one-line instruction.

[00:39] We then upgraded that to the few-shot approach with multiple examples. And we can see that right here lines 27 down to 39. And we used the few-shot approach to demonstrate to the API what sort of completion we were looking for.

[00:56] We also used the MaxTokens property and you can see that right here. We did that to ensure the model had enough tokens to answer the query successfully. And of course we also used the temperature setting. And we can see that down here on line 70. And that alters how daring our completions were.

[01:16] Higher temperatures allowed OpenAI's virtual imagination to go into overdrive. And lower temperatures kept things safer and more predictable. Now finally, if we come down here, we can see that we have got a slightly different endpoint in use right here. It's the CreateImage endpoint.

[01:34] And we used it to generate images from text prompts. So wow, that was quite a lot. Now it's always a good idea to make a project your own. And there are multiple ways that you could take this project to the next level. Here are just a few ideas. So in terms of the JavaScript,

[01:51] at the moment we're making a lot of API calls to the same endpoint. I wonder if you could find a way to think dry, do not repeat yourself, and have one function do the calling so we don't repeat the same line of code like this one that you see right here multiple times.

[02:10] So that would just involve a bit of neat refactoring. Now in terms of the AI, if you want to get anywhere in Hollywood or Bollywood, you're going to need a script. And the logical next step of this project is to have OpenAI create a script for your movie.

[02:26] Now that is a little bit tricky in terms of the amount of tokens you'd have to use. So you would have to break the process up into chunks. But it is doable. And then you could perhaps use the CreateImage endpoint to create more detailed character sketches. Or you could tailor the app to a more specific genre. So have it create specifically manga or rom-coms.

[02:46] Now if you take these three ideas and sell the script, I want 5%. Now ultimately, the best way to consolidate your learning is to delete all of the code and start again from scratch. You can use it to practice your HTML, CSS, JavaScript, and your knowledge of the OpenAI API.

[03:05] Now of course, you wouldn't need to do it exactly the same way. You would do it as you think best and just justify the changes you make. So quite a lot of potential work to do there. But with the skills you've got, all of this is possible. Now whatever you do, make sure you take a break now

[03:22] and consolidate what you've learned before moving on to the next project.

~ 18 minutes ago

Member comments are a way for members to communicate, interact, and ask questions about a lesson.

The instructor or someone from the community might respond to your question Here are a few basic guidelines to commenting on egghead.io

Be on-Topic

Comments are for discussing a lesson. If you're having a general issue with the website functionality, please contact us at support@egghead.io.

Avoid meta-discussion

  • This was great!
  • This was horrible!
  • I didn't like this because it didn't match my skill level.
  • +1 It will likely be deleted as spam.

Code Problems?

Should be accompanied by code! Codesandbox or Stackblitz provide a way to share code and discuss it in context

Details and Context

Vague question? Vague answer. Any details and context you can provide will lure more interesting answers!

Markdown supported.
Become a member to join the discussionEnroll Today