I will reply by email, but I will also post here for others that may have the same problem
Essentially you do your semantic search to find relevant pieces of text (I think you probably have that working now). One you have the text, you ask GPT a question using the text you found as a context
If your embeddings are small enough, you can include more than one context (which is what I will show you in the example below). But if your embeddings are 1 or 2 thousands tokens, you probably need to only use one, so the AI has enough tokens left to respond
Here is a sample prompt:
You are a reporter for the New York Times and are writing an article for the business column. Refer to the context below to answer the prompt that follows the context. If the answer is not in the context say “Unknown”.
“”"
this is my first lot of text found in the semantic search
here is the next context (if I have more than one)
“”"
put your question here
The whole thing is the prompt. The first bit gives it a personality. The second bit tells it to look at the context (The bit inside the area marked with the 3 quote marks at the top and bottom) and to answer the prompt (the bit after the last 3 quote mark).
I also tell it to say the word unknown if the answer is not in the context. This stops it from using general GPT knowledge and making things up.
The full stops, newlines and quotes are all important. There is also a new line character at the very end - after the question itself (very important in case you don’t ask a question with a full stop or a question mark at the end)
If you end up copying this prompt, make sure you change the quote characters to the straight version. This forum sometimes changes them to a curly quote.
Note : If your semantic search doesn’t find any related records, or the score is too low, I normally use the text “No content found” as the actual context text. (I hope that makes sense)