Skip to content

Conversation

jhl221123
Copy link

Hi team,

This PR introduces unit tests for LastMaxTokenSizeContentPurger, following up on the discussion in issue #2894.

While working on the tests, I encountered a particular scenario regarding the totalSize parameter that I'd like to clarify. It seems that if totalSize is passed in with a value smaller than the actual sum of estimateTokenCount for the List<MediaContent> datum, the current logic might not perform the expected purging.

For example, if datum contains items with token counts (total 120), and purgeExcess() is called with totalSize (100) and maxTokenSize (100), the initial while loop condition (totalSize > this.maxTokenSize) would be false. Consequently, no items from datum would be purged, potentially leading to the final token count exceeding maxTokenSize.

Is this behavior intended, or is there something I might be overlooking regarding how totalSize is expected to be calculated and passed to this method?

Thanks!

Signed-off-by: Junhyeok Lee <jhl221123@naver.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants