Holds multiples Messages. There are no limit to the number of Messages that can be held. If the Messages exceed the context window,1 older messages are truncated.

Context Window

This class automatically manages it for you. It simplifies development complexity at the cost of no control of controlling the context window. The largest context window will be used, which impacts costs. Future work may find ways to provide the developer control over this, including an ability to summarize older information to reduce context length.2

Tip

If more control is required, use the Chat Completion API.

Footnotes

  1. The context window should include responses from the Assistant right?

  2. Though summarizing itself requires a call to the API, so there’s likely some tuning work required to decide whether it’s worthwhile to summarize earlier context