How does the line client=OpenAI() apparently run without an api key in the video?
Answering to your question, my view is the following is the following.
Please have a look at the related Jupyter Notebook (LessonL1_Student) of Building an Agent from Scratch.
As it can be seen from the screenshot (see section marked in yellow) the api key is set up in the line before line client=OpenAI()
With other words, this does mean that an OPEN_API_KEY has been set up in an .env.txt file such as:
OPENAI_API_KEY=“your OPENAI_API_KEY here”
This file has not been enclosed in the original directory files- mainly becasue the api key should be secret! - but however I think this is useful to know in the case you would like to run the Notebook locally.
1 Like