feat: track优化

This commit is contained in:
ai-business-hql
2025-04-09 19:06:04 +08:00
parent a258fa8d62
commit ffecbcd0aa
5 changed files with 25 additions and 10 deletions
@@ -854,6 +854,21 @@ export const ParameterDebugInterface: React.FC<ParameterDebugInterfaceProps> = (
console.log(`Applied image ${selectedImageIndex + 1} with parameters:`, generatedImages[selectedImageIndex].params);
// 发送埋点事件
let count_temp = 1;
// Calculate total parameter combinations
if (paramTestValues) {
for (const nodeId in paramTestValues) {
if (paramTestValues[nodeId] && paramTestValues[nodeId].values) {
for (const paramName in paramTestValues[nodeId].values) {
const paramOptions = paramTestValues[nodeId].values[paramName];
if (Array.isArray(paramOptions) && paramOptions.length > 0) {
count_temp = count_temp * paramOptions.length;
}
}
}
}
}
WorkflowChatAPI.trackEvent({
event_type: 'parameter_debug_apply',
message_type: 'parameter_debug',
@@ -862,7 +877,7 @@ export const ParameterDebugInterface: React.FC<ParameterDebugInterfaceProps> = (
workflow: (await app.graphToPrompt()).output,
selected_params: generatedImages[selectedImageIndex].params,
all_params: paramTestValues,
count: Object.keys(paramTestValues).length
count: count_temp
}
});