Repository navigation
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
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"}), | ||
|
Member
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
Member
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.
Member
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
Member
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?
Member
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
Member
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. Could we try to use a profile here? What would it imply? |
||
| **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.