When using the Ragie TypeScript SDK:
await ragie.documents.list({
filter: `{"document_name":{"$eq":"resume.pdf"}}`,
});
The request is sent to:
https://api.ragie.ai/documents?filter=%7B%22document_name%22%3A%7B%22%24eq%22%3A%22resume.pdf%22%7D%7D
This returns an empty list even though the document exists.
The identical query works when calling the API directly with the correct parameter name:
https://api.ragie.ai/documents?filters={%22document_name%22:{%22$eq%22:%22resume.pdf%22}}
Here's the full code:
const documents = await ragie.documents.list({
filter: `{"document_name":{"$eq":"resume.pdf"}}`,
});
console.log("Method 1:", documents); // returns no docs
const url =
"https://api.ragie.ai/documents?" +
'filters={"document_name":{"$eq":"resume.pdf"}}';
const res = await fetch(url, options);
const json = await res.json();
console.log("Method 2:", json); // returns the correct docs
This could be happening with other function aswell, I haven't tested them
Problem
The SDK incorrectly uses the query parameter filter while the Ragie API only accepts filters.
Filtering therefore silently fails (no error, just empty results).
Expected behavior
The SDK should send filters=… (with an “s”) so filtering works.
When using the Ragie TypeScript SDK:
The request is sent to:
https://api.ragie.ai/documents?filter=%7B%22document_name%22%3A%7B%22%24eq%22%3A%22resume.pdf%22%7D%7D
This returns an empty list even though the document exists.
The identical query works when calling the API directly with the correct parameter name:
https://api.ragie.ai/documents?filters={%22document_name%22:{%22$eq%22:%22resume.pdf%22}}
Here's the full code:
This could be happening with other function aswell, I haven't tested them
Problem
The SDK incorrectly uses the query parameter filter while the Ragie API only accepts filters.
Filtering therefore silently fails (no error, just empty results).
Expected behavior
The SDK should send filters=… (with an “s”) so filtering works.