main.py 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. # This is a main script that tests the functionality of specific agents.
  2. # It requires no user input.
  3. from aios.utils.utils import (
  4. parse_global_args,
  5. )
  6. import os
  7. import warnings
  8. from aios.hooks.llm import aios_starter
  9. from aios.utils.utils import delete_directories
  10. from dotenv import load_dotenv
  11. def clean_cache(root_directory):
  12. targets = {
  13. ".ipynb_checkpoints",
  14. "__pycache__",
  15. ".pytest_cache",
  16. "context_restoration",
  17. }
  18. delete_directories(root_directory, targets)
  19. def main():
  20. # parse arguments and set configuration for this run accordingly
  21. main_id = os.getpid()
  22. print(f"Main ID is: {main_id}")
  23. warnings.filterwarnings("ignore")
  24. parser = parse_global_args()
  25. args = parser.parse_args()
  26. load_dotenv()
  27. with aios_starter(**vars(args)) as (submit_agent, await_agent_execution):
  28. # register your agents and submit agent tasks
  29. agent_tasks = [
  30. ["example/academic_agent", "Tell me what is the prollm paper mainly about"],
  31. # [
  32. # "example/cocktail_mixlogist",
  33. # "Create a cocktail for a summer garden party. Guests enjoy refreshing, citrusy flavors. Available ingredients include vodka, gin, lime, lemon, mint, and various fruit juices.",
  34. # ],
  35. # [
  36. # "example/festival_card_designer",
  37. # "Design a festival card for a vintage-themed music festival targeting young adults, with a square card size.",
  38. # ],
  39. # [
  40. # "example/logo_creator",
  41. # "Design a minimalist logo for a tech startup specializing in AI-powered cybersecurity solutions.",
  42. # ],
  43. # [
  44. # "example/story_teller",
  45. # "Create a dystopian short story featuring a protagonist with a unique biological adaptation, exploring themes of societal oppression and rebellion.",
  46. # ],
  47. # [
  48. # "example/interior_decorator",
  49. # "I want to transform my small, dark living room into a bright and airy space. I love minimalist Scandinavian design and prefer neutral colors. Can you help me?",
  50. # ],
  51. # ["example/math_agent", "Solve the equation: 2^(3x-1) = 5^(x+2)."],
  52. # [
  53. # "example/cook_therapist",
  54. # "Develop a low-carb, keto-friendly dinner that is flavorful and satisfying.",
  55. # ],
  56. # ["example/meme_creator", "Create a meme about the struggles of adulting."],
  57. # [
  58. # "example/fitness_trainer",
  59. # "Create a workout plan for a busy professional aiming to lose 10 pounds in 3 months.",
  60. # ],
  61. # [
  62. # "example/music_composer",
  63. # "Compose a dreamy indie-pop song with a catchy chorus.",
  64. # ],
  65. # [
  66. # "example/creation_agent",
  67. # "Create an Instagram post: Image of a person using a new tech gadget, text highlighting its key features and benefits.",
  68. # ],
  69. ]
  70. agent_ids = []
  71. for agent_name, task_input in agent_tasks:
  72. agent_id = submit_agent(agent_name=agent_name, task_input=task_input)
  73. agent_ids.append(agent_id)
  74. for agent_id in agent_ids:
  75. await_agent_execution(agent_id)
  76. clean_cache(root_directory="./")
  77. if __name__ == "__main__":
  78. main()