[docs]classTaskPrioritizationChain(LLMChain):"""Chain to prioritize tasks."""
[docs]@classmethoddeffrom_llm(cls,llm:BaseLanguageModel,verbose:bool=True)->LLMChain:"""Get the response parser."""task_prioritization_template=("You are a task prioritization AI tasked with cleaning the formatting of ""and reprioritizing the following tasks: {task_names}."" Consider the ultimate objective of your team: {objective}."" Do not remove any tasks. Return the result as a numbered list, like:"" #. First task"" #. Second task"" Start the task list with number {next_task_id}.")prompt=PromptTemplate(template=task_prioritization_template,input_variables=["task_names","next_task_id","objective"],)returncls(prompt=prompt,llm=llm,verbose=verbose)