fix types

This commit is contained in:
Mutasem Aldmour 2024-11-11 18:15:01 +01:00
parent 785b30e675
commit 597aa3ee3b
No known key found for this signature in database
GPG key ID: 3DFA8122BB7FD6B8

View file

@ -17,7 +17,6 @@ import { Document } from '@langchain/core/documents';
import type { SetField, SetNodeOptions } from 'n8n-nodes-base/dist/nodes/Set/v2/helpers/interfaces'; import type { SetField, SetNodeOptions } from 'n8n-nodes-base/dist/nodes/Set/v2/helpers/interfaces';
import * as manual from 'n8n-nodes-base/dist/nodes/Set/v2/manual.mode'; import * as manual from 'n8n-nodes-base/dist/nodes/Set/v2/manual.mode';
import get from 'lodash/get';
import type { CallbackManagerForRetrieverRun } from '@langchain/core/callbacks/manager'; import type { CallbackManagerForRetrieverRun } from '@langchain/core/callbacks/manager';
import { logWrapper } from '../../../utils/logWrapper'; import { logWrapper } from '../../../utils/logWrapper';
@ -411,8 +410,7 @@ export class RetrieverWorkflow implements INodeType {
throw new NodeOperationError(this.executeFunctions.getNode(), error as Error); throw new NodeOperationError(this.executeFunctions.getNode(), error as Error);
} }
// eslint-disable-next-line lodash/path-style const receivedItems = receivedData.data?.[0] ?? [];
const receivedItems = get(receivedData, ['data', 0]) ?? [];
const returnData: Document[] = []; const returnData: Document[] = [];
for (const [index, itemData] of receivedItems.entries()) { for (const [index, itemData] of receivedItems.entries()) {