Skip to content

Commit

Permalink
fix(Pinecone Vector Store Node): Prevent populating of vectors after …
Browse files Browse the repository at this point in the history
…manually stopping the execution (n8n-io#11288)
  • Loading branch information
OlegIvaniv authored Oct 17, 2024
1 parent 1f441f9 commit fbae17d
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/* eslint-disable n8n-nodes-base/node-filename-against-convention */
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
import type { Document } from '@langchain/core/documents';
import type { Embeddings } from '@langchain/core/embeddings';
import type { VectorStore } from '@langchain/core/vectorstores';
import { NodeConnectionType, NodeOperationError } from 'n8n-workflow';
import type {
Expand All @@ -15,14 +17,13 @@ import type {
Icon,
INodePropertyOptions,
} from 'n8n-workflow';
import type { Embeddings } from '@langchain/core/embeddings';
import type { Document } from '@langchain/core/documents';

import { processDocument } from './processDocuments';
import { getMetadataFiltersValues, logAiEvent } from '../../../utils/helpers';
import { logWrapper } from '../../../utils/logWrapper';
import { N8nJsonLoader } from '../../../utils/N8nJsonLoader';
import type { N8nBinaryLoader } from '../../../utils/N8nBinaryLoader';
import { getMetadataFiltersValues, logAiEvent } from '../../../utils/helpers';
import { N8nJsonLoader } from '../../../utils/N8nJsonLoader';
import { getConnectionHintNoticeField } from '../../../utils/sharedFields';
import { processDocument } from './processDocuments';

type NodeOperationMode = 'insert' | 'load' | 'retrieve' | 'update';

Expand Down Expand Up @@ -296,6 +297,9 @@ export const createVectorStoreNode = (args: VectorStoreNodeConstructorArgs) =>

const resultData = [];
for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
if (this.getExecutionCancelSignal()?.aborted) {
break;
}
const itemData = items[itemIndex];
const { processedDocuments, serializedDocuments } = await processDocument(
documentInput,
Expand Down

0 comments on commit fbae17d

Please sign in to comment.