spring-ai icon indicating copy to clipboard operation
spring-ai copied to clipboard

LastMaxTokenSizeContentPurger Logic backwards

Open jasonparallel opened this issue 6 months ago • 0 comments
trafficstars

I don't see any document references to it and there are no tests so I'm not 100% but looking at LastMaxTokenSizeContentPurger it appears to return all content that will not fit vs the content that does fit

Shouldn't L61 be newList.addAll(datum.subList(0, index)); ? https://github.com/spring-projects/spring-ai/blob/ff52859b2d56029dce8f18d47b4fecb9cc8720c4/spring-ai-client-chat/src/main/java/org/springframework/ai/chat/client/advisor/LastMaxTokenSizeContentPurger.java#L61C24-L61C31

jasonparallel avatar Apr 25 '25 17:04 jasonparallel