Find answers from the community

s
F
Y
a
P
Updated 2 years ago

Logan M 8260 are there an examples that

@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