Find answers from the community

Updated last month

LlamaIndex Update Causes ServiceContext Deprecation

At a glance

The community member is facing an issue after updating the LLamaIndex libraries, where the ServiceContext is deprecated and they need to use llama_index.settings.Settings instead. They are unsure how to pass the chunk_size parameter, which they previously used in the ServiceContext.

In the comments, another community member provides a solution by using the SentenceSplitter transformation with a chunk_size of 512 when creating the VectorStoreIndex.

Hi guys,
after updating all the LLamaIndex libs I faced this problem: "ServiceContext is deprecated. Use llama_index.settings.Settings" after checking the documentation, my impression is that I can pass the parameter that I used in the sevicecontext, right into, say, VectorStoreIndex. I didn't find the chunk_size parameter, though. How can I pass it there? Thanks!
```
L
Z
2 comments
Plain Text
from llama_index.core.node_parser import SentenceSplitter

splitter = SentenceSplitter(chunk_size=512)

index = VectorStoreIndex.from_documents(..., transformations=[splitter])
Thank you!
Add a reply
Sign up and join the conversation on Discord