How a vector representation is created for a document?

In the video “Using the LLM in applications” slide “Vector database search” minute 9:18. What is the best effective way to transform a sequence of token from a document to a single vector? should I average all the tokens in the document?

In another words, how the text 6 vector is created?

Thank you!!