refactor(core): Include AI events in log streaming relay (#10768)

This commit is contained in:
Iván Ovejero
2024-09-12 12:02:47 +02:00
committed by GitHub
parent 8240b2a142
commit c133a6ef89
15 changed files with 496 additions and 92 deletions

View File

@@ -39,7 +39,6 @@ import type {
BinaryHelperFunctions,
CloseFunction,
ContextType,
EventNamesAiNodesType,
FieldType,
FileSystemHelperFunctions,
FunctionsBase,
@@ -102,6 +101,7 @@ import type {
EnsureTypeOptions,
SSHTunnelFunctions,
SchedulingFunctions,
AiEvent,
} from 'n8n-workflow';
import {
NodeConnectionType,
@@ -3888,8 +3888,8 @@ export function getExecuteFunctions(
constructExecutionMetaData,
},
nodeHelpers: getNodeHelperFunctions(additionalData, workflow.id),
logAiEvent: async (eventName: EventNamesAiNodesType, msg: string) => {
return await additionalData.logAiEvent(eventName, {
logAiEvent: async (eventName: AiEvent, msg: string) => {
return additionalData.logAiEvent(eventName, {
executionId: additionalData.executionId ?? 'unsaved-execution',
nodeName: node.name,
workflowName: workflow.name ?? 'Unnamed workflow',
@@ -4039,8 +4039,8 @@ export function getExecuteSingleFunctions(
getBinaryDataBuffer: async (propertyName, inputIndex = 0) =>
await getBinaryDataBuffer(inputData, itemIndex, propertyName, inputIndex),
},
logAiEvent: async (eventName: EventNamesAiNodesType, msg: string) => {
return await additionalData.logAiEvent(eventName, {
logAiEvent: async (eventName: AiEvent, msg: string) => {
return additionalData.logAiEvent(eventName, {
executionId: additionalData.executionId ?? 'unsaved-execution',
nodeName: node.name,
workflowName: workflow.name ?? 'Unnamed workflow',