Assistant API with 2 csv files: how to manage "the output is too large"?

Hi there!

First of all, I’m pretty new in the LLMs territory, so forget me if the question is dumb.

We’re trying to achieve the comparison of two .csv files, attached in one assistant, using gpt-4-turbo-preview as a model, and the code_interpreter as a tool.
One csv is 66kb, the other 26kb, each has less than 80 rows, and they have a similar structure, explained in the assistant’s instructions to better guide the comparison.

Trying to refine these instructions, I keep having this kind of answers from the Assistant:

The output is too large, and the structure of both surveys is complex, with numerous columns and questions. […]
However, due to the complexity and length of the survey data, […]
the output is truncated

I thought it was the output token limitation issue, but when I check the “tokens” indication in the playground, I never exceed 4096 tokens for the output (same for the input, never exceeding 128k).

Screenshot 2024-01-26 at 11.21.17 AM

So here are my questions:

  • how can we explain this truncation? Is it a token limitation issue and context management and if so, do I wrongly interpret the “tokens” numbers in the playground?
  • how can we bypass this issue? Should we use the pre-existing ChatCompletion API so our team handles the context size itself?

If you have any kind of advices, or experienced similar situations, you are more than welcome :slight_smile:

Thanks a lot for your time and help!