1ec3f6bb42aca70af1705a4e29128d449231a05c05eb79b612869b401b467213.json 61 KB

1
  1. {"ast":null,"code":"import _asyncToGenerator from \"F:/workspace/202226701027/huinongbao-app/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\";\nimport { BaseCallbackHandler } from \"../callbacks/base.js\";\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction _coerceToDict(value, defaultKey) {\n return value && !Array.isArray(value) && typeof value === \"object\" ? value : {\n [defaultKey]: value\n };\n}\nfunction stripNonAlphanumeric(input) {\n return input.replace(/[-:.]/g, \"\");\n}\nfunction convertToDottedOrderFormat(epoch, runId, executionOrder) {\n const paddedOrder = executionOrder.toFixed(0).slice(0, 3).padStart(3, \"0\");\n return stripNonAlphanumeric(`${new Date(epoch).toISOString().slice(0, -1)}${paddedOrder}Z`) + runId;\n}\nexport function isBaseTracer(x) {\n return typeof x._addRunToRunMap === \"function\";\n}\nexport class BaseTracer extends BaseCallbackHandler {\n constructor(_fields) {\n super(...arguments);\n Object.defineProperty(this, \"runMap\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: new Map()\n });\n }\n copy() {\n return this;\n }\n stringifyError(error) {\n // eslint-disable-next-line no-instanceof/no-instanceof\n if (error instanceof Error) {\n return error.message + (error !== null && error !== void 0 && error.stack ? `\\n\\n${error.stack}` : \"\");\n }\n if (typeof error === \"string\") {\n return error;\n }\n return `${error}`;\n }\n _addChildRun(parentRun, childRun) {\n parentRun.child_runs.push(childRun);\n }\n _addRunToRunMap(run) {\n const currentDottedOrder = convertToDottedOrderFormat(run.start_time, run.id, run.execution_order);\n const storedRun = {\n ...run\n };\n if (storedRun.parent_run_id !== undefined) {\n const parentRun = this.runMap.get(storedRun.parent_run_id);\n if (parentRun) {\n this._addChildRun(parentRun, storedRun);\n parentRun.child_execution_order = Math.max(parentRun.child_execution_order, storedRun.child_execution_order);\n storedRun.trace_id = parentRun.trace_id;\n if (parentRun.dotted_order !== undefined) {\n storedRun.dotted_order = [parentRun.dotted_order, currentDottedOrder].join(\".\");\n } else {\n // This can happen naturally for callbacks added within a run\n // console.debug(`Parent run with UUID ${storedRun.parent_run_id} has no dotted order.`);\n }\n } else {\n // This can happen naturally for callbacks added within a run\n // console.debug(\n // `Parent run with UUID ${storedRun.parent_run_id} not found.`\n // );\n }\n } else {\n storedRun.trace_id = storedRun.id;\n storedRun.dotted_order = currentDottedOrder;\n }\n this.runMap.set(storedRun.id, storedRun);\n return storedRun;\n }\n _endTrace(run) {\n var _this = this;\n return _asyncToGenerator(function* () {\n var _this$onRunUpdate;\n const parentRun = run.parent_run_id !== undefined && _this.runMap.get(run.parent_run_id);\n if (parentRun) {\n parentRun.child_execution_order = Math.max(parentRun.child_execution_order, run.child_execution_order);\n } else {\n yield _this.persistRun(run);\n }\n _this.runMap.delete(run.id);\n yield (_this$onRunUpdate = _this.onRunUpdate) === null || _this$onRunUpdate === void 0 ? void 0 : _this$onRunUpdate.call(_this, run);\n })();\n }\n _getExecutionOrder(parentRunId) {\n const parentRun = parentRunId !== undefined && this.runMap.get(parentRunId);\n // If a run has no parent then execution order is 1\n if (!parentRun) {\n return 1;\n }\n return parentRun.child_execution_order + 1;\n }\n /**\n * Create and add a run to the run map for LLM start events.\n * This must sometimes be done synchronously to avoid race conditions\n * when callbacks are backgrounded, so we expose it as a separate method here.\n */\n _createRunForLLMStart(llm, prompts, runId, parentRunId, extraParams, tags, metadata, name) {\n const execution_order = this._getExecutionOrder(parentRunId);\n const start_time = Date.now();\n const finalExtraParams = metadata ? {\n ...extraParams,\n metadata\n } : extraParams;\n const run = {\n id: runId,\n name: name !== null && name !== void 0 ? name : llm.id[llm.id.length - 1],\n parent_run_id: parentRunId,\n start_time,\n serialized: llm,\n events: [{\n name: \"start\",\n time: new Date(start_time).toISOString()\n }],\n inputs: {\n prompts\n },\n execution_order,\n child_runs: [],\n child_execution_order: execution_order,\n run_type: \"llm\",\n extra: finalExtraParams !== null && finalExtraParams !== void 0 ? finalExtraParams : {},\n tags: tags || []\n };\n return this._addRunToRunMap(run);\n }\n handleLLMStart(llm, prompts, runId, parentRunId, extraParams, tags, metadata, name) {\n var _this2 = this;\n return _asyncToGenerator(function* () {\n var _this2$runMap$get, _this2$onRunCreate, _this2$onLLMStart;\n const run = (_this2$runMap$get = _this2.runMap.get(runId)) !== null && _this2$runMap$get !== void 0 ? _this2$runMap$get : _this2._createRunForLLMStart(llm, prompts, runId, parentRunId, extraParams, tags, metadata, name);\n yield (_this2$onRunCreate = _this2.onRunCreate) === null || _this2$onRunCreate === void 0 ? void 0 : _this2$onRunCreate.call(_this2, run);\n yield (_this2$onLLMStart = _this2.onLLMStart) === null || _this2$onLLMStart === void 0 ? void 0 : _this2$onLLMStart.call(_this2, run);\n return run;\n })();\n }\n /**\n * Create and add a run to the run map for chat model start events.\n * This must sometimes be done synchronously to avoid race conditions\n * when callbacks are backgrounded, so we expose it as a separate method here.\n */\n _createRunForChatModelStart(llm, messages, runId, parentRunId, extraParams, tags, metadata, name) {\n const execution_order = this._getExecutionOrder(parentRunId);\n const start_time = Date.now();\n const finalExtraParams = metadata ? {\n ...extraParams,\n metadata\n } : extraParams;\n const run = {\n id: runId,\n name: name !== null && name !== void 0 ? name : llm.id[llm.id.length - 1],\n parent_run_id: parentRunId,\n start_time,\n serialized: llm,\n events: [{\n name: \"start\",\n time: new Date(start_time).toISOString()\n }],\n inputs: {\n messages\n },\n execution_order,\n child_runs: [],\n child_execution_order: execution_order,\n run_type: \"llm\",\n extra: finalExtraParams !== null && finalExtraParams !== void 0 ? finalExtraParams : {},\n tags: tags || []\n };\n return this._addRunToRunMap(run);\n }\n handleChatModelStart(llm, messages, runId, parentRunId, extraParams, tags, metadata, name) {\n var _this3 = this;\n return _asyncToGenerator(function* () {\n var _this3$runMap$get, _this3$onRunCreate, _this3$onLLMStart;\n const run = (_this3$runMap$get = _this3.runMap.get(runId)) !== null && _this3$runMap$get !== void 0 ? _this3$runMap$get : _this3._createRunForChatModelStart(llm, messages, runId, parentRunId, extraParams, tags, metadata, name);\n yield (_this3$onRunCreate = _this3.onRunCreate) === null || _this3$onRunCreate === void 0 ? void 0 : _this3$onRunCreate.call(_this3, run);\n yield (_this3$onLLMStart = _this3.onLLMStart) === null || _this3$onLLMStart === void 0 ? void 0 : _this3$onLLMStart.call(_this3, run);\n return run;\n })();\n }\n handleLLMEnd(output, runId) {\n var _this4 = this;\n return _asyncToGenerator(function* () {\n var _this4$onLLMEnd;\n const run = _this4.runMap.get(runId);\n if (!run || (run === null || run === void 0 ? void 0 : run.run_type) !== \"llm\") {\n throw new Error(\"No LLM run to end.\");\n }\n run.end_time = Date.now();\n run.outputs = output;\n run.events.push({\n name: \"end\",\n time: new Date(run.end_time).toISOString()\n });\n yield (_this4$onLLMEnd = _this4.onLLMEnd) === null || _this4$onLLMEnd === void 0 ? void 0 : _this4$onLLMEnd.call(_this4, run);\n yield _this4._endTrace(run);\n return run;\n })();\n }\n handleLLMError(error, runId) {\n var _this5 = this;\n return _asyncToGenerator(function* () {\n var _this5$onLLMError;\n const run = _this5.runMap.get(runId);\n if (!run || (run === null || run === void 0 ? void 0 : run.run_type) !== \"llm\") {\n throw new Error(\"No LLM run to end.\");\n }\n run.end_time = Date.now();\n run.error = _this5.stringifyError(error);\n run.events.push({\n name: \"error\",\n time: new Date(run.end_time).toISOString()\n });\n yield (_this5$onLLMError = _this5.onLLMError) === null || _this5$onLLMError === void 0 ? void 0 : _this5$onLLMError.call(_this5, run);\n yield _this5._endTrace(run);\n return run;\n })();\n }\n /**\n * Create and add a run to the run map for chain start events.\n * This must sometimes be done synchronously to avoid race conditions\n * when callbacks are backgrounded, so we expose it as a separate method here.\n */\n _createRunForChainStart(chain, inputs, runId, parentRunId, tags, metadata, runType, name) {\n const execution_order = this._getExecutionOrder(parentRunId);\n const start_time = Date.now();\n const run = {\n id: runId,\n name: name !== null && name !== void 0 ? name : chain.id[chain.id.length - 1],\n parent_run_id: parentRunId,\n start_time,\n serialized: chain,\n events: [{\n name: \"start\",\n time: new Date(start_time).toISOString()\n }],\n inputs,\n execution_order,\n child_execution_order: execution_order,\n run_type: runType !== null && runType !== void 0 ? runType : \"chain\",\n child_runs: [],\n extra: metadata ? {\n metadata\n } : {},\n tags: tags || []\n };\n return this._addRunToRunMap(run);\n }\n handleChainStart(chain, inputs, runId, parentRunId, tags, metadata, runType, name) {\n var _this6 = this;\n return _asyncToGenerator(function* () {\n var _this6$runMap$get, _this6$onRunCreate, _this6$onChainStart;\n const run = (_this6$runMap$get = _this6.runMap.get(runId)) !== null && _this6$runMap$get !== void 0 ? _this6$runMap$get : _this6._createRunForChainStart(chain, inputs, runId, parentRunId, tags, metadata, runType, name);\n yield (_this6$onRunCreate = _this6.onRunCreate) === null || _this6$onRunCreate === void 0 ? void 0 : _this6$onRunCreate.call(_this6, run);\n yield (_this6$onChainStart = _this6.onChainStart) === null || _this6$onChainStart === void 0 ? void 0 : _this6$onChainStart.call(_this6, run);\n return run;\n })();\n }\n handleChainEnd(outputs, runId, _parentRunId, _tags, kwargs) {\n var _this7 = this;\n return _asyncToGenerator(function* () {\n var _this7$onChainEnd;\n const run = _this7.runMap.get(runId);\n if (!run) {\n throw new Error(\"No chain run to end.\");\n }\n run.end_time = Date.now();\n run.outputs = _coerceToDict(outputs, \"output\");\n run.events.push({\n name: \"end\",\n time: new Date(run.end_time).toISOString()\n });\n if ((kwargs === null || kwargs === void 0 ? void 0 : kwargs.inputs) !== undefined) {\n run.inputs = _coerceToDict(kwargs.inputs, \"input\");\n }\n yield (_this7$onChainEnd = _this7.onChainEnd) === null || _this7$onChainEnd === void 0 ? void 0 : _this7$onChainEnd.call(_this7, run);\n yield _this7._endTrace(run);\n return run;\n })();\n }\n handleChainError(error, runId, _parentRunId, _tags, kwargs) {\n var _this8 = this;\n return _asyncToGenerator(function* () {\n var _this8$onChainError;\n const run = _this8.runMap.get(runId);\n if (!run) {\n throw new Error(\"No chain run to end.\");\n }\n run.end_time = Date.now();\n run.error = _this8.stringifyError(error);\n run.events.push({\n name: \"error\",\n time: new Date(run.end_time).toISOString()\n });\n if ((kwargs === null || kwargs === void 0 ? void 0 : kwargs.inputs) !== undefined) {\n run.inputs = _coerceToDict(kwargs.inputs, \"input\");\n }\n yield (_this8$onChainError = _this8.onChainError) === null || _this8$onChainError === void 0 ? void 0 : _this8$onChainError.call(_this8, run);\n yield _this8._endTrace(run);\n return run;\n })();\n }\n /**\n * Create and add a run to the run map for tool start events.\n * This must sometimes be done synchronously to avoid race conditions\n * when callbacks are backgrounded, so we expose it as a separate method here.\n */\n _createRunForToolStart(tool, input, runId, parentRunId, tags, metadata, name) {\n const execution_order = this._getExecutionOrder(parentRunId);\n const start_time = Date.now();\n const run = {\n id: runId,\n name: name !== null && name !== void 0 ? name : tool.id[tool.id.length - 1],\n parent_run_id: parentRunId,\n start_time,\n serialized: tool,\n events: [{\n name: \"start\",\n time: new Date(start_time).toISOString()\n }],\n inputs: {\n input\n },\n execution_order,\n child_execution_order: execution_order,\n run_type: \"tool\",\n child_runs: [],\n extra: metadata ? {\n metadata\n } : {},\n tags: tags || []\n };\n return this._addRunToRunMap(run);\n }\n handleToolStart(tool, input, runId, parentRunId, tags, metadata, name) {\n var _this9 = this;\n return _asyncToGenerator(function* () {\n var _this9$runMap$get, _this9$onRunCreate, _this9$onToolStart;\n const run = (_this9$runMap$get = _this9.runMap.get(runId)) !== null && _this9$runMap$get !== void 0 ? _this9$runMap$get : _this9._createRunForToolStart(tool, input, runId, parentRunId, tags, metadata, name);\n yield (_this9$onRunCreate = _this9.onRunCreate) === null || _this9$onRunCreate === void 0 ? void 0 : _this9$onRunCreate.call(_this9, run);\n yield (_this9$onToolStart = _this9.onToolStart) === null || _this9$onToolStart === void 0 ? void 0 : _this9$onToolStart.call(_this9, run);\n return run;\n })();\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n handleToolEnd(output, runId) {\n var _this10 = this;\n return _asyncToGenerator(function* () {\n var _this10$onToolEnd;\n const run = _this10.runMap.get(runId);\n if (!run || (run === null || run === void 0 ? void 0 : run.run_type) !== \"tool\") {\n throw new Error(\"No tool run to end\");\n }\n run.end_time = Date.now();\n run.outputs = {\n output\n };\n run.events.push({\n name: \"end\",\n time: new Date(run.end_time).toISOString()\n });\n yield (_this10$onToolEnd = _this10.onToolEnd) === null || _this10$onToolEnd === void 0 ? void 0 : _this10$onToolEnd.call(_this10, run);\n yield _this10._endTrace(run);\n return run;\n })();\n }\n handleToolError(error, runId) {\n var _this11 = this;\n return _asyncToGenerator(function* () {\n var _this11$onToolError;\n const run = _this11.runMap.get(runId);\n if (!run || (run === null || run === void 0 ? void 0 : run.run_type) !== \"tool\") {\n throw new Error(\"No tool run to end\");\n }\n run.end_time = Date.now();\n run.error = _this11.stringifyError(error);\n run.events.push({\n name: \"error\",\n time: new Date(run.end_time).toISOString()\n });\n yield (_this11$onToolError = _this11.onToolError) === null || _this11$onToolError === void 0 ? void 0 : _this11$onToolError.call(_this11, run);\n yield _this11._endTrace(run);\n return run;\n })();\n }\n handleAgentAction(action, runId) {\n var _this12 = this;\n return _asyncToGenerator(function* () {\n var _this12$onAgentAction;\n const run = _this12.runMap.get(runId);\n if (!run || (run === null || run === void 0 ? void 0 : run.run_type) !== \"chain\") {\n return;\n }\n const agentRun = run;\n agentRun.actions = agentRun.actions || [];\n agentRun.actions.push(action);\n agentRun.events.push({\n name: \"agent_action\",\n time: new Date().toISOString(),\n kwargs: {\n action\n }\n });\n yield (_this12$onAgentAction = _this12.onAgentAction) === null || _this12$onAgentAction === void 0 ? void 0 : _this12$onAgentAction.call(_this12, run);\n })();\n }\n handleAgentEnd(action, runId) {\n var _this13 = this;\n return _asyncToGenerator(function* () {\n var _this13$onAgentEnd;\n const run = _this13.runMap.get(runId);\n if (!run || (run === null || run === void 0 ? void 0 : run.run_type) !== \"chain\") {\n return;\n }\n run.events.push({\n name: \"agent_end\",\n time: new Date().toISOString(),\n kwargs: {\n action\n }\n });\n yield (_this13$onAgentEnd = _this13.onAgentEnd) === null || _this13$onAgentEnd === void 0 ? void 0 : _this13$onAgentEnd.call(_this13, run);\n })();\n }\n /**\n * Create and add a run to the run map for retriever start events.\n * This must sometimes be done synchronously to avoid race conditions\n * when callbacks are backgrounded, so we expose it as a separate method here.\n */\n _createRunForRetrieverStart(retriever, query, runId, parentRunId, tags, metadata, name) {\n const execution_order = this._getExecutionOrder(parentRunId);\n const start_time = Date.now();\n const run = {\n id: runId,\n name: name !== null && name !== void 0 ? name : retriever.id[retriever.id.length - 1],\n parent_run_id: parentRunId,\n start_time,\n serialized: retriever,\n events: [{\n name: \"start\",\n time: new Date(start_time).toISOString()\n }],\n inputs: {\n query\n },\n execution_order,\n child_execution_order: execution_order,\n run_type: \"retriever\",\n child_runs: [],\n extra: metadata ? {\n metadata\n } : {},\n tags: tags || []\n };\n return this._addRunToRunMap(run);\n }\n handleRetrieverStart(retriever, query, runId, parentRunId, tags, metadata, name) {\n var _this14 = this;\n return _asyncToGenerator(function* () {\n var _this14$runMap$get, _this14$onRunCreate, _this14$onRetrieverSt;\n const run = (_this14$runMap$get = _this14.runMap.get(runId)) !== null && _this14$runMap$get !== void 0 ? _this14$runMap$get : _this14._createRunForRetrieverStart(retriever, query, runId, parentRunId, tags, metadata, name);\n yield (_this14$onRunCreate = _this14.onRunCreate) === null || _this14$onRunCreate === void 0 ? void 0 : _this14$onRunCreate.call(_this14, run);\n yield (_this14$onRetrieverSt = _this14.onRetrieverStart) === null || _this14$onRetrieverSt === void 0 ? void 0 : _this14$onRetrieverSt.call(_this14, run);\n return run;\n })();\n }\n handleRetrieverEnd(documents, runId) {\n var _this15 = this;\n return _asyncToGenerator(function* () {\n var _this15$onRetrieverEn;\n const run = _this15.runMap.get(runId);\n if (!run || (run === null || run === void 0 ? void 0 : run.run_type) !== \"retriever\") {\n throw new Error(\"No retriever run to end\");\n }\n run.end_time = Date.now();\n run.outputs = {\n documents\n };\n run.events.push({\n name: \"end\",\n time: new Date(run.end_time).toISOString()\n });\n yield (_this15$onRetrieverEn = _this15.onRetrieverEnd) === null || _this15$onRetrieverEn === void 0 ? void 0 : _this15$onRetrieverEn.call(_this15, run);\n yield _this15._endTrace(run);\n return run;\n })();\n }\n handleRetrieverError(error, runId) {\n var _this16 = this;\n return _asyncToGenerator(function* () {\n var _this16$onRetrieverEr;\n const run = _this16.runMap.get(runId);\n if (!run || (run === null || run === void 0 ? void 0 : run.run_type) !== \"retriever\") {\n throw new Error(\"No retriever run to end\");\n }\n run.end_time = Date.now();\n run.error = _this16.stringifyError(error);\n run.events.push({\n name: \"error\",\n time: new Date(run.end_time).toISOString()\n });\n yield (_this16$onRetrieverEr = _this16.onRetrieverError) === null || _this16$onRetrieverEr === void 0 ? void 0 : _this16$onRetrieverEr.call(_this16, run);\n yield _this16._endTrace(run);\n return run;\n })();\n }\n handleText(text, runId) {\n var _this17 = this;\n return _asyncToGenerator(function* () {\n var _this17$onText;\n const run = _this17.runMap.get(runId);\n if (!run || (run === null || run === void 0 ? void 0 : run.run_type) !== \"chain\") {\n return;\n }\n run.events.push({\n name: \"text\",\n time: new Date().toISOString(),\n kwargs: {\n text\n }\n });\n yield (_this17$onText = _this17.onText) === null || _this17$onText === void 0 ? void 0 : _this17$onText.call(_this17, run);\n })();\n }\n handleLLMNewToken(token, idx, runId, _parentRunId, _tags, fields) {\n var _this18 = this;\n return _asyncToGenerator(function* () {\n var _this18$onLLMNewToken;\n const run = _this18.runMap.get(runId);\n if (!run || (run === null || run === void 0 ? void 0 : run.run_type) !== \"llm\") {\n throw new Error(`Invalid \"runId\" provided to \"handleLLMNewToken\" callback.`);\n }\n run.events.push({\n name: \"new_token\",\n time: new Date().toISOString(),\n kwargs: {\n token,\n idx,\n chunk: fields === null || fields === void 0 ? void 0 : fields.chunk\n }\n });\n yield (_this18$onLLMNewToken = _this18.onLLMNewToken) === null || _this18$onLLMNewToken === void 0 ? void 0 : _this18$onLLMNewToken.call(_this18, run, token, {\n chunk: fields === null || fields === void 0 ? void 0 : fields.chunk\n });\n return run;\n })();\n }\n}","map":{"version":3,"names":["BaseCallbackHandler","_coerceToDict","value","defaultKey","Array","isArray","stripNonAlphanumeric","input","replace","convertToDottedOrderFormat","epoch","runId","executionOrder","paddedOrder","toFixed","slice","padStart","Date","toISOString","isBaseTracer","x","_addRunToRunMap","BaseTracer","constructor","_fields","arguments","Object","defineProperty","enumerable","configurable","writable","Map","copy","stringifyError","error","Error","message","stack","_addChildRun","parentRun","childRun","child_runs","push","run","currentDottedOrder","start_time","id","execution_order","storedRun","parent_run_id","undefined","runMap","get","child_execution_order","Math","max","trace_id","dotted_order","join","set","_endTrace","_this","_asyncToGenerator","_this$onRunUpdate","persistRun","delete","onRunUpdate","call","_getExecutionOrder","parentRunId","_createRunForLLMStart","llm","prompts","extraParams","tags","metadata","name","now","finalExtraParams","length","serialized","events","time","inputs","run_type","extra","handleLLMStart","_this2","_this2$runMap$get","_this2$onRunCreate","_this2$onLLMStart","onRunCreate","onLLMStart","_createRunForChatModelStart","messages","handleChatModelStart","_this3","_this3$runMap$get","_this3$onRunCreate","_this3$onLLMStart","handleLLMEnd","output","_this4","_this4$onLLMEnd","end_time","outputs","onLLMEnd","handleLLMError","_this5","_this5$onLLMError","onLLMError","_createRunForChainStart","chain","runType","handleChainStart","_this6","_this6$runMap$get","_this6$onRunCreate","_this6$onChainStart","onChainStart","handleChainEnd","_parentRunId","_tags","kwargs","_this7","_this7$onChainEnd","onChainEnd","handleChainError","_this8","_this8$onChainError","onChainError","_createRunForToolStart","tool","handleToolStart","_this9","_this9$runMap$get","_this9$onRunCreate","_this9$onToolStart","onToolStart","handleToolEnd","_this10","_this10$onToolEnd","onToolEnd","handleToolError","_this11","_this11$onToolError","onToolError","handleAgentAction","action","_this12","_this12$onAgentAction","agentRun","actions","onAgentAction","handleAgentEnd","_this13","_this13$onAgentEnd","onAgentEnd","_createRunForRetrieverStart","retriever","query","handleRetrieverStart","_this14","_this14$runMap$get","_this14$onRunCreate","_this14$onRetrieverSt","onRetrieverStart","handleRetrieverEnd","documents","_this15","_this15$onRetrieverEn","onRetrieverEnd","handleRetrieverError","_this16","_this16$onRetrieverEr","onRetrieverError","handleText","text","_this17","_this17$onText","onText","handleLLMNewToken","token","idx","fields","_this18","_this18$onLLMNewToken","chunk","onLLMNewToken"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@langchain/core/dist/tracers/base.js"],"sourcesContent":["import { BaseCallbackHandler, } from \"../callbacks/base.js\";\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction _coerceToDict(value, defaultKey) {\n return value && !Array.isArray(value) && typeof value === \"object\"\n ? value\n : { [defaultKey]: value };\n}\nfunction stripNonAlphanumeric(input) {\n return input.replace(/[-:.]/g, \"\");\n}\nfunction convertToDottedOrderFormat(epoch, runId, executionOrder) {\n const paddedOrder = executionOrder.toFixed(0).slice(0, 3).padStart(3, \"0\");\n return (stripNonAlphanumeric(`${new Date(epoch).toISOString().slice(0, -1)}${paddedOrder}Z`) + runId);\n}\nexport function isBaseTracer(x) {\n return typeof x._addRunToRunMap === \"function\";\n}\nexport class BaseTracer extends BaseCallbackHandler {\n constructor(_fields) {\n super(...arguments);\n Object.defineProperty(this, \"runMap\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: new Map()\n });\n }\n copy() {\n return this;\n }\n stringifyError(error) {\n // eslint-disable-next-line no-instanceof/no-instanceof\n if (error instanceof Error) {\n return error.message + (error?.stack ? `\\n\\n${error.stack}` : \"\");\n }\n if (typeof error === \"string\") {\n return error;\n }\n return `${error}`;\n }\n _addChildRun(parentRun, childRun) {\n parentRun.child_runs.push(childRun);\n }\n _addRunToRunMap(run) {\n const currentDottedOrder = convertToDottedOrderFormat(run.start_time, run.id, run.execution_order);\n const storedRun = { ...run };\n if (storedRun.parent_run_id !== undefined) {\n const parentRun = this.runMap.get(storedRun.parent_run_id);\n if (parentRun) {\n this._addChildRun(parentRun, storedRun);\n parentRun.child_execution_order = Math.max(parentRun.child_execution_order, storedRun.child_execution_order);\n storedRun.trace_id = parentRun.trace_id;\n if (parentRun.dotted_order !== undefined) {\n storedRun.dotted_order = [\n parentRun.dotted_order,\n currentDottedOrder,\n ].join(\".\");\n }\n else {\n // This can happen naturally for callbacks added within a run\n // console.debug(`Parent run with UUID ${storedRun.parent_run_id} has no dotted order.`);\n }\n }\n else {\n // This can happen naturally for callbacks added within a run\n // console.debug(\n // `Parent run with UUID ${storedRun.parent_run_id} not found.`\n // );\n }\n }\n else {\n storedRun.trace_id = storedRun.id;\n storedRun.dotted_order = currentDottedOrder;\n }\n this.runMap.set(storedRun.id, storedRun);\n return storedRun;\n }\n async _endTrace(run) {\n const parentRun = run.parent_run_id !== undefined && this.runMap.get(run.parent_run_id);\n if (parentRun) {\n parentRun.child_execution_order = Math.max(parentRun.child_execution_order, run.child_execution_order);\n }\n else {\n await this.persistRun(run);\n }\n this.runMap.delete(run.id);\n await this.onRunUpdate?.(run);\n }\n _getExecutionOrder(parentRunId) {\n const parentRun = parentRunId !== undefined && this.runMap.get(parentRunId);\n // If a run has no parent then execution order is 1\n if (!parentRun) {\n return 1;\n }\n return parentRun.child_execution_order + 1;\n }\n /**\n * Create and add a run to the run map for LLM start events.\n * This must sometimes be done synchronously to avoid race conditions\n * when callbacks are backgrounded, so we expose it as a separate method here.\n */\n _createRunForLLMStart(llm, prompts, runId, parentRunId, extraParams, tags, metadata, name) {\n const execution_order = this._getExecutionOrder(parentRunId);\n const start_time = Date.now();\n const finalExtraParams = metadata\n ? { ...extraParams, metadata }\n : extraParams;\n const run = {\n id: runId,\n name: name ?? llm.id[llm.id.length - 1],\n parent_run_id: parentRunId,\n start_time,\n serialized: llm,\n events: [\n {\n name: \"start\",\n time: new Date(start_time).toISOString(),\n },\n ],\n inputs: { prompts },\n execution_order,\n child_runs: [],\n child_execution_order: execution_order,\n run_type: \"llm\",\n extra: finalExtraParams ?? {},\n tags: tags || [],\n };\n return this._addRunToRunMap(run);\n }\n async handleLLMStart(llm, prompts, runId, parentRunId, extraParams, tags, metadata, name) {\n const run = this.runMap.get(runId) ??\n this._createRunForLLMStart(llm, prompts, runId, parentRunId, extraParams, tags, metadata, name);\n await this.onRunCreate?.(run);\n await this.onLLMStart?.(run);\n return run;\n }\n /**\n * Create and add a run to the run map for chat model start events.\n * This must sometimes be done synchronously to avoid race conditions\n * when callbacks are backgrounded, so we expose it as a separate method here.\n */\n _createRunForChatModelStart(llm, messages, runId, parentRunId, extraParams, tags, metadata, name) {\n const execution_order = this._getExecutionOrder(parentRunId);\n const start_time = Date.now();\n const finalExtraParams = metadata\n ? { ...extraParams, metadata }\n : extraParams;\n const run = {\n id: runId,\n name: name ?? llm.id[llm.id.length - 1],\n parent_run_id: parentRunId,\n start_time,\n serialized: llm,\n events: [\n {\n name: \"start\",\n time: new Date(start_time).toISOString(),\n },\n ],\n inputs: { messages },\n execution_order,\n child_runs: [],\n child_execution_order: execution_order,\n run_type: \"llm\",\n extra: finalExtraParams ?? {},\n tags: tags || [],\n };\n return this._addRunToRunMap(run);\n }\n async handleChatModelStart(llm, messages, runId, parentRunId, extraParams, tags, metadata, name) {\n const run = this.runMap.get(runId) ??\n this._createRunForChatModelStart(llm, messages, runId, parentRunId, extraParams, tags, metadata, name);\n await this.onRunCreate?.(run);\n await this.onLLMStart?.(run);\n return run;\n }\n async handleLLMEnd(output, runId) {\n const run = this.runMap.get(runId);\n if (!run || run?.run_type !== \"llm\") {\n throw new Error(\"No LLM run to end.\");\n }\n run.end_time = Date.now();\n run.outputs = output;\n run.events.push({\n name: \"end\",\n time: new Date(run.end_time).toISOString(),\n });\n await this.onLLMEnd?.(run);\n await this._endTrace(run);\n return run;\n }\n async handleLLMError(error, runId) {\n const run = this.runMap.get(runId);\n if (!run || run?.run_type !== \"llm\") {\n throw new Error(\"No LLM run to end.\");\n }\n run.end_time = Date.now();\n run.error = this.stringifyError(error);\n run.events.push({\n name: \"error\",\n time: new Date(run.end_time).toISOString(),\n });\n await this.onLLMError?.(run);\n await this._endTrace(run);\n return run;\n }\n /**\n * Create and add a run to the run map for chain start events.\n * This must sometimes be done synchronously to avoid race conditions\n * when callbacks are backgrounded, so we expose it as a separate method here.\n */\n _createRunForChainStart(chain, inputs, runId, parentRunId, tags, metadata, runType, name) {\n const execution_order = this._getExecutionOrder(parentRunId);\n const start_time = Date.now();\n const run = {\n id: runId,\n name: name ?? chain.id[chain.id.length - 1],\n parent_run_id: parentRunId,\n start_time,\n serialized: chain,\n events: [\n {\n name: \"start\",\n time: new Date(start_time).toISOString(),\n },\n ],\n inputs,\n execution_order,\n child_execution_order: execution_order,\n run_type: runType ?? \"chain\",\n child_runs: [],\n extra: metadata ? { metadata } : {},\n tags: tags || [],\n };\n return this._addRunToRunMap(run);\n }\n async handleChainStart(chain, inputs, runId, parentRunId, tags, metadata, runType, name) {\n const run = this.runMap.get(runId) ??\n this._createRunForChainStart(chain, inputs, runId, parentRunId, tags, metadata, runType, name);\n await this.onRunCreate?.(run);\n await this.onChainStart?.(run);\n return run;\n }\n async handleChainEnd(outputs, runId, _parentRunId, _tags, kwargs) {\n const run = this.runMap.get(runId);\n if (!run) {\n throw new Error(\"No chain run to end.\");\n }\n run.end_time = Date.now();\n run.outputs = _coerceToDict(outputs, \"output\");\n run.events.push({\n name: \"end\",\n time: new Date(run.end_time).toISOString(),\n });\n if (kwargs?.inputs !== undefined) {\n run.inputs = _coerceToDict(kwargs.inputs, \"input\");\n }\n await this.onChainEnd?.(run);\n await this._endTrace(run);\n return run;\n }\n async handleChainError(error, runId, _parentRunId, _tags, kwargs) {\n const run = this.runMap.get(runId);\n if (!run) {\n throw new Error(\"No chain run to end.\");\n }\n run.end_time = Date.now();\n run.error = this.stringifyError(error);\n run.events.push({\n name: \"error\",\n time: new Date(run.end_time).toISOString(),\n });\n if (kwargs?.inputs !== undefined) {\n run.inputs = _coerceToDict(kwargs.inputs, \"input\");\n }\n await this.onChainError?.(run);\n await this._endTrace(run);\n return run;\n }\n /**\n * Create and add a run to the run map for tool start events.\n * This must sometimes be done synchronously to avoid race conditions\n * when callbacks are backgrounded, so we expose it as a separate method here.\n */\n _createRunForToolStart(tool, input, runId, parentRunId, tags, metadata, name) {\n const execution_order = this._getExecutionOrder(parentRunId);\n const start_time = Date.now();\n const run = {\n id: runId,\n name: name ?? tool.id[tool.id.length - 1],\n parent_run_id: parentRunId,\n start_time,\n serialized: tool,\n events: [\n {\n name: \"start\",\n time: new Date(start_time).toISOString(),\n },\n ],\n inputs: { input },\n execution_order,\n child_execution_order: execution_order,\n run_type: \"tool\",\n child_runs: [],\n extra: metadata ? { metadata } : {},\n tags: tags || [],\n };\n return this._addRunToRunMap(run);\n }\n async handleToolStart(tool, input, runId, parentRunId, tags, metadata, name) {\n const run = this.runMap.get(runId) ??\n this._createRunForToolStart(tool, input, runId, parentRunId, tags, metadata, name);\n await this.onRunCreate?.(run);\n await this.onToolStart?.(run);\n return run;\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n async handleToolEnd(output, runId) {\n const run = this.runMap.get(runId);\n if (!run || run?.run_type !== \"tool\") {\n throw new Error(\"No tool run to end\");\n }\n run.end_time = Date.now();\n run.outputs = { output };\n run.events.push({\n name: \"end\",\n time: new Date(run.end_time).toISOString(),\n });\n await this.onToolEnd?.(run);\n await this._endTrace(run);\n return run;\n }\n async handleToolError(error, runId) {\n const run = this.runMap.get(runId);\n if (!run || run?.run_type !== \"tool\") {\n throw new Error(\"No tool run to end\");\n }\n run.end_time = Date.now();\n run.error = this.stringifyError(error);\n run.events.push({\n name: \"error\",\n time: new Date(run.end_time).toISOString(),\n });\n await this.onToolError?.(run);\n await this._endTrace(run);\n return run;\n }\n async handleAgentAction(action, runId) {\n const run = this.runMap.get(runId);\n if (!run || run?.run_type !== \"chain\") {\n return;\n }\n const agentRun = run;\n agentRun.actions = agentRun.actions || [];\n agentRun.actions.push(action);\n agentRun.events.push({\n name: \"agent_action\",\n time: new Date().toISOString(),\n kwargs: { action },\n });\n await this.onAgentAction?.(run);\n }\n async handleAgentEnd(action, runId) {\n const run = this.runMap.get(runId);\n if (!run || run?.run_type !== \"chain\") {\n return;\n }\n run.events.push({\n name: \"agent_end\",\n time: new Date().toISOString(),\n kwargs: { action },\n });\n await this.onAgentEnd?.(run);\n }\n /**\n * Create and add a run to the run map for retriever start events.\n * This must sometimes be done synchronously to avoid race conditions\n * when callbacks are backgrounded, so we expose it as a separate method here.\n */\n _createRunForRetrieverStart(retriever, query, runId, parentRunId, tags, metadata, name) {\n const execution_order = this._getExecutionOrder(parentRunId);\n const start_time = Date.now();\n const run = {\n id: runId,\n name: name ?? retriever.id[retriever.id.length - 1],\n parent_run_id: parentRunId,\n start_time,\n serialized: retriever,\n events: [\n {\n name: \"start\",\n time: new Date(start_time).toISOString(),\n },\n ],\n inputs: { query },\n execution_order,\n child_execution_order: execution_order,\n run_type: \"retriever\",\n child_runs: [],\n extra: metadata ? { metadata } : {},\n tags: tags || [],\n };\n return this._addRunToRunMap(run);\n }\n async handleRetrieverStart(retriever, query, runId, parentRunId, tags, metadata, name) {\n const run = this.runMap.get(runId) ??\n this._createRunForRetrieverStart(retriever, query, runId, parentRunId, tags, metadata, name);\n await this.onRunCreate?.(run);\n await this.onRetrieverStart?.(run);\n return run;\n }\n async handleRetrieverEnd(documents, runId) {\n const run = this.runMap.get(runId);\n if (!run || run?.run_type !== \"retriever\") {\n throw new Error(\"No retriever run to end\");\n }\n run.end_time = Date.now();\n run.outputs = { documents };\n run.events.push({\n name: \"end\",\n time: new Date(run.end_time).toISOString(),\n });\n await this.onRetrieverEnd?.(run);\n await this._endTrace(run);\n return run;\n }\n async handleRetrieverError(error, runId) {\n const run = this.runMap.get(runId);\n if (!run || run?.run_type !== \"retriever\") {\n throw new Error(\"No retriever run to end\");\n }\n run.end_time = Date.now();\n run.error = this.stringifyError(error);\n run.events.push({\n name: \"error\",\n time: new Date(run.end_time).toISOString(),\n });\n await this.onRetrieverError?.(run);\n await this._endTrace(run);\n return run;\n }\n async handleText(text, runId) {\n const run = this.runMap.get(runId);\n if (!run || run?.run_type !== \"chain\") {\n return;\n }\n run.events.push({\n name: \"text\",\n time: new Date().toISOString(),\n kwargs: { text },\n });\n await this.onText?.(run);\n }\n async handleLLMNewToken(token, idx, runId, _parentRunId, _tags, fields) {\n const run = this.runMap.get(runId);\n if (!run || run?.run_type !== \"llm\") {\n throw new Error(`Invalid \"runId\" provided to \"handleLLMNewToken\" callback.`);\n }\n run.events.push({\n name: \"new_token\",\n time: new Date().toISOString(),\n kwargs: { token, idx, chunk: fields?.chunk },\n });\n await this.onLLMNewToken?.(run, token, { chunk: fields?.chunk });\n return run;\n }\n}\n"],"mappings":";AAAA,SAASA,mBAAmB,QAAS,sBAAsB;AAC3D;AACA,SAASC,aAAaA,CAACC,KAAK,EAAEC,UAAU,EAAE;EACtC,OAAOD,KAAK,IAAI,CAACE,KAAK,CAACC,OAAO,CAACH,KAAK,CAAC,IAAI,OAAOA,KAAK,KAAK,QAAQ,GAC5DA,KAAK,GACL;IAAE,CAACC,UAAU,GAAGD;EAAM,CAAC;AACjC;AACA,SAASI,oBAAoBA,CAACC,KAAK,EAAE;EACjC,OAAOA,KAAK,CAACC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC;AACtC;AACA,SAASC,0BAA0BA,CAACC,KAAK,EAAEC,KAAK,EAAEC,cAAc,EAAE;EAC9D,MAAMC,WAAW,GAAGD,cAAc,CAACE,OAAO,CAAC,CAAC,CAAC,CAACC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAACC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC;EAC1E,OAAQV,oBAAoB,CAAC,GAAG,IAAIW,IAAI,CAACP,KAAK,CAAC,CAACQ,WAAW,CAAC,CAAC,CAACH,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAGF,WAAW,GAAG,CAAC,GAAGF,KAAK;AACxG;AACA,OAAO,SAASQ,YAAYA,CAACC,CAAC,EAAE;EAC5B,OAAO,OAAOA,CAAC,CAACC,eAAe,KAAK,UAAU;AAClD;AACA,OAAO,MAAMC,UAAU,SAAStB,mBAAmB,CAAC;EAChDuB,WAAWA,CAAC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