Using OpenAI API with GPT-4o to evaluate a 20k-token text, it only reads parts of it, causing incorrect evaluations; how can I make it read the entire text?

I’m using the OpenAI Api with model gpt-4o. The task is to evaluate a text (length: approximately 20k tokens) following my instructions (length: approximately 3k tokens).
Looking at the output it seems not to read and understand all the text, but it focuses only on some sentences it thinks to be interesting. Doing this, it gives an incorrect evaluation, I need it to read and understand all the text.
Is this reasoning right? If so, how can I force it to read all the text?

Are you using the Assistants API or the Chat Completions API?

From my understanding, if you just give a text file to the Assistants API, it won’t actually input the whole thing, but it’ll instead let the AI choose to search the file for relevant bits of information.

Chat completion API should, however, input the whole text, unless you’ve enabled a token limit.

hi! Thank you for the feedback! I’m actually using the chat completions API and i don’t think i have enabled a token limit.
From the usage data I see it considers all the text as input but giving answers it behaves as it “weights” words in differently. For example, I’d like it to evaluate the quantity and quality of references on SDGs in the text. However, it always gives the maximum evaluation: either in the case of constant references in every page or two or three references in the whole text…