mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
feat: Add support for AI log streaming (#8526)
Co-authored-by: Oleg Ivaniv <me@olegivaniv.com>
This commit is contained in:
@@ -787,6 +787,7 @@ type BaseExecutionFunctions = FunctionsBaseWithRequiredKeys<'getMode'> & {
|
||||
getInputSourceData(inputIndex?: number, inputName?: string): ISourceData;
|
||||
getExecutionCancelSignal(): AbortSignal | undefined;
|
||||
onExecutionCancellation(handler: () => unknown): void;
|
||||
logAiEvent(eventName: EventNamesAiNodesType, msg?: string | undefined): Promise<void>;
|
||||
};
|
||||
|
||||
// TODO: Create later own type only for Config-Nodes
|
||||
@@ -1945,6 +1946,24 @@ export interface IWorkflowExecuteHooks {
|
||||
sendResponse?: Array<(response: IExecuteResponsePromiseData) => Promise<void>>;
|
||||
}
|
||||
|
||||
export const eventNamesAiNodes = [
|
||||
'n8n.ai.memory.get.messages',
|
||||
'n8n.ai.memory.added.message',
|
||||
'n8n.ai.output.parser.get.instructions',
|
||||
'n8n.ai.output.parser.parsed',
|
||||
'n8n.ai.retriever.get.relevant.documents',
|
||||
'n8n.ai.embeddings.embedded.document',
|
||||
'n8n.ai.embeddings.embedded.query',
|
||||
'n8n.ai.document.processed',
|
||||
'n8n.ai.text.splitter.split',
|
||||
'n8n.ai.tool.called',
|
||||
'n8n.ai.vector.store.searched',
|
||||
'n8n.ai.llm.generated',
|
||||
'n8n.ai.vector.store.populated',
|
||||
] as const;
|
||||
|
||||
export type EventNamesAiNodesType = (typeof eventNamesAiNodes)[number];
|
||||
|
||||
export interface IWorkflowExecuteAdditionalData {
|
||||
credentialsHelper: ICredentialsHelper;
|
||||
executeWorkflow: (
|
||||
@@ -1978,6 +1997,17 @@ export interface IWorkflowExecuteAdditionalData {
|
||||
userId: string;
|
||||
variables: IDataObject;
|
||||
secretsHelpers: SecretsHelpersBase;
|
||||
logAiEvent: (
|
||||
eventName: EventNamesAiNodesType,
|
||||
payload: {
|
||||
msg?: string;
|
||||
executionId: string;
|
||||
nodeName: string;
|
||||
workflowId?: string;
|
||||
workflowName: string;
|
||||
nodeType?: string;
|
||||
},
|
||||
) => Promise<void>;
|
||||
}
|
||||
|
||||
export type WorkflowExecuteMode =
|
||||
|
||||
@@ -11,6 +11,7 @@ export const enum EventMessageTypeNames {
|
||||
confirm = '$$EventMessageConfirm',
|
||||
workflow = '$$EventMessageWorkflow',
|
||||
node = '$$EventMessageNode',
|
||||
aiNode = '$$EventMessageAiNode',
|
||||
}
|
||||
|
||||
export const enum MessageEventBusDestinationTypeNames {
|
||||
|
||||
Reference in New Issue
Block a user