Find answers from the community

Updated 2 years ago

Logan M 8260 are there an examples that

At a glance

The community member asked for examples using the new API, and other community members provided helpful information. They discussed a specific example on GitHub that demonstrates loading documents and creating an index with the new API. The main changes mentioned are the new ServiceContext object and the use of nodes as the main inputs to indexes. The community members also discussed adding metadata to documents and expressed interest in experimenting with the new API features, but noted that their jobs limit the time they can devote to it.

Useful resources
@Logan M are there an examples that use the new API?
L
b
9 comments
Lots! Anything specific you want to see?
thanks, I wanted to see a run through of loading docs and creating an index with the new api. Looks like this might be a good place to start

https://github.com/jerryjliu/llama_index/blob/main/examples/evaluation/TestNYC-Evaluation.ipynb
Yup, that's a good example!

The main difference is the new ServiceContext object that wraps the llm predictor, prompt helper, chunk_size_limit, and a few other things

Another major change is that nodes are the main inputs to indexes. You can still load from documents using the from_documents() function i.e. (index = GPTListIndex.from_documents(documents, service_context=service_context)
In the future, relationships between nodes can be exploited, which was a major motivation for the refactor
I see, thanks for the info! how about adding metadata?
Should be same as before!

Something like
document.extra_info = {"name": "val"}
I wish I could play with this stuff full time. Job gets in the way, haha ;0
Haha I know what you mean. So many things i want to experiment with too, so little time
Add a reply
Sign up and join the conversation on Discord