From the course: Hands-On OpenAI API: Building a Real-World Solution
Unlock the full course today
Join today to access over 24,900 courses taught by industry experts.
Installing the required library and preparing the code - OpenAI API Tutorial
From the course: Hands-On OpenAI API: Building a Real-World Solution
Installing the required library and preparing the code
- [Instructor] In this chapter, we're going to focus on the transcription side of things. So let's jump right in. I created this kinderlogger folder with the transcription.py file. This is a place that we are going to use for implementing the transcription logic. So the first thing that you want to do is you need to install the OpenAI Python library. You can do that by executing pip install and then openai. I've already done that, so there's no need for me to do this again. Okay, so let's close down this terminal. And now I'm ready to import the OpenAI library. I'm using the from statement then the OpenAI class, that's the one that we're going to use for connecting to the API. And we need a way to extract the OPENAI_API_KEY. So let's open up the terminal again and let me paste this command so you can see that I have my OPENAI_API_KEY as an environment variable. So that's why I am importing the os module. So let's extract that OPENAI_API_KEY environment variable, and then we need to…