__init__.py 805 B

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