-
Notifications
You must be signed in to change notification settings - Fork 185
custom agent poc #92
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?
custom agent poc #92
Conversation
model_factory_func, | ||
) | ||
active_agents.update(basic_agents) | ||
|
||
# Create parallel agents | ||
if AgentType.PARALLEL.value in [agents_dict[name]["type"] for name in group]: | ||
parallel_agents = await create_agents_by_type( |
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.
Add a fallback or raise a custom error for unsupported agent types
else:
raise ValueError(f"Unsupported agent type: {agent_type}")
This seems a nice feature. It will allow customizing the behavior of an agent. @wreed4 any plan to finish the PR? |
@ehsanhaq I'm not sure I understand the codebase well enough to know if this approach is the right one. There are a few obvious gaps in this approach. I threw this up as an idea and to get some feedback from @evalstate. If folks feel like this is on the right track, I might be able to make it a bit more real. Otherwise, I mostly threw it up to start a conversation. If someone with more familiarity with this codebase could take a look and give some feedback, that'd be super useful. |
sorry, this is a bit odd as i'm sure there'd already been a discussion on this one (maybe someone raised it on the discord and i was absent minded in posting here). anyway, i think this makes sense and is a neat way of approaching it. the hope always was that people would be able to create custom Agents beyond the standard workflow ones. there's a couple of related discussions here (not dependent - but things in this area to consider)
so sorry for the late reply on the PR, but this idea lgtm -- and this looks reasonably complete as is? |
The only obvious thing I thought might be missing and I didn't take the time to think out is custom arguments to the decorator. I imagine if folks want a custom agent they'll probably want custom fields in the constructor.. But we could merge as is and solve some use-cases and extend it later if you want. I'll mark it as ready for review and if there's any changes you'd like let me know. |
Simple POC of custom agents.
This is obviously not a complete solution, but wanted to push it for conversational purposes. The setup copies BaseAgent exactly, so this is really only sufficient for overriding methods in the BaseAgent (which is my current use-case). A generic solution would need to allow handling custom arguments in a way that I don't think this does.