hands-on lab

Applied OpenAI Prompt Engineering

Difficulty: Intermediate
Duration: Up to 30 minutes
Students: 389
Rating: 5/5
Get guided in a real environmentPractice with a step-by-step scenario in a real, provisioned environment.
Learn and validateUse validations to check your solutions every step of the way.
See resultsTrack your knowledge and monitor your progress.

Description

Prompt engineering develops prompts to obtain better results from large language models (LLMs), such as OpenAI's GPT-4. This lab illustrates several prompt engineering tactics that can be used to improve the quality of the results obtained from the OpenAI Chat Completions API. The goal of this lab is to put you in a position to apply prompt engineering to your specific use cases of LLMs.

This lab is built around the application of AI in content categorization. Specifically, given a piece of content, use AI to assign a category to it from a list of possible categories.

Learning objectives

Upon completion of this intermediate-level lab, you will be able to:

  • Understand how to apply prompt engineering in practice
  • Demonstrate how to use the OpenAI Chat Completions API to perform content categorization
  • Apply one-shot and few-shot learning to improve the quality of the results obtained from LLMs

Intended audience

  • Software Developers
  • Machine Learning Engineers
  • Anyone interested in learning about applications of generative AI

Prerequisites

Familiarity with the following will ensure the most beneficial lab experience:

  • Python
  • OpenAI Completion API basics

The following content can be used to fulfill the prerequisites:

Updates

September 18th, 2024 - Resolved an issue causing lab setup to fail

Environment before

Environment after

Covered topics

Lab steps

Starting the OpenAI Notebook