🐫 CAMEL: The first and the best multi-agent framework. Finding the Scaling Law of Agents. https://www.camel-ai.org
Python agentai-societiesartificial-intelligencecommunicative-aicooperative-aideep-learninglarge-language-modelsmulti-agent-systemsnatural-language-processing
Add single agent for role prompts (#14)
Guohao Lid7f3cd36910e
diff --git a/data/assistant_roles.txt b/data/assistant_roles.txtindex f3c72cae6..a03be3fa4 100644--- a/data/assistant_roles.txt+++ b/data/assistant_roles.txt@@ -1,150 +1,50 @@-Accountant-Acrobat-Actor-Advertising executive-Agriculturist-Animal trainer-Animator-Archaeologist-Architect-Baker-Barista-Bartender-Biologist-Business analyst-Cartoonist-Chef-Chemist-Chess player-Clown-Comedian-Composer-Computer scientist-Conservationist-Content creator-Copywriter-Counselor-Crossword puzzle maker-Customer service representative-Cybersecurity specialist-Data analyst-Data scientist-Database administrator-Dentist-Director-DJ-Documentary filmmaker-Ecologist-Economist-Editor-Engineer-Environmentalist-Escape artist-Ethical hacker-Event planner-Fashion designer-Figure skater-Film critic-Financial analyst-Fine artist-Fitness coach-Food critic-Fundraiser-Game developer-Gamer-Geologist-Graphic designer-Gymnast-Hair stylist-Historian-Horticulturist-HR manager-Illusionist-Illustrator-Interior designer-Interpreter-Investment banker-IT support specialist-Journalist-Juggler-Landscape architect-Lawyer-Magician-Makeup artist-Market researcher-Marketing strategist-Mathematician-Medical biller-Medical coder-Mentalist-Meteorologist-Mime-Mobile app developer-Music producer-Musician-Network engineer-News anchor-News correspondent-Nonprofit manager-Nurse-Orthodontist-Paralegal-Personal assistant-Personal trainer-Philanthropist-Photographer-Physical therapist-Physician assistant-Physicist-Podcast host-Political scientist-Producer-Project coordinator-Project manager-Proofreader-Psychiatrist-Psychologist-Public relations specialist-Puppeteer-Radio host-Radio producer-Recruiter-Researcher-Roller skater-Sales representative-Screenwriter-Scuba diver-Skydiver-Snowboarder-Social media manager-Social worker-Sociologist-Software developer-Sound engineer-Sports analyst-Sports journalist-Statistician-Stylist-Surfer-Systems administrator-Tax advisor-Teacher-Technical support specialist-Tour guide-Trainer-Translator-Travel agent-Tutor-TV presenter-TV producer-Twitch streamer-Urban planner-Veterinarian-Videographer-Voice actor-Waiter or Waitress-Web developer-Wedding planner-Writer-YouTuber-Zookeeper\ No newline at end of file+1. Accountant+2. Actor+3. Administrator+4. Analyst+5. Artist+6. Athlete+7. Author+8. Chef+9. Coach+10. Consultant+11. Counselor+12. Designer+13. Developer+14. Doctor+15. Editor+16. Engineer+17. Entrepreneur+18. Event Planner+19. Financial Advisor+20. Fitness Trainer+21. Graphic Designer+22. Human Resources Manager+23. Interpreter+24. Journalist+25. Lawyer+26. Marketer+27. Musician+28. Nutritionist+29. Personal Assistant+30. Photographer+31. Physical Therapist+32. Programmer+33. Project Manager+34. Psychologist+35. Public Relations Specialist+36. Real Estate Agent+37. Researcher+38. Sales Representative+39. Scientist+40. Social Media Manager+41. Software Developer+42. Teacher+43. Technical Writer+44. Translator+45. Travel Agent+46. Video Editor+47. Virtual Assistant+48. Web Developer+49. Writer+50. Zoologist\ No newline at end of filediff --git a/data/user_roles.txt b/data/user_roles.txtindex 5c31b37ee..2ad6f9274 100644--- a/data/user_roles.txt+++ b/data/user_roles.txt@@ -1,200 +1,50 @@-Academic researcher-Accountant-Activist-Actor-Administrator-Animal rights activist-Animator-Anime fan-App developer-Architect-Artist-Astronomer-Astrophysicist-Athlete-Audiobook listener-Augmented reality enthusiast-Baker-Barber-Bargain hunter-Beauty enthusiast-Biologist-Blogger-Bookkeeper-Bricklayer-Car enthusiast-Carpenter-Chef-Chemist-Civil engineer-Cleaner-Coach-Collector-Comic book fan-Computer programmer-Construction worker-Consultant-Cook-Counselor-Couponer-Cryptocurrency investor-Cryptocurrency trader-Cultural enthusiast-Customer service representative-Dancer-Dentist-Designer-Detective-Disability rights advocate-DIY enthusiast-DIY home decorator-Doctor-E-book reader-Economist-Electrician-Engineer-Entrepreneur-Environmental activist-Environmentalist-Expat-Farmer-Fashion designer-Fashionista-Film critic-Financial analyst-Firefighter-Fitness coach-Fitness enthusiast-Fitness tracker user-Florist-Foodie-Freelancer-Frugal shopper-Game designer-Gamer-Gardener-Gene editing enthusiast-Genealogist-Graphic designer-Hairdresser-Health care worker-Historian-History buff-Home automation user-Housekeeper-Human resources specialist-Human rights activist-Illustrator-Immigrant-Information technology specialist-Insurance agent-Interior designer-Investor-Job seeker-Journalist-Judge-Knitting enthusiast-Language learner-Lawyer-LGBTQ+ activist-Librarian-Life coach-Lifeguard-Luxury shopper-Makeup artist-Manager-Marketer-Marketing specialist-Mechanic-Medical assistant-Meditation practitioner-Mental health advocate-Mental health blogger-Military personnel-Minimalist-Motorcycle racer-Motorcyclist-Movie buff-Musician-News junkie-Nonprofit worker-Nurse-Nutritionist-Occupational therapist-Off-road vehicle enthusiast-Office assistant-Optometrist-Outdoor adventurer-Painter-Paleontologist-Paramedic-Parent-Pet owner-Pharmacist-Philanthropist-Photographer-Physical therapist-Physician assistant-Pilot-Plumber-Podcaster-Police officer-Politician-Postal worker-Producer-Professor-Programmer-Psychologist-Quilting enthusiast-Reader-Real estate agent-Receptionist-Refugee-Religious follower-Reporter-Researcher-Sales representative-Salesperson-Scientist-Secondhand shopper-Security guard-Singer-Skier-Smart home device owner-Smartphone addict-Snowboarder-Social justice advocate-Social media influencer-Social media manager-Social worker-Software developer-Sound engineer-Space enthusiast-Speech therapist-Spiritual seeker-Sports fan-Stand-up comedian-Stock trader-Student-Surgeon-Surveyor-Tailor-Teacher-Technician-Technology enthusiast-Therapist-Tourist-Translator-Travel agent-Traveler-Truck driver-TV series binge-watcher-Veterinarian-Video editor-Vintage enthusiast-Virtual reality enthusiast-Vlogger-Web developer-Writer-Yoga enthusiast-Zoologist\ No newline at end of file+1. Accountant+2. Actor+3. Artist+4. Athlete+5. Blogger+6. Chef+7. Coach+8. Consultant+9. Designer+10. Developer+11. Doctor+12. Engineer+13. Entrepreneur+14. Farmer+15. Fashion designer+16. Filmmaker+17. Gamer+18. Graphic designer+19. Homemaker+20. Influencer+21. Journalist+22. Lawyer+23. Musician+24. Nurse+25. Nutritionist+26. Photographer+27. Pilot+28. Politician+29. Professor+30. Programmer+31. Real estate agent+32. Salesperson+33. Scientist+34. Social media manager+35. Software engineer+36. Student+37. Teacher+38. Technician+39. Travel agent+40. Translator+41. Truck driver+42. Tutor+43. Veterinarian+44. Video editor+45. Virtual assistant+46. Web developer+47. Writer+48. Yoga instructor+49. YouTuber+50. Zoologist\ No newline at end of filediff --git a/examples/single_agent.py b/examples/single_agent.pynew file mode 100644index 000000000..0e3b489f9--- /dev/null+++ b/examples/single_agent.py@@ -0,0 +1,21 @@+from camel.agent import ChatAgent+from camel.message import AssistantSystemMessage, UserChatMessage+from camel.typing import ModeType+++def main(role_type: str = "user", num_roles: int = 50):+ with open(f"prompts/generate_{role_type}.txt", "r") as f:+ prompt = f.read().replace("<NUM_ROLES>", str(num_roles))+ print(prompt)+ assistant_sys_msg = AssistantSystemMessage(+ "Assistant", content="You are a helpful assistant.")+ agent = ChatAgent(assistant_sys_msg, model=ModeType.GPT_3_5_TURBO)+ agent.reset()++ user_msg = UserChatMessage("User", content=prompt)+ assistant_msg, _, _ = agent.step(user_msg)+ print(assistant_msg[0].content)+++if __name__ == "__main__":+ main()diff --git a/prompts/generate_assistant.txt b/prompts/generate_assistant.txtindex ea56964e1..4f86f1eaf 100644--- a/prompts/generate_assistant.txt+++ b/prompts/generate_assistant.txt@@ -1 +1,3 @@-You are a helpful assistant that can play many different roles. Now please list 150 different roles that you can play with your expertise in diverse fields. No explanation.\ No newline at end of file+You are a helpful assistant that can play many different roles.+Now please list <NUM_ROLES> different roles that you can play with your expertise in diverse fields.+Sort them by alphabetical order. No explanation required.\ No newline at end of filediff --git a/prompts/generate_user.txt b/prompts/generate_user.txtindex fee1a7503..dee27fe4a 100644--- a/prompts/generate_user.txt+++ b/prompts/generate_user.txt@@ -1,2 +1,3 @@-List of 100 common and diverse groups of internet users. Use singular form. No explanation.-List of 100 common and diverse occupations. Use singular form. No explanation.\ No newline at end of file+Please list <NUM_ROLES> most common and diverse groups of internet users or occupations.+Use singular form. No explanation.+Sort them by alphabetical order. No explanation required.\ No newline at end of file