History processor replaces message history #2324
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR closes #2095
Summary
history_processor
's now replaces the message history with its result.Concerns
The new behavior also processes/replaces the current
ModelRequest
being sent to the LLM. This may lead to unexpected behaviors for users of the library, for example, the followinghistory_processor
must prepend themessages[-1:]
in order to not remove the model request being sent.Although this may be unexpected, changing it to keep the last model request as is may also be a surprise for users. This was in conflict with exiting tests and I though it would be better to keep in this way and let the library user handle this.
I've added a warning to the docs, but maybe I need to emphasize this more.
c.c: @Kludex