Find answers from the community

Updated 6 months ago

fixed llama_index.core but

At a glance

The community member is working on a deep learning AI course and is having issues with the imports from the llama_index library. The community members in the comments suggest that the API has been updated, and the imports need to be updated accordingly. They provide the updated imports and mention that the ServiceContext has been deprecated, and the node_parser module has been moved to llama_index.core.node_parser. One community member also provides a link to the migration details for the latest version of the library.

Useful resources
I am working on deep learning ai course. Can anyone help me fix these imports? I think the API is updated now?

Plain Text
from llama_index import ServiceContext, VectorStoreIndex, StorageContext
from llama_index.node_parser import SentenceWindowNodeParser
from llama_index.indices.postprocessor import MetadataReplacementPostProcessor
from llama_index.indices.postprocessor import SentenceTransformerRerank
from llama_index import load_index_from_storage
A
T
4 comments
ModuleNotFoundError: No module named 'llama_index.node_parser'
Are you on the latest version? ServiceContext has been deprecated.

Node parser now would be
Plain Text
from llama_index.core.node_parser


Other ones:
Plain Text
from llama_index.core import VectorStoreIndex, StorageContext, load_index_from_storage



etc. etc.

Here's the migration details: https://docs.llamaindex.ai/en/stable/getting_started/v0_10_0_migration/
I think it's fixed now

Plain Text
from llama_index.core.node_parser import HierarchicalNodeParser

from llama_index.core.node_parser import get_leaf_nodes
from llama_index.core import StorageContext
from llama_index.core.retrievers import AutoMergingRetriever
from llama_index.core.postprocessor import SentenceTransformerRerank
from llama_index.core.query_engine import RetrieverQueryEngine
I changed all from API @Teemu
Add a reply
Sign up and join the conversation on Discord