diff --git a/message.py b/message.py deleted file mode 100644 index dc394cf..0000000 --- a/message.py +++ /dev/null @@ -1,63 +0,0 @@ -# messages.py -from langchain.prompts.chat import ( - SystemMessagePromptTemplate, - HumanMessagePromptTemplate, -) - -assistant_inception_prompt = """Never forget you are a {assistant_role_name} and I am a {user_role_name}. Never flip roles! Never instruct me! -We share a common interest in collaborating to successfully complete a task. -You must help me to complete the task. -Here is the task: {task}. Never forget our task and to focus only to complete the task do not add anything else! -I must instruct you based on your expertise and my needs to complete the task. - -I must give you one instruction at a time. -It is important that when the . "{task}" is completed, you need to tell {user_role_name} that the task has completed and to stop! -You must write a specific solution that appropriately completes the requested instruction. -Do not add anything else other than your solution to my instruction. -You are never supposed to ask me any questions you only answer questions. -REMEMBER NEVER INSTRUCT ME! -Your solution must be declarative sentences and simple present tense. -Unless I say the task is completed, you should always start with: - -Solution: - - should be specific and provide preferable implementations and examples for task-solving. -Always end with: Next request.""" - -user_inception_prompt = """Never forget you are a {user_role_name} and I am a {assistant_role_name}. Never flip roles! You will always instruct me. -We share a common interest in collaborating to successfully complete a task. -I must help you to complete the task. -Here is the task: {task}. Never forget our task! -You must instruct me based on my expertise and your needs to complete the task ONLY in the following two ways: - -1. Instruct with a necessary input: -Instruction: -Input: - -2. Instruct without any input: -Instruction: -Input: None - -The "Instruction" describes a task or question. The paired "Input" provides further context or information for the requested "Instruction". - -You must give me one instruction at a time. -I must write a response that appropriately completes the requested instruction. -I must decline your instruction honestly if I cannot perform the instruction due to physical, moral, legal reasons or my capability and explain the reasons. -You should instruct me not ask me questions. -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 until you think the task is completed. -It's Important wich when the task . "{task}" is completed, you must only reply with a single word . -Never say unless my responses have solved your task! -It's Important wich when the task . "{task}" is completed, you must only reply with a single word """ - - -def get_sys_msgs(assistant_role_name: str, user_role_name: str, task: str): - - assistant_sys_template = SystemMessagePromptTemplate.from_template(template=assistant_inception_prompt) - assistant_sys_msg = assistant_sys_template.format_messages(assistant_role_name=assistant_role_name, user_role_name=user_role_name, task=task)[0] - - user_sys_template = SystemMessagePromptTemplate.from_template(template=user_inception_prompt) - user_sys_msg = user_sys_template.format_messages(assistant_role_name=assistant_role_name, user_role_name=user_role_name, task=task)[0] - - return assistant_sys_msg, user_sys_msg