hands-on lab

Introduction to the OpenAI Chat Completions API

Difficulty: Beginner
Duration: Up to 30 minutes
Students: 383
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

Large language model (LLM) artificial intelligence (AI) has been used to produce human-like conversations with users through applications like OpenAI's ChatGPT. This lab introduces you to the OpenAI chat completion API and demonstrates how to use it to programmatically generate conversational responses. See what it takes to include generative AI in your applications and how to use it to create engaging user experiences.

You will use the official OpenAI Python client library to interact with the chat completion API in a Jupyter notebook. By iterating on a prompt, you will understand how to improve response quality and accuracy in the context of a conversation.

Learning objectives

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

  • Describe the OpenAI chat completion API
  • Explain the different roles available in the conversation
  • Discuss different models and parameters available to tailor the performance of the API

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

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