Assistants API retrieving files partially - Playground working fine

I have created several assistant, each of them containing from 3 to 20 PDF files.
When I run requests through the assistant playground asking to extract data, it does consider all the files in the assistant to produce the answer - works every time

However, when I access it via code with the APIs, it usually limit the search to only the first 2 or 3 files - does not find the info and gives me answers like : “Considering this result, it might be necessary to explore other documents for the specific fee structure and pricing brackets you requested, as this document does not include the required details” or I will proceed with examining the remaining documents to search for the specific information requested.

I tried different prompts including specifically asking to review ALL documents or even listing the documents by their names in the prompt. No better success.

The only case in which it works with API all the times is by mentioning the EXACT name of the document that contain this information. But that does not work in my use case, I typically don’t have this info and I need the API to search all documents

Any idea what I could have done wrong or how to address this ?

Thank you

1 Like