Drops complete historical API rounds until the estimated request releases the provider-reported token gap. Without an actual/limit pair, targets a 20% reduction. The newest round and pending turn are always retained.
Arguments
- chat
An
ellmer::Chatobject.- drop_turns
Deprecated compatibility argument; raw turns are never dropped independently.
- error_msg
Character or NULL. Provider PTL message.
- pending_turn
Optional pending turn, retained outside persisted history.