fix(agents): generate proper history blocks in agent#570
Merged
douglas-reid merged 1 commit intomainfrom Oct 3, 2023
Merged
Conversation
eob
approved these changes
Oct 3, 2023
| @@ -67,10 +72,8 @@ def build_chat_history_for_tool(self, context: AgentContext) -> List[Block]: | |||
| # this should happen BEFORE any agent/assistant messages related to tool selection | |||
| messages.append(context.chat_history.last_user_message) | |||
Contributor
There was a problem hiding this comment.
Am I right that this will result in the following message list:
- System Message
- Topic-Selected Ancient Messages In Order
- Last User Message
- Last Action
I feel like if I was the LLM, I would want to see at the very least the last K messages from the history, in order, and the topic-selected list shouldn't include any that were included in the Last K messages list.
Contributor
Author
There was a problem hiding this comment.
We have:
- System message
- Semantic match historical messages
- Context-window messages (user <--> assistant and currently assistant<-->tool)
- Last User message
- Scratchpad messages.
(2) and (3) should be de-duped and sorted by file index (which is a current placeholder for temporal order).
So, I think that we are meeting your notional LLM requirements.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
With the inflight changes for streaming, we unfortunately merged a commit that left message selection in a broken state. The existing testing was not enough to capture the issue. This PR attempts to restore proper message selection functionality.
Follow on PRs will be necessary to clean up and streamline the selection bits added in this PR.