chore: Lintfix @n8n/nodes-langchain (#16868)

This commit is contained in:
Iván Ovejero
2025-07-01 14:08:51 +02:00
committed by GitHub
parent 1958b89d38
commit 9ffca02016
89 changed files with 144 additions and 246 deletions

View File

@@ -165,7 +165,7 @@ export class VectorStoreInMemory extends createVectorStoreNode<MemoryVectorStore
this.logger,
);
const memoryKey = !!name ? (name as string) : DEFAULT_MEMORY_KEY;
const memoryKey = name ? (name as string) : DEFAULT_MEMORY_KEY;
await vectorStoreSingleton.getVectorStore(memoryKey);
return memoryKey;

View File

@@ -1,4 +1,3 @@
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
import type { Embeddings } from '@langchain/core/embeddings';
import type { Document } from 'langchain/document';
import {
@@ -40,7 +39,7 @@ export class VectorStoreInMemoryInsert implements INodeType {
],
},
},
// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
inputs: [
NodeConnectionTypes.Main,
{

View File

@@ -1,4 +1,3 @@
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
import type { Embeddings } from '@langchain/core/embeddings';
import {
NodeConnectionTypes,
@@ -38,7 +37,7 @@ export class VectorStoreInMemoryLoad implements INodeType {
],
},
},
// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
inputs: [
{
displayName: 'Embedding',

View File

@@ -254,7 +254,7 @@ export class VectorStorePGVector extends createVectorStoreNode<ExtendedPGVectorS
{},
) as CollectionOptions;
if (collectionOptions && collectionOptions.useCollection) {
if (collectionOptions?.useCollection) {
config.collectionName = collectionOptions.collectionName;
config.collectionTableName = collectionOptions.collectionTableName;
}
@@ -296,7 +296,7 @@ export class VectorStorePGVector extends createVectorStoreNode<ExtendedPGVectorS
{},
) as CollectionOptions;
if (collectionOptions && collectionOptions.useCollection) {
if (collectionOptions?.useCollection) {
config.collectionName = collectionOptions.collectionName;
config.collectionTableName = collectionOptions.collectionTableName;
}

View File

@@ -22,12 +22,7 @@ class ExtendedQdrantVectorStore extends QdrantVectorStore {
return await super.fromExistingCollection(embeddings, args);
}
async similaritySearch(
query: string,
k: number,
filter?: IDataObject,
callbacks?: Callbacks | undefined,
) {
async similaritySearch(query: string, k: number, filter?: IDataObject, callbacks?: Callbacks) {
const mergedFilter = { ...ExtendedQdrantVectorStore.defaultFilter, ...filter };
return await super.similaritySearch(query, k, mergedFilter, callbacks);
}

View File

@@ -97,7 +97,6 @@ export class VectorStoreSupabaseLoad implements INodeType {
0,
)) as Embeddings;
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
const client = createClient(credentials.host as string, credentials.serviceRole as string);
const config: SupabaseLibArgs = {
client,

View File

@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/dot-notation */
import { Document } from '@langchain/core/documents';
import type { OpenAIEmbeddings } from '@langchain/openai';
import { mock } from 'jest-mock-extended';

View File

@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/dot-notation */
import { mock } from 'jest-mock-extended';
import type { MemoryVectorStore } from 'langchain/vectorstores/memory';

View File

@@ -1,5 +1,3 @@
/* eslint-disable n8n-nodes-base/node-filename-against-convention */
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
import type { Embeddings } from '@langchain/core/embeddings';
import type { VectorStore } from '@langchain/core/vectorstores';
import { NodeConnectionTypes, NodeOperationError } from 'n8n-workflow';
@@ -77,7 +75,7 @@ export const createVectorStoreNode = <T extends VectorStore = VectorStore>(
},
},
credentials: args.meta.credentials,
// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
inputs: `={{
((parameters) => {
const mode = parameters?.mode;