mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
refactor(core): Include AI events in log streaming relay (#10768)
This commit is contained in:
@@ -138,7 +138,7 @@ export class N8nLlmTracing extends BaseCallbackHandler {
|
||||
this.executionFunctions.addOutputData(this.connectionType, runDetails.index, [
|
||||
[{ json: { ...response } }],
|
||||
]);
|
||||
void logAiEvent(this.executionFunctions, 'n8n.ai.llm.generated', {
|
||||
void logAiEvent(this.executionFunctions, 'ai-llm-generated-output', {
|
||||
messages: parsedMessages,
|
||||
options: runDetails.options,
|
||||
response,
|
||||
@@ -186,7 +186,7 @@ export class N8nLlmTracing extends BaseCallbackHandler {
|
||||
});
|
||||
}
|
||||
|
||||
void logAiEvent(this.executionFunctions, 'n8n.ai.llm.error', {
|
||||
void logAiEvent(this.executionFunctions, 'ai-llm-errored', {
|
||||
error: Object.keys(error).length === 0 ? error.toString() : error,
|
||||
runId,
|
||||
parentRunId,
|
||||
|
||||
@@ -280,7 +280,7 @@ export const createVectorStoreNode = (args: VectorStoreNodeConstructorArgs) =>
|
||||
});
|
||||
|
||||
resultData.push(...serializedDocs);
|
||||
void logAiEvent(this, 'n8n.ai.vector.store.searched', { query: prompt });
|
||||
void logAiEvent(this, 'ai-vector-store-searched', { query: prompt });
|
||||
}
|
||||
|
||||
return [resultData];
|
||||
@@ -307,7 +307,7 @@ export const createVectorStoreNode = (args: VectorStoreNodeConstructorArgs) =>
|
||||
try {
|
||||
await args.populateVectorStore(this, embeddings, processedDocuments, itemIndex);
|
||||
|
||||
void logAiEvent(this, 'n8n.ai.vector.store.populated');
|
||||
void logAiEvent(this, 'ai-vector-store-populated');
|
||||
} catch (error) {
|
||||
throw error;
|
||||
}
|
||||
@@ -361,7 +361,7 @@ export const createVectorStoreNode = (args: VectorStoreNodeConstructorArgs) =>
|
||||
ids: [documentId],
|
||||
});
|
||||
|
||||
void logAiEvent(this, 'n8n.ai.vector.store.updated');
|
||||
void logAiEvent(this, 'ai-vector-store-updated');
|
||||
} catch (error) {
|
||||
throw error;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user