Retrieval augmented generation using Elasticsearch and OpenAI - Part 14
Encode a question with OpenAI embedding model
To perform kNN search, we need to encode queries with the same embedding model used to encode the documents at index time. In this example, we need to use the text-embedding-ada-002 model.