mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
chore: Lintfix @n8n/nodes-langchain (#16868)
This commit is contained in:
@@ -1,5 +1,3 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
|
||||||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
|
||||||
import type { BaseChatModel } from '@langchain/core/language_models/chat_models';
|
import type { BaseChatModel } from '@langchain/core/language_models/chat_models';
|
||||||
import { mock } from 'jest-mock-extended';
|
import { mock } from 'jest-mock-extended';
|
||||||
import type { ISupplyDataFunctions, INode, ILoadOptionsFunctions } from 'n8n-workflow';
|
import type { ISupplyDataFunctions, INode, ILoadOptionsFunctions } from 'n8n-workflow';
|
||||||
|
|||||||
@@ -67,9 +67,7 @@ function getInputs(
|
|||||||
type,
|
type,
|
||||||
displayName,
|
displayName,
|
||||||
required: isModelType,
|
required: isModelType,
|
||||||
maxConnections: ['ai_languageModel', 'ai_memory', 'ai_outputParser'].includes(
|
maxConnections: ['ai_languageModel', 'ai_memory', 'ai_outputParser'].includes(type)
|
||||||
type as NodeConnectionType,
|
|
||||||
)
|
|
||||||
? 1
|
? 1
|
||||||
: undefined,
|
: undefined,
|
||||||
};
|
};
|
||||||
@@ -278,7 +276,6 @@ export class AgentV1 implements INodeType {
|
|||||||
outputs: [NodeConnectionTypes.Main],
|
outputs: [NodeConnectionTypes.Main],
|
||||||
credentials: [
|
credentials: [
|
||||||
{
|
{
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-credentials-name-unsuffixed
|
|
||||||
name: 'mySql',
|
name: 'mySql',
|
||||||
required: true,
|
required: true,
|
||||||
testedBy: 'mysqlConnectionTest',
|
testedBy: 'mysqlConnectionTest',
|
||||||
|
|||||||
@@ -36,9 +36,7 @@ function getInputs(
|
|||||||
type,
|
type,
|
||||||
displayName,
|
displayName,
|
||||||
required,
|
required,
|
||||||
maxConnections: ['ai_languageModel', 'ai_memory', 'ai_outputParser'].includes(
|
maxConnections: ['ai_languageModel', 'ai_memory', 'ai_outputParser'].includes(type)
|
||||||
type as NodeConnectionType,
|
|
||||||
)
|
|
||||||
? 1
|
? 1
|
||||||
: undefined,
|
: undefined,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -61,7 +61,6 @@ export const sqlAgentAgentProperties: INodeProperties[] = [
|
|||||||
default: '',
|
default: '',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
|
|
||||||
displayName:
|
displayName:
|
||||||
"Pass the SQLite database into this node as binary data, e.g. by inserting a 'Read/Write Files from Disk' node beforehand",
|
"Pass the SQLite database into this node as binary data, e.g. by inserting a 'Read/Write Files from Disk' node beforehand",
|
||||||
name: 'sqLiteFileNotice',
|
name: 'sqLiteFileNotice',
|
||||||
|
|||||||
@@ -103,7 +103,6 @@ export function fixEmptyContentMessage(
|
|||||||
if (Array.isArray(step.messageLog)) {
|
if (Array.isArray(step.messageLog)) {
|
||||||
step.messageLog.forEach((message: BaseMessage) => {
|
step.messageLog.forEach((message: BaseMessage) => {
|
||||||
if ('content' in message && Array.isArray(message.content)) {
|
if ('content' in message && Array.isArray(message.content)) {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
||||||
(message.content as Array<{ input?: string | object }>).forEach((content) => {
|
(message.content as Array<{ input?: string | object }>).forEach((content) => {
|
||||||
if (content.input === '') {
|
if (content.input === '') {
|
||||||
content.input = {};
|
content.input = {};
|
||||||
|
|||||||
@@ -198,7 +198,7 @@ export class OpenAiAssistant implements INodeType {
|
|||||||
properties: {
|
properties: {
|
||||||
name: '={{$responseItem.name}}',
|
name: '={{$responseItem.name}}',
|
||||||
value: '={{$responseItem.id}}',
|
value: '={{$responseItem.id}}',
|
||||||
// eslint-disable-next-line n8n-local-rules/no-interpolation-in-regular-string
|
|
||||||
description: '={{$responseItem.model}}',
|
description: '={{$responseItem.model}}',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
|
||||||
import { HumanMessage } from '@langchain/core/messages';
|
import { HumanMessage } from '@langchain/core/messages';
|
||||||
import { ChatGoogleGenerativeAI } from '@langchain/google-genai';
|
import { ChatGoogleGenerativeAI } from '@langchain/google-genai';
|
||||||
import { ChatOllama } from '@langchain/ollama';
|
import { ChatOllama } from '@langchain/ollama';
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ export class ChainRetrievalQa implements INodeType {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
|
|
||||||
inputs: [
|
inputs: [
|
||||||
NodeConnectionTypes.Main,
|
NodeConnectionTypes.Main,
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ export class ChainSummarizationV1 implements INodeType {
|
|||||||
name: 'Summarization Chain',
|
name: 'Summarization Chain',
|
||||||
color: '#909298',
|
color: '#909298',
|
||||||
},
|
},
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
|
|
||||||
inputs: [
|
inputs: [
|
||||||
NodeConnectionTypes.Main,
|
NodeConnectionTypes.Main,
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ export class ChainSummarizationV2 implements INodeType {
|
|||||||
name: 'Summarization Chain',
|
name: 'Summarization Chain',
|
||||||
color: '#909298',
|
color: '#909298',
|
||||||
},
|
},
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
|
|
||||||
inputs: `={{ ((parameter) => { ${getInputs.toString()}; return getInputs(parameter) })($parameter) }}`,
|
inputs: `={{ ((parameter) => { ${getInputs.toString()}; return getInputs(parameter) })($parameter) }}`,
|
||||||
outputs: [NodeConnectionTypes.Main],
|
outputs: [NodeConnectionTypes.Main],
|
||||||
credentials: [],
|
credentials: [],
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
|
||||||
import type { Tool } from '@langchain/core/tools';
|
import type { Tool } from '@langchain/core/tools';
|
||||||
import { makeResolverFromLegacyOptions } from '@n8n/vm2';
|
import { makeResolverFromLegacyOptions } from '@n8n/vm2';
|
||||||
import { JavaScriptSandbox } from 'n8n-nodes-base/dist/nodes/Code/JavaScriptSandbox';
|
import { JavaScriptSandbox } from 'n8n-nodes-base/dist/nodes/Code/JavaScriptSandbox';
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
|
||||||
import type { TextSplitter } from '@langchain/textsplitters';
|
import type { TextSplitter } from '@langchain/textsplitters';
|
||||||
import {
|
import {
|
||||||
NodeConnectionTypes,
|
NodeConnectionTypes,
|
||||||
@@ -46,7 +45,7 @@ export class DocumentBinaryInputLoader implements INodeType {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
|
|
||||||
inputs: [
|
inputs: [
|
||||||
{
|
{
|
||||||
displayName: 'Text Splitter',
|
displayName: 'Text Splitter',
|
||||||
@@ -55,7 +54,7 @@ export class DocumentBinaryInputLoader implements INodeType {
|
|||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
|
||||||
outputs: [NodeConnectionTypes.AiDocument],
|
outputs: [NodeConnectionTypes.AiDocument],
|
||||||
outputNames: ['Document'],
|
outputNames: ['Document'],
|
||||||
properties: [
|
properties: [
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
|
||||||
import { RecursiveCharacterTextSplitter, type TextSplitter } from '@langchain/textsplitters';
|
import { RecursiveCharacterTextSplitter, type TextSplitter } from '@langchain/textsplitters';
|
||||||
import {
|
import {
|
||||||
NodeConnectionTypes,
|
NodeConnectionTypes,
|
||||||
@@ -64,9 +63,9 @@ export class DocumentDefaultDataLoader implements INodeType {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
|
|
||||||
inputs: `={{ ((parameter) => { ${getInputs.toString()}; return getInputs(parameter) })($parameter) }}`,
|
inputs: `={{ ((parameter) => { ${getInputs.toString()}; return getInputs(parameter) })($parameter) }}`,
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
|
||||||
outputs: [NodeConnectionTypes.AiDocument],
|
outputs: [NodeConnectionTypes.AiDocument],
|
||||||
outputNames: ['Document'],
|
outputNames: ['Document'],
|
||||||
properties: [
|
properties: [
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
|
||||||
import { GithubRepoLoader } from '@langchain/community/document_loaders/web/github';
|
import { GithubRepoLoader } from '@langchain/community/document_loaders/web/github';
|
||||||
import type { TextSplitter } from '@langchain/textsplitters';
|
import type { TextSplitter } from '@langchain/textsplitters';
|
||||||
import { RecursiveCharacterTextSplitter } from '@langchain/textsplitters';
|
import { RecursiveCharacterTextSplitter } from '@langchain/textsplitters';
|
||||||
@@ -63,10 +62,10 @@ export class DocumentGithubLoader implements INodeType {
|
|||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
|
|
||||||
inputs: `={{ ((parameter) => { ${getInputs.toString()}; return getInputs(parameter) })($parameter) }}`,
|
inputs: `={{ ((parameter) => { ${getInputs.toString()}; return getInputs(parameter) })($parameter) }}`,
|
||||||
inputNames: ['Text Splitter'],
|
inputNames: ['Text Splitter'],
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
|
||||||
outputs: [NodeConnectionTypes.AiDocument],
|
outputs: [NodeConnectionTypes.AiDocument],
|
||||||
outputNames: ['Document'],
|
outputNames: ['Document'],
|
||||||
properties: [
|
properties: [
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
|
||||||
import type { TextSplitter } from '@langchain/textsplitters';
|
import type { TextSplitter } from '@langchain/textsplitters';
|
||||||
import {
|
import {
|
||||||
NodeConnectionTypes,
|
NodeConnectionTypes,
|
||||||
@@ -39,7 +38,7 @@ export class DocumentJsonInputLoader implements INodeType {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
|
|
||||||
inputs: [
|
inputs: [
|
||||||
{
|
{
|
||||||
displayName: 'Text Splitter',
|
displayName: 'Text Splitter',
|
||||||
@@ -48,7 +47,7 @@ export class DocumentJsonInputLoader implements INodeType {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
inputNames: ['Text Splitter'],
|
inputNames: ['Text Splitter'],
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
|
||||||
outputs: [NodeConnectionTypes.AiDocument],
|
outputs: [NodeConnectionTypes.AiDocument],
|
||||||
outputNames: ['Document'],
|
outputNames: ['Document'],
|
||||||
properties: [
|
properties: [
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
|
||||||
import { BedrockEmbeddings } from '@langchain/aws';
|
import { BedrockEmbeddings } from '@langchain/aws';
|
||||||
import {
|
import {
|
||||||
NodeConnectionTypes,
|
NodeConnectionTypes,
|
||||||
@@ -42,9 +41,9 @@ export class EmbeddingsAwsBedrock implements INodeType {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
|
|
||||||
inputs: [],
|
inputs: [],
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
|
||||||
outputs: [NodeConnectionTypes.AiEmbedding],
|
outputs: [NodeConnectionTypes.AiEmbedding],
|
||||||
outputNames: ['Embeddings'],
|
outputNames: ['Embeddings'],
|
||||||
requestDefaults: {
|
requestDefaults: {
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
|
||||||
import { AzureOpenAIEmbeddings } from '@langchain/openai';
|
import { AzureOpenAIEmbeddings } from '@langchain/openai';
|
||||||
import {
|
import {
|
||||||
NodeConnectionTypes,
|
NodeConnectionTypes,
|
||||||
@@ -42,9 +41,9 @@ export class EmbeddingsAzureOpenAi implements INodeType {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
|
|
||||||
inputs: [],
|
inputs: [],
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
|
||||||
outputs: [NodeConnectionTypes.AiEmbedding],
|
outputs: [NodeConnectionTypes.AiEmbedding],
|
||||||
outputNames: ['Embeddings'],
|
outputNames: ['Embeddings'],
|
||||||
properties: [
|
properties: [
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
|
||||||
import { CohereEmbeddings } from '@langchain/cohere';
|
import { CohereEmbeddings } from '@langchain/cohere';
|
||||||
import {
|
import {
|
||||||
NodeConnectionTypes,
|
NodeConnectionTypes,
|
||||||
@@ -45,9 +44,9 @@ export class EmbeddingsCohere implements INodeType {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
|
|
||||||
inputs: [],
|
inputs: [],
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
|
||||||
outputs: [NodeConnectionTypes.AiEmbedding],
|
outputs: [NodeConnectionTypes.AiEmbedding],
|
||||||
outputNames: ['Embeddings'],
|
outputNames: ['Embeddings'],
|
||||||
properties: [
|
properties: [
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
|
||||||
import { GoogleGenerativeAIEmbeddings } from '@langchain/google-genai';
|
import { GoogleGenerativeAIEmbeddings } from '@langchain/google-genai';
|
||||||
import {
|
import {
|
||||||
NodeConnectionTypes,
|
NodeConnectionTypes,
|
||||||
@@ -45,9 +44,9 @@ export class EmbeddingsGoogleGemini implements INodeType {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
|
|
||||||
inputs: [],
|
inputs: [],
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
|
||||||
outputs: [NodeConnectionTypes.AiEmbedding],
|
outputs: [NodeConnectionTypes.AiEmbedding],
|
||||||
outputNames: ['Embeddings'],
|
outputNames: ['Embeddings'],
|
||||||
properties: [
|
properties: [
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
|
||||||
import { ProjectsClient } from '@google-cloud/resource-manager';
|
import { ProjectsClient } from '@google-cloud/resource-manager';
|
||||||
import { VertexAIEmbeddings } from '@langchain/google-vertexai';
|
import { VertexAIEmbeddings } from '@langchain/google-vertexai';
|
||||||
import { formatPrivateKey } from 'n8n-nodes-base/dist/utils/utilities';
|
import { formatPrivateKey } from 'n8n-nodes-base/dist/utils/utilities';
|
||||||
@@ -80,9 +79,9 @@ export class EmbeddingsGoogleVertex implements INodeType {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
|
|
||||||
inputs: [],
|
inputs: [],
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
|
||||||
outputs: [NodeConnectionTypes.AiEmbedding],
|
outputs: [NodeConnectionTypes.AiEmbedding],
|
||||||
outputNames: ['Embeddings'],
|
outputNames: ['Embeddings'],
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
|
||||||
import { HuggingFaceInferenceEmbeddings } from '@langchain/community/embeddings/hf';
|
import { HuggingFaceInferenceEmbeddings } from '@langchain/community/embeddings/hf';
|
||||||
import {
|
import {
|
||||||
NodeConnectionTypes,
|
NodeConnectionTypes,
|
||||||
@@ -41,9 +40,9 @@ export class EmbeddingsHuggingFaceInference implements INodeType {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
|
|
||||||
inputs: [],
|
inputs: [],
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
|
||||||
outputs: [NodeConnectionTypes.AiEmbedding],
|
outputs: [NodeConnectionTypes.AiEmbedding],
|
||||||
outputNames: ['Embeddings'],
|
outputNames: ['Embeddings'],
|
||||||
properties: [
|
properties: [
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
|
||||||
import type { MistralAIEmbeddingsParams } from '@langchain/mistralai';
|
import type { MistralAIEmbeddingsParams } from '@langchain/mistralai';
|
||||||
import { MistralAIEmbeddings } from '@langchain/mistralai';
|
import { MistralAIEmbeddings } from '@langchain/mistralai';
|
||||||
import {
|
import {
|
||||||
@@ -43,9 +42,9 @@ export class EmbeddingsMistralCloud implements INodeType {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
|
|
||||||
inputs: [],
|
inputs: [],
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
|
||||||
outputs: [NodeConnectionTypes.AiEmbedding],
|
outputs: [NodeConnectionTypes.AiEmbedding],
|
||||||
outputNames: ['Embeddings'],
|
outputNames: ['Embeddings'],
|
||||||
requestDefaults: {
|
requestDefaults: {
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
|
||||||
import { OllamaEmbeddings } from '@langchain/ollama';
|
import { OllamaEmbeddings } from '@langchain/ollama';
|
||||||
import {
|
import {
|
||||||
NodeConnectionTypes,
|
NodeConnectionTypes,
|
||||||
@@ -38,9 +37,9 @@ export class EmbeddingsOllama implements INodeType {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
|
|
||||||
inputs: [],
|
inputs: [],
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
|
||||||
outputs: [NodeConnectionTypes.AiEmbedding],
|
outputs: [NodeConnectionTypes.AiEmbedding],
|
||||||
outputNames: ['Embeddings'],
|
outputNames: ['Embeddings'],
|
||||||
properties: [getConnectionHintNoticeField([NodeConnectionTypes.AiVectorStore]), ollamaModel],
|
properties: [getConnectionHintNoticeField([NodeConnectionTypes.AiVectorStore]), ollamaModel],
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
|
||||||
import { OpenAIEmbeddings } from '@langchain/openai';
|
import { OpenAIEmbeddings } from '@langchain/openai';
|
||||||
import {
|
import {
|
||||||
NodeConnectionTypes,
|
NodeConnectionTypes,
|
||||||
@@ -98,9 +97,9 @@ export class EmbeddingsOpenAi implements INodeType {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
|
|
||||||
inputs: [],
|
inputs: [],
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
|
||||||
outputs: [NodeConnectionTypes.AiEmbedding],
|
outputs: [NodeConnectionTypes.AiEmbedding],
|
||||||
outputNames: ['Embeddings'],
|
outputNames: ['Embeddings'],
|
||||||
requestDefaults: {
|
requestDefaults: {
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
|
||||||
|
|
||||||
import { ChatAnthropic } from '@langchain/anthropic';
|
import { ChatAnthropic } from '@langchain/anthropic';
|
||||||
import type { LLMResult } from '@langchain/core/outputs';
|
import type { LLMResult } from '@langchain/core/outputs';
|
||||||
import {
|
import {
|
||||||
@@ -15,9 +13,9 @@ import {
|
|||||||
import { getHttpProxyAgent } from '@utils/httpProxyAgent';
|
import { getHttpProxyAgent } from '@utils/httpProxyAgent';
|
||||||
import { getConnectionHintNoticeField } from '@utils/sharedFields';
|
import { getConnectionHintNoticeField } from '@utils/sharedFields';
|
||||||
|
|
||||||
import { searchModels } from './methods/searchModels';
|
|
||||||
import { makeN8nLlmFailedAttemptHandler } from '../n8nLlmFailedAttemptHandler';
|
import { makeN8nLlmFailedAttemptHandler } from '../n8nLlmFailedAttemptHandler';
|
||||||
import { N8nLlmTracing } from '../N8nLlmTracing';
|
import { N8nLlmTracing } from '../N8nLlmTracing';
|
||||||
|
import { searchModels } from './methods/searchModels';
|
||||||
|
|
||||||
const modelField: INodeProperties = {
|
const modelField: INodeProperties = {
|
||||||
displayName: 'Model',
|
displayName: 'Model',
|
||||||
@@ -82,7 +80,7 @@ export class LmChatAnthropic implements INodeType {
|
|||||||
|
|
||||||
description: INodeTypeDescription = {
|
description: INodeTypeDescription = {
|
||||||
displayName: 'Anthropic Chat Model',
|
displayName: 'Anthropic Chat Model',
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-name-miscased
|
|
||||||
name: 'lmChatAnthropic',
|
name: 'lmChatAnthropic',
|
||||||
icon: 'file:anthropic.svg',
|
icon: 'file:anthropic.svg',
|
||||||
group: ['transform'],
|
group: ['transform'],
|
||||||
@@ -107,9 +105,9 @@ export class LmChatAnthropic implements INodeType {
|
|||||||
},
|
},
|
||||||
alias: ['claude', 'sonnet', 'opus'],
|
alias: ['claude', 'sonnet', 'opus'],
|
||||||
},
|
},
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
|
|
||||||
inputs: [],
|
inputs: [],
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
|
||||||
outputs: [NodeConnectionTypes.AiLanguageModel],
|
outputs: [NodeConnectionTypes.AiLanguageModel],
|
||||||
outputNames: ['Model'],
|
outputNames: ['Model'],
|
||||||
credentials: [
|
credentials: [
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
|
||||||
|
|
||||||
import type { ChatOllamaInput } from '@langchain/ollama';
|
import type { ChatOllamaInput } from '@langchain/ollama';
|
||||||
import { ChatOllama } from '@langchain/ollama';
|
import { ChatOllama } from '@langchain/ollama';
|
||||||
import {
|
import {
|
||||||
@@ -19,7 +17,7 @@ import { N8nLlmTracing } from '../N8nLlmTracing';
|
|||||||
export class LmChatOllama implements INodeType {
|
export class LmChatOllama implements INodeType {
|
||||||
description: INodeTypeDescription = {
|
description: INodeTypeDescription = {
|
||||||
displayName: 'Ollama Chat Model',
|
displayName: 'Ollama Chat Model',
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-name-miscased
|
|
||||||
name: 'lmChatOllama',
|
name: 'lmChatOllama',
|
||||||
icon: 'file:ollama.svg',
|
icon: 'file:ollama.svg',
|
||||||
group: ['transform'],
|
group: ['transform'],
|
||||||
@@ -42,9 +40,9 @@ export class LmChatOllama implements INodeType {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
|
|
||||||
inputs: [],
|
inputs: [],
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
|
||||||
outputs: [NodeConnectionTypes.AiLanguageModel],
|
outputs: [NodeConnectionTypes.AiLanguageModel],
|
||||||
outputNames: ['Model'],
|
outputNames: ['Model'],
|
||||||
...ollamaDescription,
|
...ollamaDescription,
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
|
||||||
|
|
||||||
import { ChatOpenAI, type ClientOptions } from '@langchain/openai';
|
import { ChatOpenAI, type ClientOptions } from '@langchain/openai';
|
||||||
import {
|
import {
|
||||||
NodeConnectionTypes,
|
NodeConnectionTypes,
|
||||||
@@ -26,7 +24,7 @@ export class LmChatOpenAi implements INodeType {
|
|||||||
|
|
||||||
description: INodeTypeDescription = {
|
description: INodeTypeDescription = {
|
||||||
displayName: 'OpenAI Chat Model',
|
displayName: 'OpenAI Chat Model',
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-name-miscased
|
|
||||||
name: 'lmChatOpenAi',
|
name: 'lmChatOpenAi',
|
||||||
icon: { light: 'file:openAiLight.svg', dark: 'file:openAiLight.dark.svg' },
|
icon: { light: 'file:openAiLight.svg', dark: 'file:openAiLight.dark.svg' },
|
||||||
group: ['transform'],
|
group: ['transform'],
|
||||||
@@ -49,9 +47,9 @@ export class LmChatOpenAi implements INodeType {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
|
|
||||||
inputs: [],
|
inputs: [],
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
|
||||||
outputs: [NodeConnectionTypes.AiLanguageModel],
|
outputs: [NodeConnectionTypes.AiLanguageModel],
|
||||||
outputNames: ['Model'],
|
outputNames: ['Model'],
|
||||||
credentials: [
|
credentials: [
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
|
||||||
import { Cohere } from '@langchain/cohere';
|
import { Cohere } from '@langchain/cohere';
|
||||||
import {
|
import {
|
||||||
NodeConnectionTypes,
|
NodeConnectionTypes,
|
||||||
@@ -16,7 +15,7 @@ import { N8nLlmTracing } from '../N8nLlmTracing';
|
|||||||
export class LmCohere implements INodeType {
|
export class LmCohere implements INodeType {
|
||||||
description: INodeTypeDescription = {
|
description: INodeTypeDescription = {
|
||||||
displayName: 'Cohere Model',
|
displayName: 'Cohere Model',
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-name-miscased
|
|
||||||
name: 'lmCohere',
|
name: 'lmCohere',
|
||||||
icon: { light: 'file:cohere.svg', dark: 'file:cohere.dark.svg' },
|
icon: { light: 'file:cohere.svg', dark: 'file:cohere.dark.svg' },
|
||||||
group: ['transform'],
|
group: ['transform'],
|
||||||
@@ -39,9 +38,9 @@ export class LmCohere implements INodeType {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
|
|
||||||
inputs: [],
|
inputs: [],
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
|
||||||
outputs: [NodeConnectionTypes.AiLanguageModel],
|
outputs: [NodeConnectionTypes.AiLanguageModel],
|
||||||
outputNames: ['Model'],
|
outputNames: ['Model'],
|
||||||
credentials: [
|
credentials: [
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
|
||||||
|
|
||||||
import { Ollama } from '@langchain/community/llms/ollama';
|
import { Ollama } from '@langchain/community/llms/ollama';
|
||||||
import {
|
import {
|
||||||
NodeConnectionTypes,
|
NodeConnectionTypes,
|
||||||
@@ -18,7 +16,7 @@ import { N8nLlmTracing } from '../N8nLlmTracing';
|
|||||||
export class LmOllama implements INodeType {
|
export class LmOllama implements INodeType {
|
||||||
description: INodeTypeDescription = {
|
description: INodeTypeDescription = {
|
||||||
displayName: 'Ollama Model',
|
displayName: 'Ollama Model',
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-name-miscased
|
|
||||||
name: 'lmOllama',
|
name: 'lmOllama',
|
||||||
icon: 'file:ollama.svg',
|
icon: 'file:ollama.svg',
|
||||||
group: ['transform'],
|
group: ['transform'],
|
||||||
@@ -41,9 +39,9 @@ export class LmOllama implements INodeType {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
|
|
||||||
inputs: [],
|
inputs: [],
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
|
||||||
outputs: [NodeConnectionTypes.AiLanguageModel],
|
outputs: [NodeConnectionTypes.AiLanguageModel],
|
||||||
outputNames: ['Model'],
|
outputNames: ['Model'],
|
||||||
...ollamaDescription,
|
...ollamaDescription,
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
|
||||||
import { OpenAI, type ClientOptions } from '@langchain/openai';
|
import { OpenAI, type ClientOptions } from '@langchain/openai';
|
||||||
import { NodeConnectionTypes } from 'n8n-workflow';
|
import { NodeConnectionTypes } from 'n8n-workflow';
|
||||||
import type {
|
import type {
|
||||||
@@ -28,7 +27,7 @@ type LmOpenAiOptions = {
|
|||||||
export class LmOpenAi implements INodeType {
|
export class LmOpenAi implements INodeType {
|
||||||
description: INodeTypeDescription = {
|
description: INodeTypeDescription = {
|
||||||
displayName: 'OpenAI Model',
|
displayName: 'OpenAI Model',
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-name-miscased
|
|
||||||
name: 'lmOpenAi',
|
name: 'lmOpenAi',
|
||||||
hidden: true,
|
hidden: true,
|
||||||
icon: { light: 'file:openAiLight.svg', dark: 'file:openAiLight.dark.svg' },
|
icon: { light: 'file:openAiLight.svg', dark: 'file:openAiLight.dark.svg' },
|
||||||
@@ -52,9 +51,9 @@ export class LmOpenAi implements INodeType {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
|
|
||||||
inputs: [],
|
inputs: [],
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
|
||||||
outputs: [NodeConnectionTypes.AiLanguageModel],
|
outputs: [NodeConnectionTypes.AiLanguageModel],
|
||||||
outputNames: ['Model'],
|
outputNames: ['Model'],
|
||||||
credentials: [
|
credentials: [
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
|
||||||
import { HuggingFaceInference } from '@langchain/community/llms/hf';
|
import { HuggingFaceInference } from '@langchain/community/llms/hf';
|
||||||
import {
|
import {
|
||||||
NodeConnectionTypes,
|
NodeConnectionTypes,
|
||||||
@@ -16,7 +15,7 @@ import { N8nLlmTracing } from '../N8nLlmTracing';
|
|||||||
export class LmOpenHuggingFaceInference implements INodeType {
|
export class LmOpenHuggingFaceInference implements INodeType {
|
||||||
description: INodeTypeDescription = {
|
description: INodeTypeDescription = {
|
||||||
displayName: 'Hugging Face Inference Model',
|
displayName: 'Hugging Face Inference Model',
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-name-miscased
|
|
||||||
name: 'lmOpenHuggingFaceInference',
|
name: 'lmOpenHuggingFaceInference',
|
||||||
icon: 'file:huggingface.svg',
|
icon: 'file:huggingface.svg',
|
||||||
group: ['transform'],
|
group: ['transform'],
|
||||||
@@ -39,9 +38,9 @@ export class LmOpenHuggingFaceInference implements INodeType {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
|
|
||||||
inputs: [],
|
inputs: [],
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
|
||||||
outputs: [NodeConnectionTypes.AiLanguageModel],
|
outputs: [NodeConnectionTypes.AiLanguageModel],
|
||||||
outputNames: ['Model'],
|
outputNames: ['Model'],
|
||||||
credentials: [
|
credentials: [
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
|
||||||
import { ChatBedrockConverse } from '@langchain/aws';
|
import { ChatBedrockConverse } from '@langchain/aws';
|
||||||
import {
|
import {
|
||||||
NodeConnectionTypes,
|
NodeConnectionTypes,
|
||||||
@@ -17,7 +16,7 @@ import { N8nLlmTracing } from '../N8nLlmTracing';
|
|||||||
export class LmChatAwsBedrock implements INodeType {
|
export class LmChatAwsBedrock implements INodeType {
|
||||||
description: INodeTypeDescription = {
|
description: INodeTypeDescription = {
|
||||||
displayName: 'AWS Bedrock Chat Model',
|
displayName: 'AWS Bedrock Chat Model',
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-name-miscased
|
|
||||||
name: 'lmChatAwsBedrock',
|
name: 'lmChatAwsBedrock',
|
||||||
icon: 'file:bedrock.svg',
|
icon: 'file:bedrock.svg',
|
||||||
group: ['transform'],
|
group: ['transform'],
|
||||||
@@ -40,14 +39,13 @@ export class LmChatAwsBedrock implements INodeType {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
|
|
||||||
inputs: [],
|
inputs: [],
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
|
||||||
outputs: [NodeConnectionTypes.AiLanguageModel],
|
outputs: [NodeConnectionTypes.AiLanguageModel],
|
||||||
outputNames: ['Model'],
|
outputNames: ['Model'],
|
||||||
credentials: [
|
credentials: [
|
||||||
{
|
{
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-credentials-name-unsuffixed
|
|
||||||
name: 'aws',
|
name: 'aws',
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
/* eslint-disable n8n-nodes-base/node-execute-block-wrong-error-thrown */
|
|
||||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
|
||||||
import { AzureChatOpenAI } from '@langchain/openai';
|
import { AzureChatOpenAI } from '@langchain/openai';
|
||||||
import {
|
import {
|
||||||
NodeOperationError,
|
NodeOperationError,
|
||||||
@@ -27,7 +25,7 @@ import { N8nLlmTracing } from '../N8nLlmTracing';
|
|||||||
export class LmChatAzureOpenAi implements INodeType {
|
export class LmChatAzureOpenAi implements INodeType {
|
||||||
description: INodeTypeDescription = {
|
description: INodeTypeDescription = {
|
||||||
displayName: 'Azure OpenAI Chat Model',
|
displayName: 'Azure OpenAI Chat Model',
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-name-miscased
|
|
||||||
name: 'lmChatAzureOpenAi',
|
name: 'lmChatAzureOpenAi',
|
||||||
icon: 'file:azure.svg',
|
icon: 'file:azure.svg',
|
||||||
group: ['transform'],
|
group: ['transform'],
|
||||||
@@ -50,9 +48,9 @@ export class LmChatAzureOpenAi implements INodeType {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
|
|
||||||
inputs: [],
|
inputs: [],
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
|
||||||
outputs: [NodeConnectionTypes.AiLanguageModel],
|
outputs: [NodeConnectionTypes.AiLanguageModel],
|
||||||
outputNames: ['Model'],
|
outputNames: ['Model'],
|
||||||
credentials: [
|
credentials: [
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
|
||||||
|
|
||||||
import { ChatOpenAI, type ClientOptions } from '@langchain/openai';
|
import { ChatOpenAI, type ClientOptions } from '@langchain/openai';
|
||||||
import {
|
import {
|
||||||
NodeConnectionTypes,
|
NodeConnectionTypes,
|
||||||
@@ -20,7 +18,7 @@ import { N8nLlmTracing } from '../N8nLlmTracing';
|
|||||||
export class LmChatDeepSeek implements INodeType {
|
export class LmChatDeepSeek implements INodeType {
|
||||||
description: INodeTypeDescription = {
|
description: INodeTypeDescription = {
|
||||||
displayName: 'DeepSeek Chat Model',
|
displayName: 'DeepSeek Chat Model',
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-name-miscased
|
|
||||||
name: 'lmChatDeepSeek',
|
name: 'lmChatDeepSeek',
|
||||||
icon: 'file:deepseek.svg',
|
icon: 'file:deepseek.svg',
|
||||||
group: ['transform'],
|
group: ['transform'],
|
||||||
@@ -43,9 +41,9 @@ export class LmChatDeepSeek implements INodeType {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
|
|
||||||
inputs: [],
|
inputs: [],
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
|
||||||
outputs: [NodeConnectionTypes.AiLanguageModel],
|
outputs: [NodeConnectionTypes.AiLanguageModel],
|
||||||
outputNames: ['Model'],
|
outputNames: ['Model'],
|
||||||
credentials: [
|
credentials: [
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
|
||||||
import type { SafetySetting } from '@google/generative-ai';
|
import type { SafetySetting } from '@google/generative-ai';
|
||||||
import { ChatGoogleGenerativeAI } from '@langchain/google-genai';
|
import { ChatGoogleGenerativeAI } from '@langchain/google-genai';
|
||||||
import { NodeConnectionTypes } from 'n8n-workflow';
|
import { NodeConnectionTypes } from 'n8n-workflow';
|
||||||
@@ -26,7 +25,7 @@ function errorDescriptionMapper(error: NodeError) {
|
|||||||
export class LmChatGoogleGemini implements INodeType {
|
export class LmChatGoogleGemini implements INodeType {
|
||||||
description: INodeTypeDescription = {
|
description: INodeTypeDescription = {
|
||||||
displayName: 'Google Gemini Chat Model',
|
displayName: 'Google Gemini Chat Model',
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-name-miscased
|
|
||||||
name: 'lmChatGoogleGemini',
|
name: 'lmChatGoogleGemini',
|
||||||
icon: 'file:google.svg',
|
icon: 'file:google.svg',
|
||||||
group: ['transform'],
|
group: ['transform'],
|
||||||
@@ -49,9 +48,9 @@ export class LmChatGoogleGemini implements INodeType {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
|
|
||||||
inputs: [],
|
inputs: [],
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
|
||||||
outputs: [NodeConnectionTypes.AiLanguageModel],
|
outputs: [NodeConnectionTypes.AiLanguageModel],
|
||||||
outputNames: ['Model'],
|
outputNames: ['Model'],
|
||||||
credentials: [
|
credentials: [
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
|
||||||
import type { SafetySetting } from '@google/generative-ai';
|
import type { SafetySetting } from '@google/generative-ai';
|
||||||
import { ProjectsClient } from '@google-cloud/resource-manager';
|
import { ProjectsClient } from '@google-cloud/resource-manager';
|
||||||
import { ChatVertexAI } from '@langchain/google-vertexai';
|
import { ChatVertexAI } from '@langchain/google-vertexai';
|
||||||
@@ -24,7 +23,7 @@ import { N8nLlmTracing } from '../N8nLlmTracing';
|
|||||||
export class LmChatGoogleVertex implements INodeType {
|
export class LmChatGoogleVertex implements INodeType {
|
||||||
description: INodeTypeDescription = {
|
description: INodeTypeDescription = {
|
||||||
displayName: 'Google Vertex Chat Model',
|
displayName: 'Google Vertex Chat Model',
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-name-miscased
|
|
||||||
name: 'lmChatGoogleVertex',
|
name: 'lmChatGoogleVertex',
|
||||||
icon: 'file:google.svg',
|
icon: 'file:google.svg',
|
||||||
group: ['transform'],
|
group: ['transform'],
|
||||||
@@ -47,9 +46,9 @@ export class LmChatGoogleVertex implements INodeType {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
|
|
||||||
inputs: [],
|
inputs: [],
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
|
||||||
outputs: [NodeConnectionTypes.AiLanguageModel],
|
outputs: [NodeConnectionTypes.AiLanguageModel],
|
||||||
outputNames: ['Model'],
|
outputNames: ['Model'],
|
||||||
credentials: [
|
credentials: [
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
|
||||||
import { ChatGroq } from '@langchain/groq';
|
import { ChatGroq } from '@langchain/groq';
|
||||||
import {
|
import {
|
||||||
NodeConnectionTypes,
|
NodeConnectionTypes,
|
||||||
@@ -17,7 +16,7 @@ import { N8nLlmTracing } from '../N8nLlmTracing';
|
|||||||
export class LmChatGroq implements INodeType {
|
export class LmChatGroq implements INodeType {
|
||||||
description: INodeTypeDescription = {
|
description: INodeTypeDescription = {
|
||||||
displayName: 'Groq Chat Model',
|
displayName: 'Groq Chat Model',
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-name-miscased
|
|
||||||
name: 'lmChatGroq',
|
name: 'lmChatGroq',
|
||||||
icon: 'file:groq.svg',
|
icon: 'file:groq.svg',
|
||||||
group: ['transform'],
|
group: ['transform'],
|
||||||
@@ -40,9 +39,9 @@ export class LmChatGroq implements INodeType {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
|
|
||||||
inputs: [],
|
inputs: [],
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
|
||||||
outputs: [NodeConnectionTypes.AiLanguageModel],
|
outputs: [NodeConnectionTypes.AiLanguageModel],
|
||||||
outputNames: ['Model'],
|
outputNames: ['Model'],
|
||||||
credentials: [
|
credentials: [
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
|
||||||
|
|
||||||
import type { ChatMistralAIInput } from '@langchain/mistralai';
|
import type { ChatMistralAIInput } from '@langchain/mistralai';
|
||||||
import { ChatMistralAI } from '@langchain/mistralai';
|
import { ChatMistralAI } from '@langchain/mistralai';
|
||||||
import {
|
import {
|
||||||
@@ -18,7 +16,7 @@ import { N8nLlmTracing } from '../N8nLlmTracing';
|
|||||||
export class LmChatMistralCloud implements INodeType {
|
export class LmChatMistralCloud implements INodeType {
|
||||||
description: INodeTypeDescription = {
|
description: INodeTypeDescription = {
|
||||||
displayName: 'Mistral Cloud Chat Model',
|
displayName: 'Mistral Cloud Chat Model',
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-name-miscased
|
|
||||||
name: 'lmChatMistralCloud',
|
name: 'lmChatMistralCloud',
|
||||||
icon: 'file:mistral.svg',
|
icon: 'file:mistral.svg',
|
||||||
group: ['transform'],
|
group: ['transform'],
|
||||||
@@ -41,9 +39,9 @@ export class LmChatMistralCloud implements INodeType {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
|
|
||||||
inputs: [],
|
inputs: [],
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
|
||||||
outputs: [NodeConnectionTypes.AiLanguageModel],
|
outputs: [NodeConnectionTypes.AiLanguageModel],
|
||||||
outputNames: ['Model'],
|
outputNames: ['Model'],
|
||||||
credentials: [
|
credentials: [
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
|
||||||
|
|
||||||
import { ChatOpenAI, type ClientOptions } from '@langchain/openai';
|
import { ChatOpenAI, type ClientOptions } from '@langchain/openai';
|
||||||
import {
|
import {
|
||||||
NodeConnectionTypes,
|
NodeConnectionTypes,
|
||||||
@@ -42,9 +40,9 @@ export class LmChatOpenRouter implements INodeType {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
|
|
||||||
inputs: [],
|
inputs: [],
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
|
||||||
outputs: [NodeConnectionTypes.AiLanguageModel],
|
outputs: [NodeConnectionTypes.AiLanguageModel],
|
||||||
outputNames: ['Model'],
|
outputNames: ['Model'],
|
||||||
credentials: [
|
credentials: [
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
|
||||||
|
|
||||||
import { ChatOpenAI, type ClientOptions } from '@langchain/openai';
|
import { ChatOpenAI, type ClientOptions } from '@langchain/openai';
|
||||||
import {
|
import {
|
||||||
NodeConnectionTypes,
|
NodeConnectionTypes,
|
||||||
@@ -20,7 +18,7 @@ import { N8nLlmTracing } from '../N8nLlmTracing';
|
|||||||
export class LmChatXAiGrok implements INodeType {
|
export class LmChatXAiGrok implements INodeType {
|
||||||
description: INodeTypeDescription = {
|
description: INodeTypeDescription = {
|
||||||
displayName: 'xAI Grok Chat Model',
|
displayName: 'xAI Grok Chat Model',
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-name-miscased
|
|
||||||
name: 'lmChatXAiGrok',
|
name: 'lmChatXAiGrok',
|
||||||
icon: { light: 'file:logo.dark.svg', dark: 'file:logo.svg' },
|
icon: { light: 'file:logo.dark.svg', dark: 'file:logo.svg' },
|
||||||
group: ['transform'],
|
group: ['transform'],
|
||||||
@@ -43,9 +41,9 @@ export class LmChatXAiGrok implements INodeType {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
|
|
||||||
inputs: [],
|
inputs: [],
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
|
||||||
outputs: [NodeConnectionTypes.AiLanguageModel],
|
outputs: [NodeConnectionTypes.AiLanguageModel],
|
||||||
outputNames: ['Model'],
|
outputNames: ['Model'],
|
||||||
credentials: [
|
credentials: [
|
||||||
|
|||||||
@@ -188,11 +188,7 @@ export class N8nLlmTracing extends BaseCallbackHandler {
|
|||||||
this.promptTokensEstimate = estimatedTokens;
|
this.promptTokensEstimate = estimatedTokens;
|
||||||
}
|
}
|
||||||
|
|
||||||
async handleLLMError(
|
async handleLLMError(error: IDataObject | Error, runId: string, parentRunId?: string) {
|
||||||
error: IDataObject | Error,
|
|
||||||
runId: string,
|
|
||||||
parentRunId?: string | undefined,
|
|
||||||
) {
|
|
||||||
const runDetails = this.runsMap[runId] ?? { index: Object.keys(this.runsMap).length };
|
const runDetails = this.runsMap[runId] ?? { index: Object.keys(this.runsMap).length };
|
||||||
|
|
||||||
// Filter out non-x- headers to avoid leaking sensitive information in logs
|
// Filter out non-x- headers to avoid leaking sensitive information in logs
|
||||||
|
|||||||
@@ -136,11 +136,7 @@ export class N8nNonEstimatingTracing extends BaseCallbackHandler {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
async handleLLMError(
|
async handleLLMError(error: IDataObject | Error, runId: string, parentRunId?: string) {
|
||||||
error: IDataObject | Error,
|
|
||||||
runId: string,
|
|
||||||
parentRunId?: string | undefined,
|
|
||||||
) {
|
|
||||||
const runDetails = this.runsMap[runId] ?? { index: Object.keys(this.runsMap).length };
|
const runDetails = this.runsMap[runId] ?? { index: Object.keys(this.runsMap).length };
|
||||||
|
|
||||||
// Filter out non-x- headers to avoid leaking sensitive information in logs
|
// Filter out non-x- headers to avoid leaking sensitive information in logs
|
||||||
|
|||||||
@@ -27,13 +27,13 @@ export const n8nDefaultFailedAttemptHandler = (error: any) => {
|
|||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any,@typescript-eslint/no-unsafe-member-access
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
||||||
if (error?.code === 'ECONNABORTED') {
|
if (error?.code === 'ECONNABORTED') {
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
|
|
||||||
const status =
|
const status =
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any,@typescript-eslint/no-unsafe-member-access
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
||||||
error?.response?.status ?? error?.status;
|
error?.response?.status ?? error?.status;
|
||||||
if (status && STATUS_NO_RETRY.includes(+status)) {
|
if (status && STATUS_NO_RETRY.includes(+status)) {
|
||||||
throw error;
|
throw error;
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
|
||||||
import type { BufferWindowMemoryInput } from 'langchain/memory';
|
import type { BufferWindowMemoryInput } from 'langchain/memory';
|
||||||
import { BufferWindowMemory } from 'langchain/memory';
|
import { BufferWindowMemory } from 'langchain/memory';
|
||||||
import {
|
import {
|
||||||
@@ -99,9 +98,9 @@ export class MemoryBufferWindow implements INodeType {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
|
|
||||||
inputs: [],
|
inputs: [],
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
|
||||||
outputs: [NodeConnectionTypes.AiMemory],
|
outputs: [NodeConnectionTypes.AiMemory],
|
||||||
outputNames: ['Memory'],
|
outputNames: ['Memory'],
|
||||||
properties: [
|
properties: [
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
|
||||||
import type { BaseChatMemory } from '@langchain/community/memory/chat_memory';
|
import type { BaseChatMemory } from '@langchain/community/memory/chat_memory';
|
||||||
import type { BaseMessage } from '@langchain/core/messages';
|
import type { BaseMessage } from '@langchain/core/messages';
|
||||||
import {
|
import {
|
||||||
@@ -59,7 +58,7 @@ export class MemoryChatRetriever implements INodeType {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
|
|
||||||
inputs: [
|
inputs: [
|
||||||
NodeConnectionTypes.Main,
|
NodeConnectionTypes.Main,
|
||||||
{
|
{
|
||||||
@@ -69,7 +68,7 @@ export class MemoryChatRetriever implements INodeType {
|
|||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
|
||||||
outputs: [NodeConnectionTypes.Main],
|
outputs: [NodeConnectionTypes.Main],
|
||||||
properties: [
|
properties: [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
|
||||||
import type { BaseChatMemory } from '@langchain/community/memory/chat_memory';
|
import type { BaseChatMemory } from '@langchain/community/memory/chat_memory';
|
||||||
import type { MessageContent, BaseMessage } from '@langchain/core/messages';
|
import type { MessageContent, BaseMessage } from '@langchain/core/messages';
|
||||||
import { AIMessage, SystemMessage, HumanMessage } from '@langchain/core/messages';
|
import { AIMessage, SystemMessage, HumanMessage } from '@langchain/core/messages';
|
||||||
@@ -96,7 +95,7 @@ export class MemoryManager implements INodeType {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
|
|
||||||
inputs: [
|
inputs: [
|
||||||
{
|
{
|
||||||
displayName: '',
|
displayName: '',
|
||||||
@@ -109,7 +108,7 @@ export class MemoryManager implements INodeType {
|
|||||||
maxConnections: 1,
|
maxConnections: 1,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
|
||||||
outputs: [
|
outputs: [
|
||||||
{
|
{
|
||||||
displayName: '',
|
displayName: '',
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
|
||||||
import { MotorheadMemory } from '@langchain/community/memory/motorhead_memory';
|
import { MotorheadMemory } from '@langchain/community/memory/motorhead_memory';
|
||||||
import {
|
import {
|
||||||
NodeConnectionTypes,
|
NodeConnectionTypes,
|
||||||
@@ -40,9 +39,9 @@ export class MemoryMotorhead implements INodeType {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
|
|
||||||
inputs: [],
|
inputs: [],
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
|
||||||
outputs: [NodeConnectionTypes.AiMemory],
|
outputs: [NodeConnectionTypes.AiMemory],
|
||||||
outputNames: ['Memory'],
|
outputNames: ['Memory'],
|
||||||
credentials: [
|
credentials: [
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
|
||||||
import { PostgresChatMessageHistory } from '@langchain/community/stores/message/postgres';
|
import { PostgresChatMessageHistory } from '@langchain/community/stores/message/postgres';
|
||||||
import { BufferMemory, BufferWindowMemory } from 'langchain/memory';
|
import { BufferMemory, BufferWindowMemory } from 'langchain/memory';
|
||||||
import { configurePostgres } from 'n8n-nodes-base/dist/nodes/Postgres/transport/index';
|
import { configurePostgres } from 'n8n-nodes-base/dist/nodes/Postgres/transport/index';
|
||||||
@@ -56,9 +55,9 @@ export class MemoryPostgresChat implements INodeType {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
|
|
||||||
inputs: [],
|
inputs: [],
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
|
||||||
outputs: [NodeConnectionTypes.AiMemory],
|
outputs: [NodeConnectionTypes.AiMemory],
|
||||||
outputNames: ['Memory'],
|
outputNames: ['Memory'],
|
||||||
properties: [
|
properties: [
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
|
||||||
import type { RedisChatMessageHistoryInput } from '@langchain/redis';
|
import type { RedisChatMessageHistoryInput } from '@langchain/redis';
|
||||||
import { RedisChatMessageHistory } from '@langchain/redis';
|
import { RedisChatMessageHistory } from '@langchain/redis';
|
||||||
import { BufferMemory, BufferWindowMemory } from 'langchain/memory';
|
import { BufferMemory, BufferWindowMemory } from 'langchain/memory';
|
||||||
@@ -55,9 +54,9 @@ export class MemoryRedisChat implements INodeType {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
|
|
||||||
inputs: [],
|
inputs: [],
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
|
||||||
outputs: [NodeConnectionTypes.AiMemory],
|
outputs: [NodeConnectionTypes.AiMemory],
|
||||||
outputNames: ['Memory'],
|
outputNames: ['Memory'],
|
||||||
properties: [
|
properties: [
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
|
||||||
import { XataChatMessageHistory } from '@langchain/community/stores/message/xata';
|
import { XataChatMessageHistory } from '@langchain/community/stores/message/xata';
|
||||||
import { BaseClient } from '@xata.io/client';
|
import { BaseClient } from '@xata.io/client';
|
||||||
import { BufferMemory, BufferWindowMemory } from 'langchain/memory';
|
import { BufferMemory, BufferWindowMemory } from 'langchain/memory';
|
||||||
@@ -48,9 +47,9 @@ export class MemoryXata implements INodeType {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
|
|
||||||
inputs: [],
|
inputs: [],
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
|
||||||
outputs: [NodeConnectionTypes.AiMemory],
|
outputs: [NodeConnectionTypes.AiMemory],
|
||||||
outputNames: ['Memory'],
|
outputNames: ['Memory'],
|
||||||
credentials: [
|
credentials: [
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
|
||||||
import type { BaseChatMemory } from '@langchain/community/dist/memory/chat_memory';
|
import type { BaseChatMemory } from '@langchain/community/dist/memory/chat_memory';
|
||||||
import { ZepMemory } from '@langchain/community/memory/zep';
|
import { ZepMemory } from '@langchain/community/memory/zep';
|
||||||
import { ZepCloudMemory } from '@langchain/community/memory/zep_cloud';
|
import { ZepCloudMemory } from '@langchain/community/memory/zep_cloud';
|
||||||
@@ -56,9 +55,9 @@ export class MemoryZep implements INodeType {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
|
|
||||||
inputs: [],
|
inputs: [],
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
|
||||||
outputs: [NodeConnectionTypes.AiMemory],
|
outputs: [NodeConnectionTypes.AiMemory],
|
||||||
outputNames: ['Memory'],
|
outputNames: ['Memory'],
|
||||||
credentials: [
|
credentials: [
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ export class OutputParserAutofixing implements INodeType {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
|
|
||||||
inputs: [
|
inputs: [
|
||||||
{
|
{
|
||||||
displayName: 'Model',
|
displayName: 'Model',
|
||||||
@@ -57,7 +57,7 @@ export class OutputParserAutofixing implements INodeType {
|
|||||||
type: NodeConnectionTypes.AiOutputParser,
|
type: NodeConnectionTypes.AiOutputParser,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
|
||||||
outputs: [NodeConnectionTypes.AiOutputParser],
|
outputs: [NodeConnectionTypes.AiOutputParser],
|
||||||
outputNames: ['Output Parser'],
|
outputNames: ['Output Parser'],
|
||||||
properties: [
|
properties: [
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/* eslint-disable @typescript-eslint/unbound-method */
|
/* eslint-disable @typescript-eslint/unbound-method */
|
||||||
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
|
||||||
import type { BaseLanguageModel } from '@langchain/core/language_models/base';
|
import type { BaseLanguageModel } from '@langchain/core/language_models/base';
|
||||||
import { OutputParserException } from '@langchain/core/output_parsers';
|
import { OutputParserException } from '@langchain/core/output_parsers';
|
||||||
import type { MockProxy } from 'jest-mock-extended';
|
import type { MockProxy } from 'jest-mock-extended';
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
|
||||||
import {
|
import {
|
||||||
NodeConnectionTypes,
|
NodeConnectionTypes,
|
||||||
type INodeType,
|
type INodeType,
|
||||||
@@ -36,9 +35,9 @@ export class OutputParserItemList implements INodeType {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
|
|
||||||
inputs: [],
|
inputs: [],
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
|
||||||
outputs: [NodeConnectionTypes.AiOutputParser],
|
outputs: [NodeConnectionTypes.AiOutputParser],
|
||||||
outputNames: ['Output Parser'],
|
outputNames: ['Output Parser'],
|
||||||
properties: [
|
properties: [
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ export class OutputParserStructured implements INodeType {
|
|||||||
return [];
|
return [];
|
||||||
})($parameter)
|
})($parameter)
|
||||||
}}`,
|
}}`,
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
|
||||||
outputs: [NodeConnectionTypes.AiOutputParser],
|
outputs: [NodeConnectionTypes.AiOutputParser],
|
||||||
outputNames: ['Output Parser'],
|
outputNames: ['Output Parser'],
|
||||||
properties: [
|
properties: [
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
|
||||||
import { CohereRerank } from '@langchain/cohere';
|
import { CohereRerank } from '@langchain/cohere';
|
||||||
import {
|
import {
|
||||||
NodeConnectionTypes,
|
NodeConnectionTypes,
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
|
||||||
|
|
||||||
import type { BaseLanguageModel } from '@langchain/core/language_models/base';
|
import type { BaseLanguageModel } from '@langchain/core/language_models/base';
|
||||||
import type { BaseRetriever } from '@langchain/core/retrievers';
|
import type { BaseRetriever } from '@langchain/core/retrievers';
|
||||||
import { ContextualCompressionRetriever } from 'langchain/retrievers/contextual_compression';
|
import { ContextualCompressionRetriever } from 'langchain/retrievers/contextual_compression';
|
||||||
@@ -39,7 +37,7 @@ export class RetrieverContextualCompression implements INodeType {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
|
|
||||||
inputs: [
|
inputs: [
|
||||||
{
|
{
|
||||||
displayName: 'Model',
|
displayName: 'Model',
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
|
||||||
|
|
||||||
import type { BaseLanguageModel } from '@langchain/core/language_models/base';
|
import type { BaseLanguageModel } from '@langchain/core/language_models/base';
|
||||||
import type { BaseRetriever } from '@langchain/core/retrievers';
|
import type { BaseRetriever } from '@langchain/core/retrievers';
|
||||||
import { MultiQueryRetriever } from 'langchain/retrievers/multi_query';
|
import { MultiQueryRetriever } from 'langchain/retrievers/multi_query';
|
||||||
@@ -39,7 +37,7 @@ export class RetrieverMultiQuery implements INodeType {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
|
|
||||||
inputs: [
|
inputs: [
|
||||||
{
|
{
|
||||||
displayName: 'Model',
|
displayName: 'Model',
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
|
||||||
import type { BaseDocumentCompressor } from '@langchain/core/retrievers/document_compressors';
|
import type { BaseDocumentCompressor } from '@langchain/core/retrievers/document_compressors';
|
||||||
import { VectorStore } from '@langchain/core/vectorstores';
|
import { VectorStore } from '@langchain/core/vectorstores';
|
||||||
import { ContextualCompressionRetriever } from 'langchain/retrievers/contextual_compression';
|
import { ContextualCompressionRetriever } from 'langchain/retrievers/contextual_compression';
|
||||||
@@ -37,7 +36,7 @@ export class RetrieverVectorStore implements INodeType {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
|
|
||||||
inputs: [
|
inputs: [
|
||||||
{
|
{
|
||||||
displayName: 'Vector Store',
|
displayName: 'Vector Store',
|
||||||
@@ -46,7 +45,7 @@ export class RetrieverVectorStore implements INodeType {
|
|||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
|
||||||
outputs: [NodeConnectionTypes.AiRetriever],
|
outputs: [NodeConnectionTypes.AiRetriever],
|
||||||
outputNames: ['Retriever'],
|
outputNames: ['Retriever'],
|
||||||
properties: [
|
properties: [
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
|
||||||
import type { CallbackManagerForRetrieverRun } from '@langchain/core/callbacks/manager';
|
import type { CallbackManagerForRetrieverRun } from '@langchain/core/callbacks/manager';
|
||||||
import { Document } from '@langchain/core/documents';
|
import { Document } from '@langchain/core/documents';
|
||||||
import { BaseRetriever, type BaseRetrieverInput } from '@langchain/core/retrievers';
|
import { BaseRetriever, type BaseRetrieverInput } from '@langchain/core/retrievers';
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
|
||||||
import type { CharacterTextSplitterParams } from '@langchain/textsplitters';
|
import type { CharacterTextSplitterParams } from '@langchain/textsplitters';
|
||||||
import { CharacterTextSplitter } from '@langchain/textsplitters';
|
import { CharacterTextSplitter } from '@langchain/textsplitters';
|
||||||
import {
|
import {
|
||||||
@@ -37,9 +36,9 @@ export class TextSplitterCharacterTextSplitter implements INodeType {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
|
|
||||||
inputs: [],
|
inputs: [],
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
|
||||||
outputs: [NodeConnectionTypes.AiTextSplitter],
|
outputs: [NodeConnectionTypes.AiTextSplitter],
|
||||||
outputNames: ['Text Splitter'],
|
outputNames: ['Text Splitter'],
|
||||||
properties: [
|
properties: [
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
|
||||||
import type {
|
import type {
|
||||||
RecursiveCharacterTextSplitterParams,
|
RecursiveCharacterTextSplitterParams,
|
||||||
SupportedTextSplitterLanguage,
|
SupportedTextSplitterLanguage,
|
||||||
@@ -57,9 +56,9 @@ export class TextSplitterRecursiveCharacterTextSplitter implements INodeType {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
|
|
||||||
inputs: [],
|
inputs: [],
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
|
||||||
outputs: [NodeConnectionTypes.AiTextSplitter],
|
outputs: [NodeConnectionTypes.AiTextSplitter],
|
||||||
outputNames: ['Text Splitter'],
|
outputNames: ['Text Splitter'],
|
||||||
properties: [
|
properties: [
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
|
||||||
import {
|
import {
|
||||||
NodeConnectionTypes,
|
NodeConnectionTypes,
|
||||||
type INodeType,
|
type INodeType,
|
||||||
@@ -37,9 +36,9 @@ export class TextSplitterTokenSplitter implements INodeType {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
|
|
||||||
inputs: [],
|
inputs: [],
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
|
||||||
outputs: [NodeConnectionTypes.AiTextSplitter],
|
outputs: [NodeConnectionTypes.AiTextSplitter],
|
||||||
outputNames: ['Text Splitter'],
|
outputNames: ['Text Splitter'],
|
||||||
properties: [
|
properties: [
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
|
||||||
import type { TokenTextSplitterParams } from '@langchain/textsplitters';
|
import type { TokenTextSplitterParams } from '@langchain/textsplitters';
|
||||||
import { TextSplitter } from '@langchain/textsplitters';
|
import { TextSplitter } from '@langchain/textsplitters';
|
||||||
import type * as tiktoken from 'js-tiktoken';
|
import type * as tiktoken from 'js-tiktoken';
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
|
||||||
import { Calculator } from '@langchain/community/tools/calculator';
|
import { Calculator } from '@langchain/community/tools/calculator';
|
||||||
import {
|
import {
|
||||||
NodeConnectionTypes,
|
NodeConnectionTypes,
|
||||||
@@ -37,9 +36,9 @@ export class ToolCalculator implements INodeType {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
|
|
||||||
inputs: [],
|
inputs: [],
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
|
||||||
outputs: [NodeConnectionTypes.AiTool],
|
outputs: [NodeConnectionTypes.AiTool],
|
||||||
outputNames: ['Tool'],
|
outputNames: ['Tool'],
|
||||||
properties: [getConnectionHintNoticeField([NodeConnectionTypes.AiAgent])],
|
properties: [getConnectionHintNoticeField([NodeConnectionTypes.AiAgent])],
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
|
||||||
import { DynamicStructuredTool, DynamicTool } from '@langchain/core/tools';
|
import { DynamicStructuredTool, DynamicTool } from '@langchain/core/tools';
|
||||||
import type { JSONSchema7 } from 'json-schema';
|
import type { JSONSchema7 } from 'json-schema';
|
||||||
import { JavaScriptSandbox } from 'n8n-nodes-base/dist/nodes/Code/JavaScriptSandbox';
|
import { JavaScriptSandbox } from 'n8n-nodes-base/dist/nodes/Code/JavaScriptSandbox';
|
||||||
@@ -66,9 +65,9 @@ export class ToolCode implements INodeType {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
|
|
||||||
inputs: [],
|
inputs: [],
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
|
||||||
outputs: [NodeConnectionTypes.AiTool],
|
outputs: [NodeConnectionTypes.AiTool],
|
||||||
outputNames: ['Tool'],
|
outputNames: ['Tool'],
|
||||||
properties: [
|
properties: [
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
|
||||||
import { DynamicTool } from '@langchain/core/tools';
|
import { DynamicTool } from '@langchain/core/tools';
|
||||||
import type {
|
import type {
|
||||||
INodeType,
|
INodeType,
|
||||||
@@ -65,9 +64,9 @@ export class ToolHttpRequest implements INodeType {
|
|||||||
},
|
},
|
||||||
// Replaced by a `usableAsTool` version of the standalone HttpRequest node
|
// Replaced by a `usableAsTool` version of the standalone HttpRequest node
|
||||||
hidden: true,
|
hidden: true,
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
|
|
||||||
inputs: [],
|
inputs: [],
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
|
||||||
outputs: [NodeConnectionTypes.AiTool],
|
outputs: [NodeConnectionTypes.AiTool],
|
||||||
outputNames: ['Tool'],
|
outputNames: ['Tool'],
|
||||||
properties: [
|
properties: [
|
||||||
|
|||||||
@@ -395,7 +395,6 @@ export const extractParametersFromText = (
|
|||||||
const parameters = extractPlaceholders(text);
|
const parameters = extractPlaceholders(text);
|
||||||
|
|
||||||
if (parameters.length) {
|
if (parameters.length) {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
||||||
const inputParameters = prepareParameters(
|
const inputParameters = prepareParameters(
|
||||||
parameters.map((name) => ({
|
parameters.map((name) => ({
|
||||||
name,
|
name,
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
|
||||||
import { SerpAPI } from '@langchain/community/tools/serpapi';
|
import { SerpAPI } from '@langchain/community/tools/serpapi';
|
||||||
import {
|
import {
|
||||||
NodeConnectionTypes,
|
NodeConnectionTypes,
|
||||||
@@ -36,9 +35,9 @@ export class ToolSerpApi implements INodeType {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
|
|
||||||
inputs: [],
|
inputs: [],
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
|
||||||
outputs: [NodeConnectionTypes.AiTool],
|
outputs: [NodeConnectionTypes.AiTool],
|
||||||
outputNames: ['Tool'],
|
outputNames: ['Tool'],
|
||||||
credentials: [
|
credentials: [
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
|
||||||
import { DynamicTool } from 'langchain/tools';
|
import { DynamicTool } from 'langchain/tools';
|
||||||
import {
|
import {
|
||||||
NodeConnectionTypes,
|
NodeConnectionTypes,
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ export class ToolVectorStore implements INodeType {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
|
|
||||||
inputs: [
|
inputs: [
|
||||||
{
|
{
|
||||||
displayName: 'Vector Store',
|
displayName: 'Vector Store',
|
||||||
@@ -55,7 +55,7 @@ export class ToolVectorStore implements INodeType {
|
|||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
|
||||||
outputs: [NodeConnectionTypes.AiTool],
|
outputs: [NodeConnectionTypes.AiTool],
|
||||||
outputNames: ['Tool'],
|
outputNames: ['Tool'],
|
||||||
properties: [
|
properties: [
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
|
||||||
import { WikipediaQueryRun } from '@langchain/community/tools/wikipedia_query_run';
|
import { WikipediaQueryRun } from '@langchain/community/tools/wikipedia_query_run';
|
||||||
import {
|
import {
|
||||||
NodeConnectionTypes,
|
NodeConnectionTypes,
|
||||||
@@ -36,9 +35,9 @@ export class ToolWikipedia implements INodeType {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
|
|
||||||
inputs: [],
|
inputs: [],
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
|
||||||
outputs: [NodeConnectionTypes.AiTool],
|
outputs: [NodeConnectionTypes.AiTool],
|
||||||
outputNames: ['Tool'],
|
outputNames: ['Tool'],
|
||||||
properties: [getConnectionHintNoticeField([NodeConnectionTypes.AiAgent])],
|
properties: [getConnectionHintNoticeField([NodeConnectionTypes.AiAgent])],
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
|
||||||
import { WolframAlphaTool } from '@langchain/community/tools/wolframalpha';
|
import { WolframAlphaTool } from '@langchain/community/tools/wolframalpha';
|
||||||
import {
|
import {
|
||||||
NodeConnectionTypes,
|
NodeConnectionTypes,
|
||||||
@@ -42,9 +41,9 @@ export class ToolWolframAlpha implements INodeType {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
|
|
||||||
inputs: [],
|
inputs: [],
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
|
||||||
outputs: [NodeConnectionTypes.AiTool],
|
outputs: [NodeConnectionTypes.AiTool],
|
||||||
outputNames: ['Tool'],
|
outputNames: ['Tool'],
|
||||||
properties: [getConnectionHintNoticeField([NodeConnectionTypes.AiAgent])],
|
properties: [getConnectionHintNoticeField([NodeConnectionTypes.AiAgent])],
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/* eslint-disable n8n-nodes-base/node-filename-against-convention */
|
/* eslint-disable n8n-nodes-base/node-filename-against-convention */
|
||||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
|
||||||
import type { INodeTypeDescription } from 'n8n-workflow';
|
import type { INodeTypeDescription } from 'n8n-workflow';
|
||||||
import { NodeConnectionTypes } from 'n8n-workflow';
|
import { NodeConnectionTypes } from 'n8n-workflow';
|
||||||
|
|
||||||
@@ -33,9 +33,9 @@ export const versionDescription: INodeTypeDescription = {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
|
|
||||||
inputs: [],
|
inputs: [],
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
|
||||||
outputs: [NodeConnectionTypes.AiTool],
|
outputs: [NodeConnectionTypes.AiTool],
|
||||||
outputNames: ['Tool'],
|
outputNames: ['Tool'],
|
||||||
properties: [
|
properties: [
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable @typescript-eslint/dot-notation */ // Disabled to allow access to private methods
|
|
||||||
import { DynamicTool } from '@langchain/core/tools';
|
import { DynamicTool } from '@langchain/core/tools';
|
||||||
import { ApplicationError, NodeOperationError } from 'n8n-workflow';
|
import { ApplicationError, NodeOperationError } from 'n8n-workflow';
|
||||||
import type {
|
import type {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/* eslint-disable n8n-nodes-base/node-filename-against-convention */
|
/* eslint-disable n8n-nodes-base/node-filename-against-convention */
|
||||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
|
||||||
import { NodeConnectionTypes, type INodeTypeDescription } from 'n8n-workflow';
|
import { NodeConnectionTypes, type INodeTypeDescription } from 'n8n-workflow';
|
||||||
|
|
||||||
import { getConnectionHintNoticeField } from '../../../../utils/sharedFields';
|
import { getConnectionHintNoticeField } from '../../../../utils/sharedFields';
|
||||||
|
|||||||
@@ -165,7 +165,7 @@ export class VectorStoreInMemory extends createVectorStoreNode<MemoryVectorStore
|
|||||||
this.logger,
|
this.logger,
|
||||||
);
|
);
|
||||||
|
|
||||||
const memoryKey = !!name ? (name as string) : DEFAULT_MEMORY_KEY;
|
const memoryKey = name ? (name as string) : DEFAULT_MEMORY_KEY;
|
||||||
await vectorStoreSingleton.getVectorStore(memoryKey);
|
await vectorStoreSingleton.getVectorStore(memoryKey);
|
||||||
|
|
||||||
return memoryKey;
|
return memoryKey;
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
|
||||||
import type { Embeddings } from '@langchain/core/embeddings';
|
import type { Embeddings } from '@langchain/core/embeddings';
|
||||||
import type { Document } from 'langchain/document';
|
import type { Document } from 'langchain/document';
|
||||||
import {
|
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: [
|
inputs: [
|
||||||
NodeConnectionTypes.Main,
|
NodeConnectionTypes.Main,
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
|
||||||
import type { Embeddings } from '@langchain/core/embeddings';
|
import type { Embeddings } from '@langchain/core/embeddings';
|
||||||
import {
|
import {
|
||||||
NodeConnectionTypes,
|
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: [
|
inputs: [
|
||||||
{
|
{
|
||||||
displayName: 'Embedding',
|
displayName: 'Embedding',
|
||||||
|
|||||||
@@ -254,7 +254,7 @@ export class VectorStorePGVector extends createVectorStoreNode<ExtendedPGVectorS
|
|||||||
{},
|
{},
|
||||||
) as CollectionOptions;
|
) as CollectionOptions;
|
||||||
|
|
||||||
if (collectionOptions && collectionOptions.useCollection) {
|
if (collectionOptions?.useCollection) {
|
||||||
config.collectionName = collectionOptions.collectionName;
|
config.collectionName = collectionOptions.collectionName;
|
||||||
config.collectionTableName = collectionOptions.collectionTableName;
|
config.collectionTableName = collectionOptions.collectionTableName;
|
||||||
}
|
}
|
||||||
@@ -296,7 +296,7 @@ export class VectorStorePGVector extends createVectorStoreNode<ExtendedPGVectorS
|
|||||||
{},
|
{},
|
||||||
) as CollectionOptions;
|
) as CollectionOptions;
|
||||||
|
|
||||||
if (collectionOptions && collectionOptions.useCollection) {
|
if (collectionOptions?.useCollection) {
|
||||||
config.collectionName = collectionOptions.collectionName;
|
config.collectionName = collectionOptions.collectionName;
|
||||||
config.collectionTableName = collectionOptions.collectionTableName;
|
config.collectionTableName = collectionOptions.collectionTableName;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,12 +22,7 @@ class ExtendedQdrantVectorStore extends QdrantVectorStore {
|
|||||||
return await super.fromExistingCollection(embeddings, args);
|
return await super.fromExistingCollection(embeddings, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
async similaritySearch(
|
async similaritySearch(query: string, k: number, filter?: IDataObject, callbacks?: Callbacks) {
|
||||||
query: string,
|
|
||||||
k: number,
|
|
||||||
filter?: IDataObject,
|
|
||||||
callbacks?: Callbacks | undefined,
|
|
||||||
) {
|
|
||||||
const mergedFilter = { ...ExtendedQdrantVectorStore.defaultFilter, ...filter };
|
const mergedFilter = { ...ExtendedQdrantVectorStore.defaultFilter, ...filter };
|
||||||
return await super.similaritySearch(query, k, mergedFilter, callbacks);
|
return await super.similaritySearch(query, k, mergedFilter, callbacks);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -97,7 +97,6 @@ export class VectorStoreSupabaseLoad implements INodeType {
|
|||||||
0,
|
0,
|
||||||
)) as Embeddings;
|
)) as Embeddings;
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
||||||
const client = createClient(credentials.host as string, credentials.serviceRole as string);
|
const client = createClient(credentials.host as string, credentials.serviceRole as string);
|
||||||
const config: SupabaseLibArgs = {
|
const config: SupabaseLibArgs = {
|
||||||
client,
|
client,
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable @typescript-eslint/dot-notation */
|
|
||||||
import { Document } from '@langchain/core/documents';
|
import { Document } from '@langchain/core/documents';
|
||||||
import type { OpenAIEmbeddings } from '@langchain/openai';
|
import type { OpenAIEmbeddings } from '@langchain/openai';
|
||||||
import { mock } from 'jest-mock-extended';
|
import { mock } from 'jest-mock-extended';
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable @typescript-eslint/dot-notation */
|
|
||||||
import { mock } from 'jest-mock-extended';
|
import { mock } from 'jest-mock-extended';
|
||||||
import type { MemoryVectorStore } from 'langchain/vectorstores/memory';
|
import type { MemoryVectorStore } from 'langchain/vectorstores/memory';
|
||||||
|
|
||||||
|
|||||||
@@ -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 { Embeddings } from '@langchain/core/embeddings';
|
||||||
import type { VectorStore } from '@langchain/core/vectorstores';
|
import type { VectorStore } from '@langchain/core/vectorstores';
|
||||||
import { NodeConnectionTypes, NodeOperationError } from 'n8n-workflow';
|
import { NodeConnectionTypes, NodeOperationError } from 'n8n-workflow';
|
||||||
@@ -77,7 +75,7 @@ export const createVectorStoreNode = <T extends VectorStore = VectorStore>(
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
credentials: args.meta.credentials,
|
credentials: args.meta.credentials,
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
|
|
||||||
inputs: `={{
|
inputs: `={{
|
||||||
((parameters) => {
|
((parameters) => {
|
||||||
const mode = parameters?.mode;
|
const mode = parameters?.mode;
|
||||||
|
|||||||
@@ -52,7 +52,6 @@ const properties: INodeProperties[] = [
|
|||||||
type: 'options',
|
type: 'options',
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
|
|
||||||
name: 'Use memory connector',
|
name: 'Use memory connector',
|
||||||
value: 'connector',
|
value: 'connector',
|
||||||
description: 'Connect one of the supported memory nodes',
|
description: 'Connect one of the supported memory nodes',
|
||||||
|
|||||||
@@ -68,7 +68,6 @@ const configureNodeInputs = (
|
|||||||
return ['main'];
|
return ['main'];
|
||||||
};
|
};
|
||||||
|
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-missing-subtitle
|
|
||||||
export const versionDescription: INodeTypeDescription = {
|
export const versionDescription: INodeTypeDescription = {
|
||||||
displayName: 'OpenAI',
|
displayName: 'OpenAI',
|
||||||
name: 'openAi',
|
name: 'openAi',
|
||||||
|
|||||||
@@ -441,8 +441,8 @@ export function logWrapper<
|
|||||||
return async (
|
return async (
|
||||||
query: string,
|
query: string,
|
||||||
k?: number,
|
k?: number,
|
||||||
filter?: BiquadFilterType | undefined,
|
filter?: BiquadFilterType,
|
||||||
_callbacks?: Callbacks | undefined,
|
_callbacks?: Callbacks,
|
||||||
): Promise<Document[]> => {
|
): Promise<Document[]> => {
|
||||||
connectionType = NodeConnectionTypes.AiVectorStore;
|
connectionType = NodeConnectionTypes.AiVectorStore;
|
||||||
const { index } = executeFunctions.addInputData(connectionType, [
|
const { index } = executeFunctions.addInputData(connectionType, [
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
||||||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
||||||
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
||||||
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
||||||
/* eslint-disable @typescript-eslint/no-require-imports */
|
/* eslint-disable @typescript-eslint/no-require-imports */
|
||||||
import type { TiktokenEncoding } from 'js-tiktoken/lite';
|
import type { TiktokenEncoding } from 'js-tiktoken/lite';
|
||||||
import { Tiktoken } from 'js-tiktoken/lite';
|
import { Tiktoken } from 'js-tiktoken/lite';
|
||||||
@@ -86,7 +86,6 @@ describe('tiktoken utils', () => {
|
|||||||
const mockTiktoken = {};
|
const mockTiktoken = {};
|
||||||
(Tiktoken as unknown as jest.Mock).mockReturnValue(mockTiktoken);
|
(Tiktoken as unknown as jest.Mock).mockReturnValue(mockTiktoken);
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
||||||
const result = await getEncoding('unknown_encoding' as unknown as TiktokenEncoding);
|
const result = await getEncoding('unknown_encoding' as unknown as TiktokenEncoding);
|
||||||
|
|
||||||
expect(Tiktoken).toHaveBeenCalledWith({ mockCl100kBase: 'data' });
|
expect(Tiktoken).toHaveBeenCalledWith({ mockCl100kBase: 'data' });
|
||||||
|
|||||||
Reference in New Issue
Block a user