{"version":3,"file":"prompt.cjs","names":["SystemMessagePromptTemplate","HumanMessagePromptTemplate"],"sources":["../../../src/experimental/plan_and_execute/prompt.ts"],"sourcesContent":["import {\n  ChatPromptTemplate,\n  HumanMessagePromptTemplate,\n  SystemMessagePromptTemplate,\n} from \"@langchain/core/prompts\";\n\nimport { Tool, DynamicStructuredTool } from \"@langchain/core/tools\";\n\nexport const PLANNER_SYSTEM_PROMPT_MESSAGE_TEMPLATE = [\n  `Let's first understand the problem and devise a plan to solve the problem.`,\n  `Please output the plan starting with the header \"Plan:\"`,\n  `followed by a numbered list of steps.`,\n  `Please make the plan the minimum number of steps required`,\n  `to answer the query or complete the task accurately and precisely.`,\n  `You have a set of tools at your disposal to help you with this task:`,\n  \"\",\n  \"{toolStrings}\",\n  \"\",\n  `You must consider these tools when coming up with your plan.`,\n  `If the task is a question, the final step in the plan must be the following: \"Given the above steps taken,`,\n  `please respond to the original query.\"`,\n  `At the end of your plan, say \"<END_OF_PLAN>\"`,\n].join(\" \");\n\nexport const DEFAULT_STEP_EXECUTOR_HUMAN_CHAT_MESSAGE_TEMPLATE = `Previous steps: {previous_steps}\n\nCurrent objective: {current_step}\n\n{agent_scratchpad}\n\nYou may extract and combine relevant data from your previous steps when responding to me.`;\n\n/**\n * Add the tool descriptions to the planning system prompt in\n * order to get a better suited plan that makes efficient use\n * of the tools\n * @param tools the tools available to the `planner`\n * @returns\n */\nexport const getPlannerChatPrompt = async (\n  tools: Tool[] | DynamicStructuredTool[]\n) => {\n  const toolStrings = tools\n    .map((tool) => `${tool.name}: ${tool.description}`)\n    .join(\"\\n\");\n\n  return /* #__PURE__ */ ChatPromptTemplate.fromMessages([\n    SystemMessagePromptTemplate.fromTemplate(\n      PLANNER_SYSTEM_PROMPT_MESSAGE_TEMPLATE\n    ),\n    HumanMessagePromptTemplate.fromTemplate(`{input}`),\n  ]).partial({ toolStrings });\n};\n"],"mappings":";;;AAQA,MAAa,yCAAyC;CACpD;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD,CAAC,KAAK,IAAI;AAEX,MAAa,oDAAoD;;;;;;;;;;;;;;AAejE,MAAa,uBAAuB,OAClC,UACG;CACH,MAAM,cAAc,MACjB,KAAK,SAAS,GAAG,KAAK,KAAK,IAAI,KAAK,cAAc,CAClD,KAAK,KAAK;AAEb,QAAuB,wCAAA,mBAAmB,aAAa,CACrDA,wBAAAA,4BAA4B,aAC1B,uCACD,EACDC,wBAAAA,2BAA2B,aAAa,UAAU,CACnD,CAAC,CAAC,QAAQ,EAAE,aAAa,CAAC"}