Which is the best way to generate passage using given words?

I’m developing a simple GPT app.
One of the requirements of the app is to provide a list of words and have GPT generate the output using those words.

The list of words is too vast to include in the prompt, and the list is user-selectable.

I thought the way to do this was to embed the list of words via VectorDB, but I don’t know if storing the list of words in VectorDB and searching it would give the intended result.

I would like to know what would be the best way to accomplish this requirement.


Hi and welcome to the Developer Forum!

Another user asked this exact question yesterday, if your list of words is very large then I do not see a practical way of achieving this, fine tuning will make the model use specific words but will not block others, embeddings are a way to look up semantically similar information and a list of words typically has no semantic meaning.

So I don’t see a way to do this, perhaps others may have a solution.