__init__.py 837 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. SWE_agent,
  8. browsing_agent,
  9. codeact_agent,
  10. codeact_swe_agent,
  11. delegator_agent,
  12. dummy_agent,
  13. monologue_agent,
  14. planner_agent,
  15. )
  16. __all__ = [
  17. 'monologue_agent',
  18. 'codeact_agent',
  19. 'codeact_swe_agent',
  20. 'planner_agent',
  21. 'SWE_agent',
  22. 'delegator_agent',
  23. 'dummy_agent',
  24. 'browsing_agent',
  25. ]
  26. for agent in all_microagents.values():
  27. name = agent['name']
  28. prompt = agent['prompt']
  29. anon_class = type(
  30. name,
  31. (MicroAgent,),
  32. {
  33. 'prompt': prompt,
  34. 'agent_definition': agent,
  35. },
  36. )
  37. Agent.register(name, anon_class)