-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix/re-implement the memory condenser #1771
Closed
Closed
Changes from 26 commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
565699e
[WIP] split recent events from core events; condense recent events
enyst b166ec3
WIP split core and recent events for monologue
enyst 14c7040
add test file
enyst bec4e97
adjust prompts for partial filling
enyst 8b81ce7
adjust prompts for partial filling
enyst 38ed4fa
fix test
enyst 1287a54
Merge branch 'memories-condense' of github.com:enyst/OpenDevin into m…
enyst a5e92a3
fix condenser to work with the prompt changes
enyst d182108
fix condenser
enyst cbb06c1
fix after changing stuff
enyst 39a5c9a
debug note, docstrings
enyst 68f1710
fix behavior, 3 attempts then fail
enyst a3cdbc5
fix calls
enyst cb78253
fix recent events, docs
enyst b7901ca
add to the summarize prompt that it should keep more detail about lat…
enyst 41ce6ee
Merge branch 'main' into memories-condense
enyst 58401f5
Merge branch 'main' into memories-condense
enyst 17fe93d
attempt to fix what summaries get made
enyst 2aa663e
Merge branch 'main' into memories-condense
enyst 2258515
fix integration tests, remove test
enyst 3b3b489
private method
enyst 314b05c
fix test after removing the generic generate function
enyst 58a8358
regenerate integration tests
enyst c1a9120
restore the integration tests
enyst 4c48858
Update agenthub/monologue_agent/agent.py
enyst 304aaac
clean up
enyst 2524a51
Merge branch 'main' of https://github.com/OpenDevin/OpenDevin into me…
enyst 87fd96d
remove background_obs from condense
enyst b8944a4
add a generic summarize prompt
enyst b808968
add pre-filled action prompt to monologue
enyst 46d40d5
update monologue, condenser
enyst ecc633c
wip logic
enyst File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm actually thinking if we can go through a lazy approach: Only involve the condenser if the
chat_completion
API throws a context window error (e.g., error message containscontext window
- then we cast the error into aContextWindowException
, then involve the condenser?).The issue with
litellm
tokenizer is that, they probably don't properly support OSS LLM, which might have different tokenizers and we only know we exceed the context window when we issued outchat_completion
requests and receive exception.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK! Litellm has a ContextWindowExceededError that it maps to quite many providers: https://litellm.vercel.app/docs/exception_mapping#custom-mapping-list . It includes hugging face and openai compatible providers, and it doesn't include ollama. What they mean by openai compatible providers appears to be a fairly large list of local LLMs, served via LMStudio or some software like that.
litellm uses hugging_face tokenizer or openai tokenizer. And wow, now that I'm looking to it again, just two weeks ago they added support for a custom hugging face tokenizer that the client code could pass over: BerriAI/litellm@2fd2e81
Totally agree anyway, I'm making this happen on error, or not use the tokenizer check by default.