Replies: 1 comment 2 replies
-
🤖 Hi there, From your code, it seems like you're storing the user's data into Pinecone correctly. However, when LangChain retrieves documents from Pinecone, it expects each document to have a So, when you're creating your documents from your custom data, make sure to include a def embedding_db(user_id, content):
docs_split = doc_preprocessing(content)
# Extract text from the split documents
texts = [doc.page_content for doc in docs_split]
vectors = embeddings.embed_documents(texts)
# Store vectors with user_id and context as metadata
for i, vector in enumerate(vectors):
upsert_response = index.upsert(
vectors=[
{
'id': f"{user_id}",
'values': vector,
'metadata': {"user_id": str(user_id), "context": texts[i]}
}
]
) In this modified function, For more information, you can refer to the following sources in the LangChain repository:
I hope this helps! Let me know if you have any other questions. Sources
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I looked through lot of documentation but got confused on the retriever part.
So I am building a chatbot using user's custom data.
Now I am following below approach
This way it should create embeddings for the given data into pinecone.
Now the second part is to chat with this data. For QA, I have below
but I keep getting
Found document with no
textkey. Skipping.
When i am doing QA, its not referring to the data stored in pinecone. Its just using the normal chatgpt. I am not sure what i am missing here. any help would be helpful.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions