n8n
Version:
n8n Workflow Automation Tool
27 lines • 978 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.createAgentExecutionCounter = createAgentExecutionCounter;
function createAgentExecutionCounter(telemetry, { agentId, userId, runType, }) {
const attribution = userId ? { user_id: userId } : {};
return {
incrementMessageCount: () => telemetry.trackAgentExecution({
agent_id: agentId,
...attribution,
run_type: runType,
message_count: 1,
}),
incrementTokenCount: (tokenCount) => telemetry.trackAgentExecution({
agent_id: agentId,
...attribution,
run_type: runType,
token_count: tokenCount,
}),
incrementToolCallCount: () => telemetry.trackAgentExecution({
agent_id: agentId,
...attribution,
run_type: runType,
tool_call_count: 1,
}),
};
}
//# sourceMappingURL=agent-execution-counter.js.map