I want to throw a custom error message if the query asked does not contain the relevant information, im using typescript package of LlamaIndex Here is my code
const index = await VectorStoreIndex.fromVectorStore(astraVS, ctx);
const dynamicPrompt = createPrompt(query, LlamaContext);
const retriever = await index.asRetriever({ similarityTopK: 3 });
const queryEngine = await index.asQueryEngine({ retriever });
const result = await queryEngine.query({
query: dynamicPrompt,
});
You probably need to either preprocess the query with an LLM call, or modify the prompt template so that the LLM responds appropriately in the query engine