🐫 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
Initial commit
lightaime7daf4a2b0fbf
diff --git a/.gitignore b/.gitignorenew file mode 100644index 000000000..22de2db1f--- /dev/null+++ b/.gitignore@@ -0,0 +1,135 @@+# Byte-compiled / optimized / DLL files+__pycache__/+*.py[cod]+*$py.class++# C extensions+*.so++# Distribution / packaging+.Python+build/+develop-eggs/+dist/+downloads/+eggs/+.eggs/+lib/+lib64/+parts/+sdist/+var/+wheels/+pip-wheel-metadata/+share/python-wheels/+*.egg-info/+.installed.cfg+*.egg+MANIFEST++# PyInstaller+# Usually these files are written by a python script from a template+# before PyInstaller builds the exe, so as to inject date/other infos into it.+*.manifest+*.spec++# Installer logs+pip-log.txt+pip-delete-this-directory.txt++# Unit test / coverage reports+htmlcov/+.tox/+.nox/+.coverage+.coverage.*+.cache+nosetests.xml+coverage.xml+*.cover+*.py,cover+.hypothesis/+.pytest_cache/++# Translations+*.mo+*.pot++# Django stuff:+*.log+local_settings.py+db.sqlite3+db.sqlite3-journal++# Flask stuff:+instance/+.webassets-cache++# Scrapy stuff:+.scrapy++# Sphinx documentation+docs/_build/++# PyBuilder+target/++# Jupyter Notebook+.ipynb_checkpoints++# IPython+profile_default/+ipython_config.py++# pyenv+.python-version++# pipenv+# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.+# However, in case of collaboration, if having platform-specific dependencies or dependencies+# having no cross-platform support, pipenv may install dependencies that don't work, or not+# install all needed dependencies.+#Pipfile.lock++# PEP 582; used by e.g. github.com/David-OConnor/pyflow+__pypackages__/++# Celery stuff+celerybeat-schedule+celerybeat.pid++# SageMath parsed files+*.sage.py++# Environments+.env+.venv+env/+venv/+ENV/+env.bak/+venv.bak/++# Spyder project settings+.spyderproject+.spyproject++# Rope project settings+.ropeproject++# mkdocs documentation+/site++# mypy+.mypy_cache/+.dmypy.json+dmypy.json++# Pyre type checker+.pyre/++.DS_Store+.idea++# Camel+logs/\ No newline at end of filediff --git a/camel/camel_typing.py b/camel/camel_typing.pynew file mode 100644index 000000000..085736eb0--- /dev/null+++ b/camel/camel_typing.py@@ -0,0 +1,113 @@+from dataclasses import dataclass+from enum import Enum+from typing import Dict, Optional, Union++OpenAISystemMessage = Dict[str, str]+OpenAIAssistantMessage = Dict[str, str]+OpenAIUserMessage = Dict[str, str]+OpenAIChatMessage = Union[OpenAIUserMessage, OpenAIAssistantMessage]+OpenAIMessage = Union[OpenAISystemMessage, OpenAIChatMessage]+++class RoleType(Enum):+ ASSISTANT = "assistant"+ USER = "user"+ DEFAULT = "default"+++class ModeType(Enum):+ GPT_3_5_TURBO = "gpt-3.5-turbo"+++@dataclass+class BaseMessage:+ role_name: str+ role_type: RoleType+ role: str+ content: str++ def to_openai_message(self, role: Optional[str] = None) -> OpenAIMessage:+ role = role or self.role+ assert role in ["system", "user", "assistant"]+ return {"role": role, "content": self.content}++ def to_openai_chat_message(+ self,+ role: Optional[str] = None,+ ) -> OpenAIChatMessage:+ role = role or self.role+ assert role in ["user", "assistant"]+ return {"role": role, "content": self.content}++ def to_openai_system_message(self) -> OpenAISystemMessage:+ return {"role": "system", "content": self.content}++ def to_openai_user_message(self) -> OpenAIUserMessage:+ return {"role": "user", "content": self.content}++ def to_openai_assistant_message(self) -> OpenAIAssistantMessage:+ return {"role": "assistant", "content": self.content}++ def to_dict(self) -> Dict:+ return {+ "role_type": self.role_type.name,+ "role_name": self.role_name,+ "role": self.role,+ "content": self.content,+ }+++@dataclass+class SystemMessage(BaseMessage):+ role_name: str+ role_type: RoleType+ role: str = "system"+ content: str = ""+++@dataclass+class AssistantSystemMessage(SystemMessage):+ role_name: str+ role_type: RoleType = RoleType.ASSISTANT+ role: str = "system"+ content: str = ""+++@dataclass+class UserSystemMessage(SystemMessage):+ role_name: str+ role_type: RoleType = RoleType.USER+ role: str = "system"+ content: str = ""+++@dataclass+class ChatMessage(BaseMessage):+ role_name: str+ role_type: RoleType+ role: str+ content: str = ""+++@dataclass+class AssistantChatMessage(ChatMessage):+ role_name: str+ role_type: RoleType = RoleType.ASSISTANT+ role: str = "assistant"+ content: str = ""+++@dataclass+class UserChatMessage(ChatMessage):+ role_name: str+ role_type: RoleType = RoleType.USER+ role: str = "user"+ content: str = ""+++MessageType = Union[BaseMessage, SystemMessage, AssistantSystemMessage,+ UserSystemMessage, ChatMessage, AssistantChatMessage,+ UserChatMessage]+SystemMessageType = Union[SystemMessage, AssistantSystemMessage,+ UserSystemMessage]+ChatMessageType = Union[ChatMessage, AssistantChatMessage, UserChatMessage]diff --git a/camel/camel_utils.py b/camel/camel_utils.pynew file mode 100644index 000000000..fa4dc7ecd--- /dev/null+++ b/camel/camel_utils.py@@ -0,0 +1,35 @@+from typing import List++import tiktoken+from camel_typing import ModeType, OpenAIMessage+++def num_tokens_from_messages(messages: List[OpenAIMessage], model: ModeType):+ """Returns the number of tokens used by a list of messages."""+ try:+ encoding = tiktoken.encoding_for_model(model.value)+ except KeyError:+ encoding = tiktoken.get_encoding("cl100k_base")+ if model == ModeType.GPT_3_5_TURBO:+ num_tokens = 0+ for message in messages:+ # message follows <im_start>{role/name}\n{content}<im_end>\n+ num_tokens += 4+ for key, value in message.items():+ num_tokens += len(encoding.encode(value))+ if key == "name": # if there's a name, the role is omitted+ num_tokens += -1 # role is always 1 token+ num_tokens += 2 # every reply is primed with <im_start>assistant+ return num_tokens+ else:+ raise NotImplementedError(+ f"`num_tokens_from_messages`` is not presently implemented "+ f"for model {model}. "+ f"See https://github.com/openai/openai-python/blob/main/chatml.md "+ f"for information on how messages are converted to tokens.")+++def get_model_token_limit(model: ModeType) -> int:+ """Returns the maximum number of tokens for a given model."""+ if model == ModeType.GPT_3_5_TURBO:+ return 4096\ No newline at end of filediff --git a/camel/chat_agent.py b/camel/chat_agent.pynew file mode 100644index 000000000..437a2de97--- /dev/null+++ b/camel/chat_agent.py@@ -0,0 +1,130 @@+from typing import Any, Dict, List, Optional, Tuple++import openai+from camel_typing import (MessageType, ModeType, RoleType, SystemMessage,+ ChatMessage)+from camel_utils import get_model_token_limit, num_tokens_from_messages+from configs import ChatGPTConfig+from tenacity import retry, stop_after_attempt+++class ChatAgent:+ def __init__(+ self,+ system_message: SystemMessage,+ model: ModeType,+ model_config: Any = None,+ ) -> None:+ self.system_message = system_message+ self.role_name = system_message.role_name+ self.role_type = system_message.role_type++ self.model = model+ self.model_config = model_config or ChatGPTConfig()+ self.model_token_limit = get_model_token_limit(self.model)++ self.terminated = False+ self.init_messages()++ def reset(self) -> None:+ self.terminated = False+ self.init_messages()+ return self.stored_messages++ def get_info(+ self,+ id: Optional[str],+ usage: Optional[Dict[str, int]],+ finish_reasons: List[str],+ num_tokens: int,+ ) -> Dict[str, Any]:+ return {+ "id": id,+ "usage": usage,+ "finish_reasons": finish_reasons,+ "num_tokens": num_tokens,+ }++ def init_messages(self) -> None:+ self.stored_messages: List[MessageType] = [self.system_message]++ def update_messages(self, message: ChatMessage) -> List[ChatMessage]:+ self.stored_messages.append(message)+ return self.stored_messages++ @retry(stop=stop_after_attempt(5))+ def step(+ self, input_message: ChatMessage+ ) -> Tuple[List[ChatMessage], bool, Dict[str, Any]]:+ messages = self.update_messages(input_message)+ openai_messages = [message.to_openai_message() for message in messages]+ num_tokens = num_tokens_from_messages(openai_messages, self.model)++ if num_tokens < self.model_token_limit:+ response = openai.ChatCompletion.create(+ model=self.model.value,+ messages=openai_messages,+ **self.model_config.__dict__,+ )+ output_messages = [+ ChatMessage(self.role_name, self.role_type,+ **dict(choice["message"]))+ for choice in response["choices"]+ ]+ info = self.get_info(+ response["id"],+ response["usage"],+ [+ str(choice["finish_reason"])+ for choice in response["choices"]+ ],+ num_tokens,+ )+ self.update_messages(output_messages[0])++ else:+ self.terminated = True+ output_messages = []++ info = self.get_info(+ None,+ None,+ ["max_tokens_exceeded"],+ num_tokens,+ )++ return output_messages, self.terminated, info++ def __repr__(self) -> str:+ return f"ChatAgent({self.role_name}, {self.role_type}, {self.model})"+++if __name__ == "__main__":+ from configs import SystemMessageGenerator+ chat_gpt_args = ChatGPTConfig()+ system_message = SystemMessageGenerator().from_role(+ "doctor", RoleType.ASSISTANT)+ assistant = ChatAgent(+ system_message,+ ModeType.GPT_3_5_TURBO,+ chat_gpt_args,+ )++ assert str(assistant) == (+ "ChatAgent(doctor, RoleType.ASSISTANT, ModeType.GPT_3_5_TURBO)")++ assistant.reset()+ messages, terminated, info = assistant.step(+ ChatMessage("patient", RoleType.USER, "user", "Hello!"))++ assert terminated is False+ assert messages != []+ print(info)++ assistant.reset()+ messages, terminated, info = assistant.step(+ ChatMessage("patient", RoleType.USER, "user", "Hello!" * 4096))++ assert terminated is True+ assert messages == []+ print(info)diff --git a/camel/configs.py b/camel/configs.pynew file mode 100644index 000000000..7ca570ed1--- /dev/null+++ b/camel/configs.py@@ -0,0 +1,139 @@+from dataclasses import dataclass, field+from typing import Dict, Generator, List, Optional, Sequence, Tuple, Union++from camel_typing import (AssistantSystemMessage, RoleType, SystemMessage,+ SystemMessageType, UserSystemMessage)+++@dataclass+class ChatGPTConfig:+ temperature: float = 0.2 # openai default: 1.0+ top_p: float = 1.0+ n: int = 1+ stream: bool = False+ stop: Optional[Union[str, Sequence[str]]] = None+ max_tokens: Optional[int] = None+ presence_penalty: float = 0.0+ frequency_penalty: float = 0.0+ logit_bias: Dict = field(default_factory=dict)+ user: str = ""+++class SystemMessageGenerator:+ def __init__(+ self,+ assistant_role_names_path: str = "data/assistant_roles.txt",+ user_role_names_path: str = "data/user_roles.txt",+ assistant_prompt_path: str = "prompts/assistant_prompt.txt",+ user_prompt_path: str = "prompts/user_prompt.txt",+ ) -> None:++ with open(assistant_role_names_path, "r") as f:+ self.assistant_role_names: List[str] = f.read().splitlines()++ with open(user_role_names_path, "r") as f:+ self.user_role_names: List[str] = f.read().splitlines()++ with open(assistant_prompt_path, "r") as f:+ self.assistant_prompt: str = f.read()++ with open(user_prompt_path, "r") as f:+ self.user_prompt: str = f.read()++ def from_role(+ self,+ role_name: str = "",+ role_type: RoleType = RoleType.DEFAULT,+ role_prompt: Optional[str] = None,+ ) -> SystemMessageType:+ """Generate a system message from a role name and role type."""+ if role_type == RoleType.ASSISTANT:+ role_prompt = role_prompt or self.assistant_prompt+ new_role_prompt = role_prompt.replace("<ASSISTANT_ROLE>",+ role_name)+ assert new_role_prompt != role_prompt++ return AssistantSystemMessage(role_name=role_name,+ content=new_role_prompt)++ if role_type == RoleType.USER:+ role_prompt = role_prompt or self.user_prompt+ new_role_prompt = role_prompt.replace("<USER_ROLE>", role_name)+ assert new_role_prompt != role_prompt++ return UserSystemMessage(role_name=role_name,+ content=new_role_prompt)++ if role_type == RoleType.DEFAULT:+ new_role_prompt = role_prompt or f"Your are a helpful assistant."++ return SystemMessage(role_type=role_type,+ role_name=role_name,+ content=new_role_prompt)++ def from_roles(+ self,+ roles: List[Tuple[RoleType, str]],+ assistant_prompt: Optional[str] = None,+ user_prompt: Optional[str] = None,+ ) -> List[SystemMessageType]:+ assistant_prompt = assistant_prompt or self.assistant_prompt+ user_prompt = user_prompt or self.user_prompt+ role_prompts = [assistant_prompt, user_prompt]+ assert len(roles) == 2, "Only support 1 assistant and 1 user."+ assert RoleType.ASSISTANT in [role_type for _, role_type in roles+ ], "Must have 1 assistant."+ assert RoleType.USER in [role_type for _, role_type in roles+ ], "Must have 1 user."++ for i, role_prompt in enumerate(role_prompts):+ for role_name, role_type in roles:+ role_prompt = self.from_role(role_name, role_type,+ role_prompt).content+ role_prompts[i] = role_prompt++ for role_name, role_type in roles:+ if role_type == RoleType.ASSISTANT:+ assistant_role_name = role_name+ if role_type == RoleType.USER:+ user_role_name = role_name++ assistant_system_message = AssistantSystemMessage(+ role_name=assistant_role_name,+ content=role_prompts[0],+ )+ user_system_message = UserSystemMessage(+ role_name=user_role_name,+ content=role_prompts[1],+ )++ system_messages: List[SystemMessageType] = []+ for _, role_type in roles:+ system_messages.append(assistant_system_message if role_type ==+ RoleType.ASSISTANT else user_system_message)++ return system_messages++ def from_role_files(+ self) -> Generator[List[SystemMessageType], None, None]:+ for assistant_role_name in self.assistant_role_names:+ for user_role_name in self.user_role_names:+ yield self.from_roles(roles=[+ (assistant_role_name, RoleType.ASSISTANT),+ (user_role_name, RoleType.USER)+ ], )+++if __name__ == "__main__":+ sys_msg_generator = SystemMessageGenerator()+ sys_msg_generator.from_role(role_name="doctor",+ role_type=RoleType.ASSISTANT)+ sys_msg_generator.from_role(role_name="doctor", role_type=RoleType.USER)++ sys_msg_generator.from_roles(+ roles=[("doctor", RoleType.USER), ("chatbot", RoleType.ASSISTANT)])++ generator = sys_msg_generator.from_role_files()+ sys_msg_1 = next(generator)+ sys_msg_2 = next(generator)+ assert sys_msg_1 != sys_msg_2diff --git a/camel/role_playing.py b/camel/role_playing.pynew file mode 100644index 000000000..108009520--- /dev/null+++ b/camel/role_playing.py@@ -0,0 +1,63 @@+from camel_typing import (AssistantChatMessage, AssistantSystemMessage,+ ModeType, RoleType, UserChatMessage,+ UserSystemMessage)+from chat_agent import ChatAgent+from configs import SystemMessageGenerator+++def init_chat(+ assistant_agent: ChatAgent,+ user_agent: ChatAgent,+ user_sys_msg: UserSystemMessage,+ assistant_sys_msg: AssistantSystemMessage,+):+ assistant_agent.reset()+ user_agent.reset()++ # Send the system messages again to the agents using chat messages+ assistant_msg = AssistantChatMessage(+ "Computer Programer",+ content=+ (f"{user_sys_msg.content}. "+ f"Now start to give me introductions one by one. Only reply with Instruction and Input."+ ))+ assistant_msg.role = "user"++ user_msg = UserChatMessage("Student",+ content=f"{assistant_sys_msg.content}")+ msgs, _, _ = assistant_agent.step(user_msg)++ return assistant_msg, msgs+++def main() -> None:+ sys_msg_generator = SystemMessageGenerator()+ assistant_sys_msg, user_sys_msg = sys_msg_generator.from_roles(+ roles=[("Computer Programmer",+ RoleType.ASSISTANT), ("Gamer", RoleType.USER)])+ assistant_agent = ChatAgent(assistant_sys_msg, ModeType.GPT_3_5_TURBO)+ user_agent = ChatAgent(user_sys_msg, ModeType.GPT_3_5_TURBO)++ assistant_msg, _ = init_chat(assistant_agent, user_agent, user_sys_msg,+ assistant_sys_msg)++ while True:+ user_msgs, user_terminated, _ = user_agent.step(assistant_msg)+ if user_terminated:+ break+ user_msg = user_msgs[0]+ print(f"User:\n{user_msg.content}\n")+ user_msg.role = "user"++ assistant_msgs, assistant_terminated, _ = assistant_agent.step(+ user_msg)+ if assistant_terminated:+ break+ assistant_msg = assistant_msgs[0]+ print(f"Assistant:\n{assistant_msg.content}\n")+ assistant_msg.role = "user"+++if __name__ == "__main__":+ main()+ exit()\ No newline at end of filediff --git a/data/assistant_roles.txt b/data/assistant_roles.txtnew file mode 100644index 000000000..3ade27eca--- /dev/null+++ b/data/assistant_roles.txt@@ -0,0 +1,150 @@+Personal assistant+Customer service representative+Technical support specialist+Sales representative+Marketing strategist+Content creator+Copywriter+Social media manager+Graphic designer+Web developer+Project manager+Business analyst+Data analyst+Data scientist+Statistician+Market researcher+Financial analyst+Investment banker+Accountant+Tax advisor+Lawyer+Paralegal+HR manager+Recruiter+Trainer+Teacher+Tutor+Writer+Editor+Translator+Interpreter+Proofreader+Researcher+Historian+Archaeologist+Geologist+Meteorologist+Chemist+Biologist+Physicist+Mathematician+Engineer+Computer scientist+Software developer+Game developer+Mobile app developer+Systems administrator+Network engineer+Database administrator+IT support specialist+Cybersecurity specialist+Ethical hacker+Project coordinator+Event planner+Wedding planner+Travel agent+Tour guide+Chef+Baker+Barista+Bartender+Waiter/waitress+Food critic+Interior designer+Architect+Urban planner+Landscape architect+Fashion designer+Stylist+Makeup artist+Hair stylist+Photographer+Videographer+Animator+Illustrator+Cartoonist+Fine artist+Musician+Composer+Music producer+Sound engineer+DJ+Radio host+Podcast host+TV presenter+News anchor+Actor+Voice actor+Director+Producer+Screenwriter+Film critic+Sports analyst+Sports journalist+Fitness coach+Personal trainer+Physical therapist+Nurse+Physician assistant+Medical coder+Medical biller+Dentist+Orthodontist+Veterinarian+Animal trainer+Zookeeper+Environmentalist+Conservationist+Ecologist+Horticulturist+Agriculturist+Economist+Political scientist+Sociologist+Psychologist+Psychiatrist+Counselor+Social worker+Nonprofit manager+Fundraiser+Philanthropist+Public relations specialist+Advertising executive+Journalist+News correspondent+TV producer+Radio producer+Documentary filmmaker+YouTuber+Twitch streamer+Gamer+Chess player+Crossword puzzle maker+Magician+Illusionist+Mentalist+Escape artist+Comedian+Clown+Puppeteer+Mime+Juggler+Acrobat+Gymnast+Figure skater+Roller skater+Snowboarder+Surfer+Scuba diver+Skydiver\ No newline at end of filediff --git a/data/user_roles.txt b/data/user_roles.txtnew file mode 100644index 000000000..6d1fc1752--- /dev/null+++ b/data/user_roles.txt@@ -0,0 +1,200 @@+Blogger+Vlogger+Gamer+Programmer+Graphic designer+Web developer+Social media influencer+Podcaster+Photographer+Musician+Artist+Writer+Reader+Traveler+Fitness enthusiast+Foodie+Fashionista+Beauty enthusiast+DIY enthusiast+Pet owner+Parent+Student+Teacher+Entrepreneur+Investor+Marketer+Salesperson+Job seeker+Freelancer+Consultant+Lawyer+Doctor+Nurse+Engineer+Scientist+Academic researcher+Nonprofit worker+Activist+Politician+Journalist+News junkie+Movie buff+TV series binge-watcher+Anime fan+Comic book fan+Sports fan+Fitness coach+Nutritionist+Psychologist+Life coach+Meditation practitioner+Yoga enthusiast+Spiritual seeker+Religious follower+Environmentalist+Gardener+DIY home decorator+Interior designer+Minimalist+Collector+Vintage enthusiast+Secondhand shopper+Luxury shopper+Couponer+Frugal shopper+Bargain hunter+Technology enthusiast+Smartphone addict+App developer+Cryptocurrency trader+Stock trader+Video editor+Sound engineer+Animator+Game designer+E-book reader+Audiobook listener+Language learner+Translator+Tourist+Expat+Immigrant+Refugee+Cultural enthusiast+History buff+Genealogist+Gene editing enthusiast+Space enthusiast+Astronomer+Astrophysicist+Paleontologist+Biologist+Zoologist+Veterinarian+Animal rights activist+Human rights activist+LGBTQ+ activist+Mental health advocate+Disability rights advocate+Philanthropist+Accountant+Actor+Administrator+Architect+Artist+Athlete+Baker+Barber+Biologist+Bookkeeper+Bricklayer+Carpenter+Chef+Chemist+Civil engineer+Cleaner+Coach+Computer programmer+Construction worker+Cook+Counselor+Customer service representative+Dancer+Dentist+Designer+Detective+Doctor+Economist+Electrician+Engineer+Farmer+Fashion designer+Financial analyst+Firefighter+Florist+Freelancer+Gardener+Graphic designer+Hairdresser+Health care worker+Historian+Housekeeper+Human resources specialist+Illustrator+Information technology specialist+Insurance agent+Interior designer+Journalist+Judge+Lawyer+Librarian+Lifeguard+Makeup artist+Manager+Marketing specialist+Mechanic+Medical assistant+Military personnel+Musician+Nurse+Occupational therapist+Office assistant+Optometrist+Painter+Paramedic+Pharmacist+Photographer+Physical therapist+Physician assistant+Pilot+Plumber+Police officer+Politician+Postal worker+Producer+Professor+Psychologist+Real estate agent+Receptionist+Reporter+Researcher+Sales representative+Scientist+Security guard+Singer+Social media manager+Social worker+Software developer+Speech therapist+Surgeon+Surveyor+Tailor+Teacher+Technician+Therapist+Translator+Travel agent+Truck driver+Veterinarian+Writer\ No newline at end of filediff --git a/install_env.sh b/install_env.shnew file mode 100644index 000000000..cc8247ab0--- /dev/null+++ b/install_env.sh@@ -0,0 +1,2 @@+conda create --name camel python=3.10+conda install pytorch torchvision torchaudio pytorch-cuda=11.7 -c pytorch -c nvidia\ No newline at end of filediff --git a/prompts/assistant_prompt.txt b/prompts/assistant_prompt.txtnew file mode 100644index 000000000..8d073c1a7--- /dev/null+++ b/prompts/assistant_prompt.txt@@ -0,0 +1,16 @@+Never forget you are a <ASSISTANT_ROLE> and I am a <USER_ROLE>. I must instruct you based on your expertise and my needs to perform any tasks or answer any questions in the following to two ways:++1. Instruct with a necessary input:+Instruction: <MY_INSTRUCTION>+Input: <MY_INPUT>++2. Instruct without any input:+Instruction: <MY_INSTRUCTION>+Input: None++The "Instruction" describes a task or question. The paired "Input" provides further context or information for the requested "Instruction".++You must write a response that appropriately completes the requested instruction.+You must decline my instruction politely and honestly if you cannot perform the instruction due to physical, moral, legal reasons or your capability and explain the reasons.+Now I must start to instruct you using the two ways described above.+Do not add anything else other than your response to my instruction.\ No newline at end of filediff --git a/prompts/generate_assistant.txt b/prompts/generate_assistant.txtnew file mode 100644index 000000000..ea56964e1--- /dev/null+++ b/prompts/generate_assistant.txt@@ -0,0 +1 @@+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 filediff --git a/prompts/generate_user.txt b/prompts/generate_user.txtnew file mode 100644index 000000000..fee1a7503--- /dev/null+++ b/prompts/generate_user.txt@@ -0,0 +1,2 @@+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 filediff --git a/prompts/user_prompt.txt b/prompts/user_prompt.txtnew file mode 100644index 000000000..a78eb5c8c--- /dev/null+++ b/prompts/user_prompt.txt@@ -0,0 +1,17 @@+Never forget you are a <USER_ROLE> and I am a <ASSISTANT_ROLE>. You must instruct me based on my expertise and your needs to perform any tasks or ask any questions in the following to two ways:++1. Instruct with a necessary input:+Instruction: <YOUR_INSTRUCTION>+Input: <YOUR_INPUT>++2. Instruct without any input:+Instruction: <YOUR_INSTRUCTION>+Input: None++The "Instruction" describes a task or question. The paired "Input" provides further context or information for the requested "Instruction".++I must write a response that appropriately completes the requested instruction.+I must decline your instruction politely and honestly if I cannot perform the instruction due to physical, moral, legal reasons or my capability and explain the reasons.+Now you must start to instruct me using the two ways described above.+Do not add anything else other than your instruction and the optional corresponding input!+Keep giving me instructions and necessary inputs. Do not stopping!\ No newline at end of filediff --git a/requirements.txt b/requirements.txtnew file mode 100644index 000000000..3e330669c--- /dev/null+++ b/requirements.txt@@ -0,0 +1,12 @@+numpy+rouge_score+fire+openai+transformers>=4.26.1+sentencepiece+tokenizers==0.12.1+wandb+tenacity+tiktoken+flake8+yapf