__init__.py 765 B

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