Open licheng0794 opened 1 week ago
Hey there, @licheng0794! 👋 I'm here to help you with any bugs, questions, or contributions you have. I'm Dosu, a bot designed to assist you while you wait for a human maintainer.
Ensure that each document in your AstraDB collection includes a "content"
field. The error occurs because the code is trying to access item["content"]
, but this key is missing in the data.
To fix this, you can update your documents to include the "content"
field. Alternatively, modify the code to handle missing fields:
for item in data_dict:
content = item.get("content", "")
data.append(Data(content=content))
This change uses item.get("content", "")
to provide a default empty string if the "content"
field is absent, preventing the error [1].
To continue talking to Dosu, mention @dosu.
I did not write the code. How can I do it in the langflow or AstraDB interface?
In Langflow, ensure that your documents in AstraDB include a "content"
field. You can do this by:
Langflow UI: When adding documents, make sure each document has a "content"
field. This might involve adjusting the data before uploading it to AstraDB.
AstraDB Interface: If you have access to the AstraDB interface, you can update the documents directly to include the "content"
field. This might require using a script or a tool that allows you to modify the documents in your collection.
If you need to automate this, consider using a script to preprocess your data to ensure the "content"
field is present before uploading it to AstraDB.
To continue talking to Dosu, mention @dosu.
@licheng0794
Are you using version 1.0.18?
In the Get Started section, there's an example of the Vector Store RAG. First, you can insert the content in this flow:
Then, in the upper flow, you include the same information you put in the AstraDB component to locate your uploaded file.
@carlosrcoelho I am using the langflow in datastax.
@jordanrfrazier @carlosrcoelho This might be linked to the issue.
I created a collection with a pdf in AstraDB. I used it to create a RAG_LLM (using Vector Store RAG).
I always got the error 'Error building Component Astra DB: Error performing search in AstraDBVectorStore: 'content''
some ideas?