generateContextOverflowMessage

fun generateContextOverflowMessage(contextApproxSize: Int, overflowCoef: Double = 2.0): String

Util function for investigating the behaviour of the system on model context overflow. It is very approximate and should be used mainly for preliminary experiments.

With contextApproxSize = 500_000 and overflowCoef = 2.0 it generates a message of approx size:

  • ~1.5M tokens for OpenAI GPT models

  • ~1.5M tokens for Gemini models

  • ~2M tokens for Claude models