From acae840b4a7bcd471836f0c4b36c40a1035a67b4 Mon Sep 17 00:00:00 2001 From: gargimaheshwari Date: Thu, 20 Jun 2024 16:39:21 +0530 Subject: [PATCH] add format for tasks --- lyzr/base/prompt_texts.py | 3 ++- lyzr/data_analyzr/analyzr.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lyzr/base/prompt_texts.py b/lyzr/base/prompt_texts.py index 1fc8f47..7085054 100644 --- a/lyzr/base/prompt_texts.py +++ b/lyzr/base/prompt_texts.py @@ -70,7 +70,8 @@ "system": { "context": "You are the world's best to-do creator and assigner. All the to-dos are executable in 60 minutes or less.\nYou can understand any recommendation or set of recommendations and break it down into a list of to-do's that the user could do in 60 minutes or less.\nThese to-dos will help the user execute the larger recommendations.\n\n", "external_context": "{context}", - "task": "Generate a list of to-dos that are not complex and don't require multiple tasks to be executed at once.\nThey should be sequential and the user should be able to complete the to-dos one at a time.\n\nGenerate to-dos that are specific and quantifiable, ensuring that each task mentions a clear numeric target.\nEach task should be feasible to complete within a 2 to 3-hour timeframe.\nFor example, instead of saying 'Speak to customers', the task should be 'Speak to 10 customers'.\nLikewise, instead of 'Create a list of documents', it should specify 'Create a list of 30 documents'.\n\nEach to-do should be between 15 and 25 words. And generate no more than {n_tasks} to-dos. \n\nThe to-dos should always start with one of the below:\nCreate a list,\nWrite down, \nSpeak to,\nSetup 30 minutes to dive deep and analyze,\nPlan to,\nDo,\nReview,\nDraft,\nComplete,\nBegin,\nDiscuss,\nSchedule,\nConfirm,\nReach out to,\nTest,\nAttend,\nAllocate time for", + "task": "Generate a list of to-dos that are not complex and don't require multiple tasks to be executed at once.\nThey should be sequential and the user should be able to complete the to-dos one at a time.\n\nGenerate to-dos that are specific and quantifiable, ensuring that each task mentions a clear numeric target.\nEach task should be feasible to complete within a 2 to 3-hour timeframe.\nFor example, instead of saying 'Speak to customers', the task should be 'Speak to 10 customers'.\nLikewise, instead of 'Create a list of documents', it should specify 'Create a list of 30 documents'.\n\n", + "closing": "Use the following format:\n{tasks_format}\n\nEach to-do should be between 15 and 25 words. And generate no more than {n_tasks} to-dos. \n\nThe to-dos should always start with one of the below:\nCreate a list,\nWrite down, \nSpeak to,\nSetup 30 minutes to dive deep and analyze,\nPlan to,\nDo,\nReview,\nDraft,\nComplete,\nBegin,\nDiscuss,\nSchedule,\nConfirm,\nReach out to,\nTest,\nAttend,\nAllocate time for", }, "user": { "inputs": "User Query: {user_input}\n\nAnalysis results & insights: {insights}\n\nRecommendations: {recommendations}" diff --git a/lyzr/data_analyzr/analyzr.py b/lyzr/data_analyzr/analyzr.py index c004409..ebc2b74 100644 --- a/lyzr/data_analyzr/analyzr.py +++ b/lyzr/data_analyzr/analyzr.py @@ -540,10 +540,11 @@ def tasks( """ if tasks_context is None: tasks_context = "" + tasks_format = "1. Task 1\n2. Task 2\n...\n" self.tasks_output = self.generator_llm.run( messages=[ LyzrPromptFactory(name="tasks", prompt_type="system").get_message( - context=tasks_context, n_tasks=n_tasks + context=tasks_context, tasks_format=tasks_format, n_tasks=n_tasks ), LyzrPromptFactory(name="tasks", prompt_type="user").get_message( user_input=user_input,