How can I get embeddings from strings of text in Google Colab? Is the documentation outdated?

Hello! I am trying to get the embeddings for strings of text in the GPT API. For some reason when I use the code in the documentation to do it, I get error messages telling me that this code is outdated and I must migrate my account. I believe this is because I’m doing something wrong as I am completely new to all of this. How Can I set up the updated code that will give me the embeddings? Thank you!