mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
fix: Fix execution error when using AI chain nodes with non-chat model (#8724)
Signed-off-by: Oleg Ivaniv <me@olegivaniv.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/* eslint-disable n8n-nodes-base/node-filename-against-convention */
|
||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
||||
import type { VectorStore } from 'langchain/vectorstores/base';
|
||||
import { NodeConnectionType, NodeOperationError, jsonStringify } from 'n8n-workflow';
|
||||
import { NodeConnectionType, NodeOperationError } from 'n8n-workflow';
|
||||
import type {
|
||||
INodeCredentialDescription,
|
||||
INodeProperties,
|
||||
@@ -18,7 +18,7 @@ import type { Document } from 'langchain/document';
|
||||
import { logWrapper } from '../../../utils/logWrapper';
|
||||
import type { N8nJsonLoader } from '../../../utils/N8nJsonLoader';
|
||||
import type { N8nBinaryLoader } from '../../../utils/N8nBinaryLoader';
|
||||
import { getMetadataFiltersValues } from '../../../utils/helpers';
|
||||
import { getMetadataFiltersValues, logAiEvent } from '../../../utils/helpers';
|
||||
import { getConnectionHintNoticeField } from '../../../utils/sharedFields';
|
||||
import { processDocument } from './processDocuments';
|
||||
|
||||
@@ -237,7 +237,7 @@ export const createVectorStoreNode = (args: VectorStoreNodeConstructorArgs) =>
|
||||
});
|
||||
|
||||
resultData.push(...serializedDocs);
|
||||
void this.logAiEvent('n8n.ai.vector.store.searched', jsonStringify({ query: prompt }));
|
||||
void logAiEvent(this, 'n8n.ai.vector.store.searched', { query: prompt });
|
||||
}
|
||||
|
||||
return await this.prepareOutputData(resultData);
|
||||
@@ -264,7 +264,7 @@ export const createVectorStoreNode = (args: VectorStoreNodeConstructorArgs) =>
|
||||
try {
|
||||
await args.populateVectorStore(this, embeddings, processedDocuments, itemIndex);
|
||||
|
||||
void this.logAiEvent('n8n.ai.vector.store.populated');
|
||||
void logAiEvent(this, 'n8n.ai.vector.store.populated');
|
||||
} catch (error) {
|
||||
throw error;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user