{"version":3,"file":"log.cjs","names":[],"sources":["../../../src/agents/format_scratchpad/log.ts"],"sourcesContent":["import { AgentStep } from \"@langchain/core/agents\";\n\n/**\n * Construct the scratchpad that lets the agent continue its thought process.\n * @param intermediateSteps\n * @param observationPrefix\n * @param llmPrefix\n * @returns a string with the formatted observations and agent logs\n */\nexport function formatLogToString(\n  intermediateSteps: AgentStep[],\n  observationPrefix = \"Observation: \",\n  llmPrefix = \"Thought: \"\n): string {\n  const formattedSteps = intermediateSteps.reduce(\n    (thoughts, { action, observation }) =>\n      thoughts +\n      [action.log, `\\n${observationPrefix}${observation}`, llmPrefix].join(\n        \"\\n\"\n      ),\n    \"\"\n  );\n  return formattedSteps;\n}\n"],"mappings":";;;;;;;;;;AASA,SAAgB,kBACd,mBACA,oBAAoB,iBACpB,YAAY,aACJ;AASR,QARuB,kBAAkB,QACtC,UAAU,EAAE,QAAQ,kBACnB,WACA;EAAC,OAAO;EAAK,KAAK,oBAAoB;EAAe;EAAU,CAAC,KAC9D,KACD,EACH,GACD"}