We use six Paul Graham essays about startup founders taken from his blog. With these we build a RAG system that uses the simplest LlamaIndex default model.
from llama_index import VectorStoreIndex, SimpleDirectoryReaderdocuments =SimpleDirectoryReader("./paul_graham_essays").load_data()index = VectorStoreIndex.from_documents(documents)query_engine = index.as_query_engine()# Gets the response from llama indexdefget_llama_response(prompt): response = query_engine.query(prompt) context = [x.text for x in response.source_nodes]return{"llm_answer": response.response,"llm_context_list": context}
We load the question and answer list and use it to create a Tonic Validate benchmark.