-
Notifications
You must be signed in to change notification settings - Fork 180
feat(sdk/subagent): condenser for subagents #2349
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -245,10 +245,21 @@ def _factory(llm: "LLM") -> "Agent": | |
| ) | ||
| tools.append(Tool(name=tool_name)) | ||
|
|
||
| # Build condenser if configured | ||
| condenser = None | ||
| if agent_def.condenser: | ||
| from openhands.sdk.context.condenser import LLMSummarizingCondenser | ||
|
|
||
| condenser = LLMSummarizingCondenser( | ||
| llm=llm.model_copy(update={"usage_id": "condenser"}), | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I do worry a little bit that the more of these we do the more we'll have to sort out... what if we sent a profile name, or think about how this could be like to replace these LLMs with profiles references if that makes sense? Though the condenser is a pretty obvious place, maybe not exactly to worry much about
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah solution would be to save a condenser LLM profile that we use just for that and we go on the default one if there is no one.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes! That sounds great to me, or even, if possible, read the condenser profile at the start of the conversation, if none initialize one from the other
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. but I think this should be addressed in another PR, right?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't know, the more But I also see the opposite argument here. I'm just starting to feel we're adding too many, though I could be wrong |
||
| **agent_def.condenser, | ||
| ) | ||
|
|
||
| return Agent( | ||
| llm=llm, | ||
| tools=tools, | ||
| agent_context=agent_context, | ||
| condenser=condenser, | ||
| ) | ||
|
|
||
| return _factory | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.