mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +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 { mock } from 'jest-mock-extended';
|
||||
import type { ISupplyDataFunctions, INode, ILoadOptionsFunctions } from 'n8n-workflow';
|
||||
|
||||
@@ -67,9 +67,7 @@ function getInputs(
|
||||
type,
|
||||
displayName,
|
||||
required: isModelType,
|
||||
maxConnections: ['ai_languageModel', 'ai_memory', 'ai_outputParser'].includes(
|
||||
type as NodeConnectionType,
|
||||
)
|
||||
maxConnections: ['ai_languageModel', 'ai_memory', 'ai_outputParser'].includes(type)
|
||||
? 1
|
||||
: undefined,
|
||||
};
|
||||
@@ -278,7 +276,6 @@ export class AgentV1 implements INodeType {
|
||||
outputs: [NodeConnectionTypes.Main],
|
||||
credentials: [
|
||||
{
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-credentials-name-unsuffixed
|
||||
name: 'mySql',
|
||||
required: true,
|
||||
testedBy: 'mysqlConnectionTest',
|
||||
|
||||
@@ -36,9 +36,7 @@ function getInputs(
|
||||
type,
|
||||
displayName,
|
||||
required,
|
||||
maxConnections: ['ai_languageModel', 'ai_memory', 'ai_outputParser'].includes(
|
||||
type as NodeConnectionType,
|
||||
)
|
||||
maxConnections: ['ai_languageModel', 'ai_memory', 'ai_outputParser'].includes(type)
|
||||
? 1
|
||||
: undefined,
|
||||
};
|
||||
|
||||
@@ -61,7 +61,6 @@ export const sqlAgentAgentProperties: INodeProperties[] = [
|
||||
default: '',
|
||||
},
|
||||
{
|
||||
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
|
||||
displayName:
|
||||
"Pass the SQLite database into this node as binary data, e.g. by inserting a 'Read/Write Files from Disk' node beforehand",
|
||||
name: 'sqLiteFileNotice',
|
||||
|
||||
@@ -103,7 +103,6 @@ export function fixEmptyContentMessage(
|
||||
if (Array.isArray(step.messageLog)) {
|
||||
step.messageLog.forEach((message: BaseMessage) => {
|
||||
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) => {
|
||||
if (content.input === '') {
|
||||
content.input = {};
|
||||
|
||||
@@ -198,7 +198,7 @@ export class OpenAiAssistant implements INodeType {
|
||||
properties: {
|
||||
name: '={{$responseItem.name}}',
|
||||
value: '={{$responseItem.id}}',
|
||||
// eslint-disable-next-line n8n-local-rules/no-interpolation-in-regular-string
|
||||
|
||||
description: '={{$responseItem.model}}',
|
||||
},
|
||||
},
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
||||
import { HumanMessage } from '@langchain/core/messages';
|
||||
import { ChatGoogleGenerativeAI } from '@langchain/google-genai';
|
||||
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: [
|
||||
NodeConnectionTypes.Main,
|
||||
{
|
||||
|
||||
@@ -29,7 +29,7 @@ export class ChainSummarizationV1 implements INodeType {
|
||||
name: 'Summarization Chain',
|
||||
color: '#909298',
|
||||
},
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
|
||||
|
||||
inputs: [
|
||||
NodeConnectionTypes.Main,
|
||||
{
|
||||
|
||||
@@ -60,7 +60,7 @@ export class ChainSummarizationV2 implements INodeType {
|
||||
name: 'Summarization Chain',
|
||||
color: '#909298',
|
||||
},
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
|
||||
|
||||
inputs: `={{ ((parameter) => { ${getInputs.toString()}; return getInputs(parameter) })($parameter) }}`,
|
||||
outputs: [NodeConnectionTypes.Main],
|
||||
credentials: [],
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
||||
import type { Tool } from '@langchain/core/tools';
|
||||
import { makeResolverFromLegacyOptions } from '@n8n/vm2';
|
||||
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 {
|
||||
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: [
|
||||
{
|
||||
displayName: 'Text Splitter',
|
||||
@@ -55,7 +54,7 @@ export class DocumentBinaryInputLoader implements INodeType {
|
||||
required: true,
|
||||
},
|
||||
],
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
||||
|
||||
outputs: [NodeConnectionTypes.AiDocument],
|
||||
outputNames: ['Document'],
|
||||
properties: [
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
||||
import { RecursiveCharacterTextSplitter, type TextSplitter } from '@langchain/textsplitters';
|
||||
import {
|
||||
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) }}`,
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
||||
|
||||
outputs: [NodeConnectionTypes.AiDocument],
|
||||
outputNames: ['Document'],
|
||||
properties: [
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
||||
import { GithubRepoLoader } from '@langchain/community/document_loaders/web/github';
|
||||
import type { TextSplitter } from '@langchain/textsplitters';
|
||||
import { RecursiveCharacterTextSplitter } from '@langchain/textsplitters';
|
||||
@@ -63,10 +62,10 @@ export class DocumentGithubLoader implements INodeType {
|
||||
required: true,
|
||||
},
|
||||
],
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
|
||||
|
||||
inputs: `={{ ((parameter) => { ${getInputs.toString()}; return getInputs(parameter) })($parameter) }}`,
|
||||
inputNames: ['Text Splitter'],
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
||||
|
||||
outputs: [NodeConnectionTypes.AiDocument],
|
||||
outputNames: ['Document'],
|
||||
properties: [
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
||||
import type { TextSplitter } from '@langchain/textsplitters';
|
||||
import {
|
||||
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: [
|
||||
{
|
||||
displayName: 'Text Splitter',
|
||||
@@ -48,7 +47,7 @@ export class DocumentJsonInputLoader implements INodeType {
|
||||
},
|
||||
],
|
||||
inputNames: ['Text Splitter'],
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
||||
|
||||
outputs: [NodeConnectionTypes.AiDocument],
|
||||
outputNames: ['Document'],
|
||||
properties: [
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
||||
import { BedrockEmbeddings } from '@langchain/aws';
|
||||
import {
|
||||
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: [],
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
||||
|
||||
outputs: [NodeConnectionTypes.AiEmbedding],
|
||||
outputNames: ['Embeddings'],
|
||||
requestDefaults: {
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
||||
import { AzureOpenAIEmbeddings } from '@langchain/openai';
|
||||
import {
|
||||
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: [],
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
||||
|
||||
outputs: [NodeConnectionTypes.AiEmbedding],
|
||||
outputNames: ['Embeddings'],
|
||||
properties: [
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
||||
import { CohereEmbeddings } from '@langchain/cohere';
|
||||
import {
|
||||
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: [],
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
||||
|
||||
outputs: [NodeConnectionTypes.AiEmbedding],
|
||||
outputNames: ['Embeddings'],
|
||||
properties: [
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
||||
import { GoogleGenerativeAIEmbeddings } from '@langchain/google-genai';
|
||||
import {
|
||||
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: [],
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
||||
|
||||
outputs: [NodeConnectionTypes.AiEmbedding],
|
||||
outputNames: ['Embeddings'],
|
||||
properties: [
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
||||
import { ProjectsClient } from '@google-cloud/resource-manager';
|
||||
import { VertexAIEmbeddings } from '@langchain/google-vertexai';
|
||||
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: [],
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
||||
|
||||
outputs: [NodeConnectionTypes.AiEmbedding],
|
||||
outputNames: ['Embeddings'],
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
||||
import { HuggingFaceInferenceEmbeddings } from '@langchain/community/embeddings/hf';
|
||||
import {
|
||||
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: [],
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
||||
|
||||
outputs: [NodeConnectionTypes.AiEmbedding],
|
||||
outputNames: ['Embeddings'],
|
||||
properties: [
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
||||
import type { MistralAIEmbeddingsParams } from '@langchain/mistralai';
|
||||
import { MistralAIEmbeddings } from '@langchain/mistralai';
|
||||
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: [],
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
||||
|
||||
outputs: [NodeConnectionTypes.AiEmbedding],
|
||||
outputNames: ['Embeddings'],
|
||||
requestDefaults: {
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
||||
import { OllamaEmbeddings } from '@langchain/ollama';
|
||||
import {
|
||||
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: [],
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
||||
|
||||
outputs: [NodeConnectionTypes.AiEmbedding],
|
||||
outputNames: ['Embeddings'],
|
||||
properties: [getConnectionHintNoticeField([NodeConnectionTypes.AiVectorStore]), ollamaModel],
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
||||
import { OpenAIEmbeddings } from '@langchain/openai';
|
||||
import {
|
||||
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: [],
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
||||
|
||||
outputs: [NodeConnectionTypes.AiEmbedding],
|
||||
outputNames: ['Embeddings'],
|
||||
requestDefaults: {
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
||||
|
||||
import { ChatAnthropic } from '@langchain/anthropic';
|
||||
import type { LLMResult } from '@langchain/core/outputs';
|
||||
import {
|
||||
@@ -15,9 +13,9 @@ import {
|
||||
import { getHttpProxyAgent } from '@utils/httpProxyAgent';
|
||||
import { getConnectionHintNoticeField } from '@utils/sharedFields';
|
||||
|
||||
import { searchModels } from './methods/searchModels';
|
||||
import { makeN8nLlmFailedAttemptHandler } from '../n8nLlmFailedAttemptHandler';
|
||||
import { N8nLlmTracing } from '../N8nLlmTracing';
|
||||
import { searchModels } from './methods/searchModels';
|
||||
|
||||
const modelField: INodeProperties = {
|
||||
displayName: 'Model',
|
||||
@@ -82,7 +80,7 @@ export class LmChatAnthropic implements INodeType {
|
||||
|
||||
description: INodeTypeDescription = {
|
||||
displayName: 'Anthropic Chat Model',
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-name-miscased
|
||||
|
||||
name: 'lmChatAnthropic',
|
||||
icon: 'file:anthropic.svg',
|
||||
group: ['transform'],
|
||||
@@ -107,9 +105,9 @@ export class LmChatAnthropic implements INodeType {
|
||||
},
|
||||
alias: ['claude', 'sonnet', 'opus'],
|
||||
},
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
|
||||
|
||||
inputs: [],
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
||||
|
||||
outputs: [NodeConnectionTypes.AiLanguageModel],
|
||||
outputNames: ['Model'],
|
||||
credentials: [
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
||||
|
||||
import type { ChatOllamaInput } from '@langchain/ollama';
|
||||
import { ChatOllama } from '@langchain/ollama';
|
||||
import {
|
||||
@@ -19,7 +17,7 @@ import { N8nLlmTracing } from '../N8nLlmTracing';
|
||||
export class LmChatOllama implements INodeType {
|
||||
description: INodeTypeDescription = {
|
||||
displayName: 'Ollama Chat Model',
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-name-miscased
|
||||
|
||||
name: 'lmChatOllama',
|
||||
icon: 'file:ollama.svg',
|
||||
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: [],
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
||||
|
||||
outputs: [NodeConnectionTypes.AiLanguageModel],
|
||||
outputNames: ['Model'],
|
||||
...ollamaDescription,
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
||||
|
||||
import { ChatOpenAI, type ClientOptions } from '@langchain/openai';
|
||||
import {
|
||||
NodeConnectionTypes,
|
||||
@@ -26,7 +24,7 @@ export class LmChatOpenAi implements INodeType {
|
||||
|
||||
description: INodeTypeDescription = {
|
||||
displayName: 'OpenAI Chat Model',
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-name-miscased
|
||||
|
||||
name: 'lmChatOpenAi',
|
||||
icon: { light: 'file:openAiLight.svg', dark: 'file:openAiLight.dark.svg' },
|
||||
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: [],
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
||||
|
||||
outputs: [NodeConnectionTypes.AiLanguageModel],
|
||||
outputNames: ['Model'],
|
||||
credentials: [
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
||||
import { Cohere } from '@langchain/cohere';
|
||||
import {
|
||||
NodeConnectionTypes,
|
||||
@@ -16,7 +15,7 @@ import { N8nLlmTracing } from '../N8nLlmTracing';
|
||||
export class LmCohere implements INodeType {
|
||||
description: INodeTypeDescription = {
|
||||
displayName: 'Cohere Model',
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-name-miscased
|
||||
|
||||
name: 'lmCohere',
|
||||
icon: { light: 'file:cohere.svg', dark: 'file:cohere.dark.svg' },
|
||||
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: [],
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
||||
|
||||
outputs: [NodeConnectionTypes.AiLanguageModel],
|
||||
outputNames: ['Model'],
|
||||
credentials: [
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
||||
|
||||
import { Ollama } from '@langchain/community/llms/ollama';
|
||||
import {
|
||||
NodeConnectionTypes,
|
||||
@@ -18,7 +16,7 @@ import { N8nLlmTracing } from '../N8nLlmTracing';
|
||||
export class LmOllama implements INodeType {
|
||||
description: INodeTypeDescription = {
|
||||
displayName: 'Ollama Model',
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-name-miscased
|
||||
|
||||
name: 'lmOllama',
|
||||
icon: 'file:ollama.svg',
|
||||
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: [],
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
||||
|
||||
outputs: [NodeConnectionTypes.AiLanguageModel],
|
||||
outputNames: ['Model'],
|
||||
...ollamaDescription,
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
||||
import { OpenAI, type ClientOptions } from '@langchain/openai';
|
||||
import { NodeConnectionTypes } from 'n8n-workflow';
|
||||
import type {
|
||||
@@ -28,7 +27,7 @@ type LmOpenAiOptions = {
|
||||
export class LmOpenAi implements INodeType {
|
||||
description: INodeTypeDescription = {
|
||||
displayName: 'OpenAI Model',
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-name-miscased
|
||||
|
||||
name: 'lmOpenAi',
|
||||
hidden: true,
|
||||
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: [],
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
||||
|
||||
outputs: [NodeConnectionTypes.AiLanguageModel],
|
||||
outputNames: ['Model'],
|
||||
credentials: [
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
||||
import { HuggingFaceInference } from '@langchain/community/llms/hf';
|
||||
import {
|
||||
NodeConnectionTypes,
|
||||
@@ -16,7 +15,7 @@ import { N8nLlmTracing } from '../N8nLlmTracing';
|
||||
export class LmOpenHuggingFaceInference implements INodeType {
|
||||
description: INodeTypeDescription = {
|
||||
displayName: 'Hugging Face Inference Model',
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-name-miscased
|
||||
|
||||
name: 'lmOpenHuggingFaceInference',
|
||||
icon: 'file:huggingface.svg',
|
||||
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: [],
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
||||
|
||||
outputs: [NodeConnectionTypes.AiLanguageModel],
|
||||
outputNames: ['Model'],
|
||||
credentials: [
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
||||
import { ChatBedrockConverse } from '@langchain/aws';
|
||||
import {
|
||||
NodeConnectionTypes,
|
||||
@@ -17,7 +16,7 @@ import { N8nLlmTracing } from '../N8nLlmTracing';
|
||||
export class LmChatAwsBedrock implements INodeType {
|
||||
description: INodeTypeDescription = {
|
||||
displayName: 'AWS Bedrock Chat Model',
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-name-miscased
|
||||
|
||||
name: 'lmChatAwsBedrock',
|
||||
icon: 'file:bedrock.svg',
|
||||
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: [],
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
||||
|
||||
outputs: [NodeConnectionTypes.AiLanguageModel],
|
||||
outputNames: ['Model'],
|
||||
credentials: [
|
||||
{
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-credentials-name-unsuffixed
|
||||
name: 'aws',
|
||||
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 {
|
||||
NodeOperationError,
|
||||
@@ -27,7 +25,7 @@ import { N8nLlmTracing } from '../N8nLlmTracing';
|
||||
export class LmChatAzureOpenAi implements INodeType {
|
||||
description: INodeTypeDescription = {
|
||||
displayName: 'Azure OpenAI Chat Model',
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-name-miscased
|
||||
|
||||
name: 'lmChatAzureOpenAi',
|
||||
icon: 'file:azure.svg',
|
||||
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: [],
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
||||
|
||||
outputs: [NodeConnectionTypes.AiLanguageModel],
|
||||
outputNames: ['Model'],
|
||||
credentials: [
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
||||
|
||||
import { ChatOpenAI, type ClientOptions } from '@langchain/openai';
|
||||
import {
|
||||
NodeConnectionTypes,
|
||||
@@ -20,7 +18,7 @@ import { N8nLlmTracing } from '../N8nLlmTracing';
|
||||
export class LmChatDeepSeek implements INodeType {
|
||||
description: INodeTypeDescription = {
|
||||
displayName: 'DeepSeek Chat Model',
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-name-miscased
|
||||
|
||||
name: 'lmChatDeepSeek',
|
||||
icon: 'file:deepseek.svg',
|
||||
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: [],
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
||||
|
||||
outputs: [NodeConnectionTypes.AiLanguageModel],
|
||||
outputNames: ['Model'],
|
||||
credentials: [
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
||||
import type { SafetySetting } from '@google/generative-ai';
|
||||
import { ChatGoogleGenerativeAI } from '@langchain/google-genai';
|
||||
import { NodeConnectionTypes } from 'n8n-workflow';
|
||||
@@ -26,7 +25,7 @@ function errorDescriptionMapper(error: NodeError) {
|
||||
export class LmChatGoogleGemini implements INodeType {
|
||||
description: INodeTypeDescription = {
|
||||
displayName: 'Google Gemini Chat Model',
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-name-miscased
|
||||
|
||||
name: 'lmChatGoogleGemini',
|
||||
icon: 'file:google.svg',
|
||||
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: [],
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
||||
|
||||
outputs: [NodeConnectionTypes.AiLanguageModel],
|
||||
outputNames: ['Model'],
|
||||
credentials: [
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
||||
import type { SafetySetting } from '@google/generative-ai';
|
||||
import { ProjectsClient } from '@google-cloud/resource-manager';
|
||||
import { ChatVertexAI } from '@langchain/google-vertexai';
|
||||
@@ -24,7 +23,7 @@ import { N8nLlmTracing } from '../N8nLlmTracing';
|
||||
export class LmChatGoogleVertex implements INodeType {
|
||||
description: INodeTypeDescription = {
|
||||
displayName: 'Google Vertex Chat Model',
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-name-miscased
|
||||
|
||||
name: 'lmChatGoogleVertex',
|
||||
icon: 'file:google.svg',
|
||||
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: [],
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
||||
|
||||
outputs: [NodeConnectionTypes.AiLanguageModel],
|
||||
outputNames: ['Model'],
|
||||
credentials: [
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
||||
import { ChatGroq } from '@langchain/groq';
|
||||
import {
|
||||
NodeConnectionTypes,
|
||||
@@ -17,7 +16,7 @@ import { N8nLlmTracing } from '../N8nLlmTracing';
|
||||
export class LmChatGroq implements INodeType {
|
||||
description: INodeTypeDescription = {
|
||||
displayName: 'Groq Chat Model',
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-name-miscased
|
||||
|
||||
name: 'lmChatGroq',
|
||||
icon: 'file:groq.svg',
|
||||
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: [],
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
||||
|
||||
outputs: [NodeConnectionTypes.AiLanguageModel],
|
||||
outputNames: ['Model'],
|
||||
credentials: [
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
||||
|
||||
import type { ChatMistralAIInput } from '@langchain/mistralai';
|
||||
import { ChatMistralAI } from '@langchain/mistralai';
|
||||
import {
|
||||
@@ -18,7 +16,7 @@ import { N8nLlmTracing } from '../N8nLlmTracing';
|
||||
export class LmChatMistralCloud implements INodeType {
|
||||
description: INodeTypeDescription = {
|
||||
displayName: 'Mistral Cloud Chat Model',
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-name-miscased
|
||||
|
||||
name: 'lmChatMistralCloud',
|
||||
icon: 'file:mistral.svg',
|
||||
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: [],
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
||||
|
||||
outputs: [NodeConnectionTypes.AiLanguageModel],
|
||||
outputNames: ['Model'],
|
||||
credentials: [
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
||||
|
||||
import { ChatOpenAI, type ClientOptions } from '@langchain/openai';
|
||||
import {
|
||||
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: [],
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
||||
|
||||
outputs: [NodeConnectionTypes.AiLanguageModel],
|
||||
outputNames: ['Model'],
|
||||
credentials: [
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
||||
|
||||
import { ChatOpenAI, type ClientOptions } from '@langchain/openai';
|
||||
import {
|
||||
NodeConnectionTypes,
|
||||
@@ -20,7 +18,7 @@ import { N8nLlmTracing } from '../N8nLlmTracing';
|
||||
export class LmChatXAiGrok implements INodeType {
|
||||
description: INodeTypeDescription = {
|
||||
displayName: 'xAI Grok Chat Model',
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-name-miscased
|
||||
|
||||
name: 'lmChatXAiGrok',
|
||||
icon: { light: 'file:logo.dark.svg', dark: 'file:logo.svg' },
|
||||
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: [],
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
||||
|
||||
outputs: [NodeConnectionTypes.AiLanguageModel],
|
||||
outputNames: ['Model'],
|
||||
credentials: [
|
||||
|
||||
@@ -188,11 +188,7 @@ export class N8nLlmTracing extends BaseCallbackHandler {
|
||||
this.promptTokensEstimate = estimatedTokens;
|
||||
}
|
||||
|
||||
async handleLLMError(
|
||||
error: IDataObject | Error,
|
||||
runId: string,
|
||||
parentRunId?: string | undefined,
|
||||
) {
|
||||
async handleLLMError(error: IDataObject | Error, runId: string, parentRunId?: string) {
|
||||
const runDetails = this.runsMap[runId] ?? { index: Object.keys(this.runsMap).length };
|
||||
|
||||
// Filter out non-x- headers to avoid leaking sensitive information in logs
|
||||
|
||||
@@ -136,11 +136,7 @@ export class N8nNonEstimatingTracing extends BaseCallbackHandler {
|
||||
};
|
||||
}
|
||||
|
||||
async handleLLMError(
|
||||
error: IDataObject | Error,
|
||||
runId: string,
|
||||
parentRunId?: string | undefined,
|
||||
) {
|
||||
async handleLLMError(error: IDataObject | Error, runId: string, parentRunId?: string) {
|
||||
const runDetails = this.runsMap[runId] ?? { index: Object.keys(this.runsMap).length };
|
||||
|
||||
// Filter out non-x- headers to avoid leaking sensitive information in logs
|
||||
|
||||
@@ -27,13 +27,13 @@ export const n8nDefaultFailedAttemptHandler = (error: any) => {
|
||||
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') {
|
||||
throw error;
|
||||
}
|
||||
|
||||
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;
|
||||
if (status && STATUS_NO_RETRY.includes(+status)) {
|
||||
throw error;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
||||
import type { BufferWindowMemoryInput } from 'langchain/memory';
|
||||
import { BufferWindowMemory } from 'langchain/memory';
|
||||
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: [],
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
||||
|
||||
outputs: [NodeConnectionTypes.AiMemory],
|
||||
outputNames: ['Memory'],
|
||||
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 { BaseMessage } from '@langchain/core/messages';
|
||||
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: [
|
||||
NodeConnectionTypes.Main,
|
||||
{
|
||||
@@ -69,7 +68,7 @@ export class MemoryChatRetriever implements INodeType {
|
||||
required: true,
|
||||
},
|
||||
],
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
||||
|
||||
outputs: [NodeConnectionTypes.Main],
|
||||
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 { MessageContent, BaseMessage } 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: [
|
||||
{
|
||||
displayName: '',
|
||||
@@ -109,7 +108,7 @@ export class MemoryManager implements INodeType {
|
||||
maxConnections: 1,
|
||||
},
|
||||
],
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
||||
|
||||
outputs: [
|
||||
{
|
||||
displayName: '',
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
||||
import { MotorheadMemory } from '@langchain/community/memory/motorhead_memory';
|
||||
import {
|
||||
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: [],
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
||||
|
||||
outputs: [NodeConnectionTypes.AiMemory],
|
||||
outputNames: ['Memory'],
|
||||
credentials: [
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
||||
import { PostgresChatMessageHistory } from '@langchain/community/stores/message/postgres';
|
||||
import { BufferMemory, BufferWindowMemory } from 'langchain/memory';
|
||||
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: [],
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
||||
|
||||
outputs: [NodeConnectionTypes.AiMemory],
|
||||
outputNames: ['Memory'],
|
||||
properties: [
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
||||
import type { RedisChatMessageHistoryInput } from '@langchain/redis';
|
||||
import { RedisChatMessageHistory } from '@langchain/redis';
|
||||
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: [],
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
||||
|
||||
outputs: [NodeConnectionTypes.AiMemory],
|
||||
outputNames: ['Memory'],
|
||||
properties: [
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
||||
import { XataChatMessageHistory } from '@langchain/community/stores/message/xata';
|
||||
import { BaseClient } from '@xata.io/client';
|
||||
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: [],
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
||||
|
||||
outputs: [NodeConnectionTypes.AiMemory],
|
||||
outputNames: ['Memory'],
|
||||
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 { ZepMemory } from '@langchain/community/memory/zep';
|
||||
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: [],
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
||||
|
||||
outputs: [NodeConnectionTypes.AiMemory],
|
||||
outputNames: ['Memory'],
|
||||
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: [
|
||||
{
|
||||
displayName: 'Model',
|
||||
@@ -57,7 +57,7 @@ export class OutputParserAutofixing implements INodeType {
|
||||
type: NodeConnectionTypes.AiOutputParser,
|
||||
},
|
||||
],
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
||||
|
||||
outputs: [NodeConnectionTypes.AiOutputParser],
|
||||
outputNames: ['Output Parser'],
|
||||
properties: [
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* eslint-disable @typescript-eslint/unbound-method */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
||||
|
||||
import type { BaseLanguageModel } from '@langchain/core/language_models/base';
|
||||
import { OutputParserException } from '@langchain/core/output_parsers';
|
||||
import type { MockProxy } from 'jest-mock-extended';
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
||||
import {
|
||||
NodeConnectionTypes,
|
||||
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: [],
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
||||
|
||||
outputs: [NodeConnectionTypes.AiOutputParser],
|
||||
outputNames: ['Output Parser'],
|
||||
properties: [
|
||||
|
||||
@@ -66,7 +66,7 @@ export class OutputParserStructured implements INodeType {
|
||||
return [];
|
||||
})($parameter)
|
||||
}}`,
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
||||
|
||||
outputs: [NodeConnectionTypes.AiOutputParser],
|
||||
outputNames: ['Output Parser'],
|
||||
properties: [
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
||||
import { CohereRerank } from '@langchain/cohere';
|
||||
import {
|
||||
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 { BaseRetriever } from '@langchain/core/retrievers';
|
||||
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: [
|
||||
{
|
||||
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 { BaseRetriever } from '@langchain/core/retrievers';
|
||||
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: [
|
||||
{
|
||||
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 { VectorStore } from '@langchain/core/vectorstores';
|
||||
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: [
|
||||
{
|
||||
displayName: 'Vector Store',
|
||||
@@ -46,7 +45,7 @@ export class RetrieverVectorStore implements INodeType {
|
||||
required: true,
|
||||
},
|
||||
],
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
||||
|
||||
outputs: [NodeConnectionTypes.AiRetriever],
|
||||
outputNames: ['Retriever'],
|
||||
properties: [
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
||||
import type { CallbackManagerForRetrieverRun } from '@langchain/core/callbacks/manager';
|
||||
import { Document } from '@langchain/core/documents';
|
||||
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 { CharacterTextSplitter } from '@langchain/textsplitters';
|
||||
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: [],
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
||||
|
||||
outputs: [NodeConnectionTypes.AiTextSplitter],
|
||||
outputNames: ['Text Splitter'],
|
||||
properties: [
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
||||
import type {
|
||||
RecursiveCharacterTextSplitterParams,
|
||||
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: [],
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
||||
|
||||
outputs: [NodeConnectionTypes.AiTextSplitter],
|
||||
outputNames: ['Text Splitter'],
|
||||
properties: [
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
||||
import {
|
||||
NodeConnectionTypes,
|
||||
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: [],
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
||||
|
||||
outputs: [NodeConnectionTypes.AiTextSplitter],
|
||||
outputNames: ['Text Splitter'],
|
||||
properties: [
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
||||
import type { TokenTextSplitterParams } from '@langchain/textsplitters';
|
||||
import { TextSplitter } from '@langchain/textsplitters';
|
||||
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 {
|
||||
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: [],
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
||||
|
||||
outputs: [NodeConnectionTypes.AiTool],
|
||||
outputNames: ['Tool'],
|
||||
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 type { JSONSchema7 } from 'json-schema';
|
||||
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: [],
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
||||
|
||||
outputs: [NodeConnectionTypes.AiTool],
|
||||
outputNames: ['Tool'],
|
||||
properties: [
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
||||
import { DynamicTool } from '@langchain/core/tools';
|
||||
import type {
|
||||
INodeType,
|
||||
@@ -65,9 +64,9 @@ export class ToolHttpRequest implements INodeType {
|
||||
},
|
||||
// Replaced by a `usableAsTool` version of the standalone HttpRequest node
|
||||
hidden: true,
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
|
||||
|
||||
inputs: [],
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
||||
|
||||
outputs: [NodeConnectionTypes.AiTool],
|
||||
outputNames: ['Tool'],
|
||||
properties: [
|
||||
|
||||
@@ -395,7 +395,6 @@ export const extractParametersFromText = (
|
||||
const parameters = extractPlaceholders(text);
|
||||
|
||||
if (parameters.length) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
||||
const inputParameters = prepareParameters(
|
||||
parameters.map((name) => ({
|
||||
name,
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
||||
import { SerpAPI } from '@langchain/community/tools/serpapi';
|
||||
import {
|
||||
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: [],
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
||||
|
||||
outputs: [NodeConnectionTypes.AiTool],
|
||||
outputNames: ['Tool'],
|
||||
credentials: [
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
||||
import { DynamicTool } from 'langchain/tools';
|
||||
import {
|
||||
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: [
|
||||
{
|
||||
displayName: 'Vector Store',
|
||||
@@ -55,7 +55,7 @@ export class ToolVectorStore implements INodeType {
|
||||
required: true,
|
||||
},
|
||||
],
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
||||
|
||||
outputs: [NodeConnectionTypes.AiTool],
|
||||
outputNames: ['Tool'],
|
||||
properties: [
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
||||
import { WikipediaQueryRun } from '@langchain/community/tools/wikipedia_query_run';
|
||||
import {
|
||||
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: [],
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
||||
|
||||
outputs: [NodeConnectionTypes.AiTool],
|
||||
outputNames: ['Tool'],
|
||||
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 {
|
||||
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: [],
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
||||
|
||||
outputs: [NodeConnectionTypes.AiTool],
|
||||
outputNames: ['Tool'],
|
||||
properties: [getConnectionHintNoticeField([NodeConnectionTypes.AiAgent])],
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* 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 { 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: [],
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
||||
|
||||
outputs: [NodeConnectionTypes.AiTool],
|
||||
outputNames: ['Tool'],
|
||||
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 { ApplicationError, NodeOperationError } from 'n8n-workflow';
|
||||
import type {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* 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 { getConnectionHintNoticeField } from '../../../../utils/sharedFields';
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
{
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable @typescript-eslint/dot-notation */
|
||||
import { mock } from 'jest-mock-extended';
|
||||
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 { 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;
|
||||
|
||||
@@ -52,7 +52,6 @@ const properties: INodeProperties[] = [
|
||||
type: 'options',
|
||||
options: [
|
||||
{
|
||||
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
|
||||
name: 'Use memory connector',
|
||||
value: 'connector',
|
||||
description: 'Connect one of the supported memory nodes',
|
||||
|
||||
@@ -68,7 +68,6 @@ const configureNodeInputs = (
|
||||
return ['main'];
|
||||
};
|
||||
|
||||
// eslint-disable-next-line n8n-nodes-base/node-class-description-missing-subtitle
|
||||
export const versionDescription: INodeTypeDescription = {
|
||||
displayName: 'OpenAI',
|
||||
name: 'openAi',
|
||||
|
||||
@@ -441,8 +441,8 @@ export function logWrapper<
|
||||
return async (
|
||||
query: string,
|
||||
k?: number,
|
||||
filter?: BiquadFilterType | undefined,
|
||||
_callbacks?: Callbacks | undefined,
|
||||
filter?: BiquadFilterType,
|
||||
_callbacks?: Callbacks,
|
||||
): Promise<Document[]> => {
|
||||
connectionType = NodeConnectionTypes.AiVectorStore;
|
||||
const { index } = executeFunctions.addInputData(connectionType, [
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
||||
/* eslint-disable @typescript-eslint/no-var-requires */
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-require-imports */
|
||||
import type { TiktokenEncoding } from 'js-tiktoken/lite';
|
||||
import { Tiktoken } from 'js-tiktoken/lite';
|
||||
@@ -86,7 +86,6 @@ describe('tiktoken utils', () => {
|
||||
const 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);
|
||||
|
||||
expect(Tiktoken).toHaveBeenCalledWith({ mockCl100kBase: 'data' });
|
||||
|
||||
Reference in New Issue
Block a user