__init__.py 783 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. from dotenv import load_dotenv
  2. from agenthub.micro.agent import MicroAgent
  3. from agenthub.micro.registry import all_microagents
  4. from openhands.controller.agent import Agent
  5. load_dotenv()
  6. from agenthub import ( # noqa: E402
  7. browsing_agent,
  8. codeact_agent,
  9. codeact_swe_agent,
  10. delegator_agent,
  11. dummy_agent,
  12. planner_agent,
  13. )
  14. __all__ = [
  15. 'codeact_agent',
  16. 'codeact_swe_agent',
  17. 'planner_agent',
  18. 'delegator_agent',
  19. 'dummy_agent',
  20. 'browsing_agent',
  21. ]
  22. for agent in all_microagents.values():
  23. name = agent['name']
  24. prompt = agent['prompt']
  25. anon_class = type(
  26. name,
  27. (MicroAgent,),
  28. {
  29. 'prompt': prompt,
  30. 'agent_definition': agent,
  31. },
  32. )
  33. Agent.register(name, anon_class)