Find answers from the community

Home
Members
NetworkMario
N
NetworkMario
Offline, last seen 3 months ago
Joined September 25, 2024
hello guys, can you help me?

I have this error in my project: Error during search: 'VectorStoreIndex' object has no attribute 'document_ids'
Risultati della ricerca: []

my script:

def search(query):
session = Session()
try:
# Crea un indice VectorStore a partire dai documenti
index = VectorStoreIndex.from_documents(get_documents(query))

# Ottieni le descrizioni dai documenti
descriptions = []
for document_id in index.document_ids():
# Query per ottenere la descrizione dal database
result = session.query(Document.description).filter(Document.id == document_id).first()
if result:
descriptions.append(result[0])
else:
descriptions.append("")
I can't find anything in the docs
3 comments
N
W
Hello guys, I'm implementing llama-index inside my project.py. But I have this blessed error importing the "llama_index.vector_store_index" module... I installed llama correctly and when I launched the 'pip show llama-index' command the path seems correct. Has this ever happened to anyone? I can't find any answers anywhere on the web. Anyway, this is the error output: Traceback (most recent call last):
File "C:\Users\Mario Montella\PycharmProjects\MLSearch.venv\mainTest.py", line 2, in <module>
from llama_index.vector_store_index import VectorStoreIndex
ModuleNotFoundError: No module named 'llama_index.vector_store_index'
7 comments
N
W