Closed echoopen closed 1 year ago
Don't be sorry! It looks like the documents you embedded and persisted in your pinecone miss an attribute. If you use the pdf-qa example does it work? (it is the same as the pinecone example but it also creates the vectors from the uploaded pdf)
The pdf example works, but the pdf example has this code: docs = text_splitter.splitdocuments (documents) for i, doc in enumerate(docs). doc.metadata["source"] = f "source{i}" return docs
But I use DirectoryLoader to load the txt text into docs, after using the above code, still report this error, if it is convenient, convenient to give me a simple DirectoryLoader will be stored in the vector Pinecone example? Mine is docsearch = Pinecone.from_texts(split_docs, embeddings, index_name=index_name)
I found this example showing how to useDirectoryLoader
with sources.
I'm very sorry, but I'm having this problem with the pinecone example: "Document prompt requires documents to have metadata variables: ['source']. Received document with missing metadata: ['source']."