mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 17:46:45 +00:00
refactor(core): All calls to supplyData should use a distinct context type (no-changelog) (#11421)
This commit is contained in:
committed by
GitHub
parent
04c075a46b
commit
8f5fe05a92
@@ -1,9 +1,9 @@
|
||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
||||
import {
|
||||
NodeConnectionType,
|
||||
type IExecuteFunctions,
|
||||
type INodeType,
|
||||
type INodeTypeDescription,
|
||||
type ISupplyDataFunctions,
|
||||
type SupplyData,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
@@ -63,7 +63,7 @@ export class RetrieverContextualCompression implements INodeType {
|
||||
properties: [],
|
||||
};
|
||||
|
||||
async supplyData(this: IExecuteFunctions, itemIndex: number): Promise<SupplyData> {
|
||||
async supplyData(this: ISupplyDataFunctions, itemIndex: number): Promise<SupplyData> {
|
||||
this.logger.debug('Supplying data for Contextual Compression Retriever');
|
||||
|
||||
const model = (await this.getInputConnectionData(
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
||||
import {
|
||||
NodeConnectionType,
|
||||
type IExecuteFunctions,
|
||||
type INodeType,
|
||||
type INodeTypeDescription,
|
||||
type ISupplyDataFunctions,
|
||||
type SupplyData,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
@@ -82,7 +82,7 @@ export class RetrieverMultiQuery implements INodeType {
|
||||
],
|
||||
};
|
||||
|
||||
async supplyData(this: IExecuteFunctions, itemIndex: number): Promise<SupplyData> {
|
||||
async supplyData(this: ISupplyDataFunctions, itemIndex: number): Promise<SupplyData> {
|
||||
this.logger.debug('Supplying data for MultiQuery Retriever');
|
||||
|
||||
const options = this.getNodeParameter('options', itemIndex, {}) as { queryCount?: number };
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
||||
import {
|
||||
NodeConnectionType,
|
||||
type IExecuteFunctions,
|
||||
type INodeType,
|
||||
type INodeTypeDescription,
|
||||
type ISupplyDataFunctions,
|
||||
type SupplyData,
|
||||
} from 'n8n-workflow';
|
||||
import type { VectorStore } from '@langchain/core/vectorstores';
|
||||
@@ -56,7 +56,7 @@ export class RetrieverVectorStore implements INodeType {
|
||||
],
|
||||
};
|
||||
|
||||
async supplyData(this: IExecuteFunctions, itemIndex: number): Promise<SupplyData> {
|
||||
async supplyData(this: ISupplyDataFunctions, itemIndex: number): Promise<SupplyData> {
|
||||
this.logger.debug('Supplying data for Vector Store Retriever');
|
||||
|
||||
const topK = this.getNodeParameter('topK', itemIndex, 4) as number;
|
||||
|
||||
@@ -5,7 +5,7 @@ import type {
|
||||
IExecuteWorkflowInfo,
|
||||
INodeExecutionData,
|
||||
IWorkflowBase,
|
||||
IExecuteFunctions,
|
||||
ISupplyDataFunctions,
|
||||
INodeType,
|
||||
INodeTypeDescription,
|
||||
SupplyData,
|
||||
@@ -292,15 +292,15 @@ export class RetrieverWorkflow implements INodeType {
|
||||
],
|
||||
};
|
||||
|
||||
async supplyData(this: IExecuteFunctions, itemIndex: number): Promise<SupplyData> {
|
||||
async supplyData(this: ISupplyDataFunctions, itemIndex: number): Promise<SupplyData> {
|
||||
class WorkflowRetriever extends BaseRetriever {
|
||||
lc_namespace = ['n8n-nodes-langchain', 'retrievers', 'workflow'];
|
||||
|
||||
executeFunctions: IExecuteFunctions;
|
||||
|
||||
constructor(executeFunctions: IExecuteFunctions, fields: BaseRetrieverInput) {
|
||||
constructor(
|
||||
private executeFunctions: ISupplyDataFunctions,
|
||||
fields: BaseRetrieverInput,
|
||||
) {
|
||||
super(fields);
|
||||
this.executeFunctions = executeFunctions;
|
||||
}
|
||||
|
||||
async _getRelevantDocuments(
|
||||
|
||||
Reference in New Issue
Block a user