Im using pinecone assistant and I have more than 1400 files uploaded to it, when I try to run assistant.listFiles with a filter inside it returns 1400 files instead of the ones I’ve filtered, no type of filtering works, I’ve tried multiple
const pc = new Pinecone({apiKey: pineconeApiKey.value()});
const assistant = pc.Assistant(pineconeAssistantName.value());
const listed = await assistant.listFiles({
filter: {
metadata: {
sessionId: sessionId,
source: “extraContent”,
},
},
});
const listed = await assistant.listFiles({
filter: {
"$and": [
{"sessionId": {"$eq": sessionId}},
{"source": {"$eq": "extraContent"}},
],
},
});
const listed = await assistant.listFiles({
filter: {metadata: {$contains: {sessionId}}},
});
const listed = await assistant.listFiles({
filter: {source: "laksjdf"},
});
const listed = await assistant.listFiles({
filter: {source: {$in: ["asdfasdfasdf"]}},
});
const listed = await assistant.listFiles({
filter: {source: {$eq: "asldkjf"}},
});
const listed = await assistant.listFiles({
filter: {sessionId: sessionId},
});
None of these work and multiple others I’ve tried
The only thing the docs shows is this, but on the listFiles filter must be an object:
PINECONE_API_KEY="YOUR_API_KEY"ASSISTANT_NAME="example-assistant"ENCODED_METADATA="%7B%22document_type%22%3A%20%22manuscript%22%7D" # URL encoded metadata - See ``w3schools.com/tags/ref_urlencode.ASPcurl`` -X GET "https://prod-1-data.ke.pinecone.io/assistant/files/$ASSISTANT_NAME?filter=$ENCODED_METADATA" \ -H "Api-Key: $PINECONE_API_KEY"
Also, the metadata of the files is correct I believe:
“Metadata over here {\“hash\”:\“016cfe2bd9d034e1c47141be2982641b8d72a8cca515299165e48fe6c4d15e75\”,\“sessionId\”:\“3a45b0d2acff706155650bfd288a-proposal\”,\“source\”:\“extraContent\”,\“type\”:\“simulationResult\”}” }