Attach a file without chunking/embedding to either assistants or completions API

Hey people,

my task is to parse a large (>70 pages PDF) and query some specific sections.
Before gpt-4 was made available I did that manually parsing the pdf, analysing its structure and only giving the relevant sections as context to a query made via the completions API.
This process was not very robust but GPT-4s large context window allowed me to upload the entire pdf (Chat Interface) and ask my questions without loss of quality.
Therefore I want to mimic the same behaviour using the API, but the assistants API with file-search couldn’t help since the underlying chunking and embedding process resulted in loss of information.
I could add a (supposedly complete) file using client.file.create to an assistant thread and a vectorstore with irrelevant information and got kind of good results.
Since this workaround did not yield my required performance I am asking here if anyone has successfully added an entire file to query via the API. My optimal solution would be to add the file as a “head document” and do around twenty independent batched requests onto that file using the batch API.

Thank you for any help and ideas!
Best

1 Like

Were you able to solve this?

1 Like