Building our first interactive, augmented LLM application
It’s time to connect the dots and do something practical with all this knowledge. If we put all the previous code together, we can now build our first LlamaIndex application.
For this next step, make sure you’ve already taken care of the technical requirements mentioned at the beginning of the chapter. For the following code example, we’ll need the Wikipedia package to be able to parse a certain Wikipedia article and extract our sample data from there.
Once the Wikipedia package has been successfully installed, the sample app should run without issues. Here is the code:
from llama_index.core import Document, SummaryIndex from llama_index.core.node_parser import SimpleNodeParser from llama_index.readers.wikipedia import WikipediaReader loader = WikipediaReader() documents = loader.load_data(pages=["Messi Lionel"]) parser = SimpleNodeParser.from_defaults() nodes = parser.get_nodes_from_documents...