from
https://docs.llamaindex.ai/en/stable/getting_started/starter_example.htmlfrom llama_index.core import VectorStoreIndex, SimpleDirectoryReader
documents = SimpleDirectoryReader("data").load_data()
index = VectorStoreIndex.from_documents(documents)
cannot import, so changed to
from llama_index.core.indices import VectorStoreIndex
from llama_index.core.readers import SimpleDirectoryReader
content_file ="myfile"
documents = SimpleDirectoryReader(content_file).load_data()
index = VectorStoreIndex.from_documents(documents)
got runtime error
----> 1 from llama_index.core.indices import VectorStoreIndex
...
......./llama_index/core/indices/composability/graph.py:5
1 """Composability graphs."""
3 from typing import Any, Dict, List, Optional, Sequence, Type, cast
...
----> 6 from llama_index.core.llms import ChatMessage, MessageRole
7 from llama_index.core.utils import get_tokenizer
10 class TokenCounter:
ImportError: cannot import name 'ChatMessage' from 'llama_index.core.llms' (unknown location)