mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
refactor(core): Shovel around more of AI code (no-changelog) (#12218)
This commit is contained in:
committed by
GitHub
parent
a8e7a05856
commit
2ce1644d01
@@ -1,4 +1,5 @@
|
||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
||||
import { Calculator } from '@langchain/community/tools/calculator';
|
||||
import {
|
||||
NodeConnectionType,
|
||||
type INodeType,
|
||||
@@ -6,9 +7,9 @@ import {
|
||||
type ISupplyDataFunctions,
|
||||
type SupplyData,
|
||||
} from 'n8n-workflow';
|
||||
import { Calculator } from '@langchain/community/tools/calculator';
|
||||
import { logWrapper } from '../../../utils/logWrapper';
|
||||
import { getConnectionHintNoticeField } from '../../../utils/sharedFields';
|
||||
|
||||
import { logWrapper } from '@utils/logWrapper';
|
||||
import { getConnectionHintNoticeField } from '@utils/sharedFields';
|
||||
|
||||
export class ToolCalculator implements INodeType {
|
||||
description: INodeTypeDescription = {
|
||||
|
||||
@@ -15,14 +15,11 @@ import type {
|
||||
} from 'n8n-workflow';
|
||||
import { jsonParse, NodeConnectionType, NodeOperationError } from 'n8n-workflow';
|
||||
|
||||
import { inputSchemaField, jsonSchemaExampleField, schemaTypeField } from '@utils/descriptions';
|
||||
import { convertJsonSchemaToZod, generateSchema } from '@utils/schemaParsing';
|
||||
import { getConnectionHintNoticeField } from '@utils/sharedFields';
|
||||
|
||||
import type { DynamicZodObject } from '../../../types/zod.types';
|
||||
import {
|
||||
inputSchemaField,
|
||||
jsonSchemaExampleField,
|
||||
schemaTypeField,
|
||||
} from '../../../utils/descriptions';
|
||||
import { convertJsonSchemaToZod, generateSchema } from '../../../utils/schemaParsing';
|
||||
import { getConnectionHintNoticeField } from '../../../utils/sharedFields';
|
||||
|
||||
export class ToolCode implements INodeType {
|
||||
description: INodeTypeDescription = {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
||||
import { DynamicTool } from '@langchain/core/tools';
|
||||
import type {
|
||||
INodeType,
|
||||
INodeTypeDescription,
|
||||
@@ -9,19 +10,8 @@ import type {
|
||||
} from 'n8n-workflow';
|
||||
import { NodeConnectionType, NodeOperationError, tryToParseAlphanumericString } from 'n8n-workflow';
|
||||
|
||||
import { DynamicTool } from '@langchain/core/tools';
|
||||
import { getConnectionHintNoticeField } from '../../../utils/sharedFields';
|
||||
|
||||
import { N8nTool } from '../../../utils/N8nTool';
|
||||
import {
|
||||
configureHttpRequestFunction,
|
||||
configureResponseOptimizer,
|
||||
extractParametersFromText,
|
||||
prepareToolDescription,
|
||||
configureToolFunction,
|
||||
updateParametersAndOptions,
|
||||
makeToolInputSchema,
|
||||
} from './utils';
|
||||
import { N8nTool } from '@utils/N8nTool';
|
||||
import { getConnectionHintNoticeField } from '@utils/sharedFields';
|
||||
|
||||
import {
|
||||
authenticationProperties,
|
||||
@@ -31,8 +21,16 @@ import {
|
||||
placeholderDefinitionsCollection,
|
||||
specifyBySelector,
|
||||
} from './descriptions';
|
||||
|
||||
import type { PlaceholderDefinition, ToolParameter } from './interfaces';
|
||||
import {
|
||||
configureHttpRequestFunction,
|
||||
configureResponseOptimizer,
|
||||
extractParametersFromText,
|
||||
prepareToolDescription,
|
||||
configureToolFunction,
|
||||
updateParametersAndOptions,
|
||||
makeToolInputSchema,
|
||||
} from './utils';
|
||||
|
||||
export class ToolHttpRequest implements INodeType {
|
||||
description: INodeTypeDescription = {
|
||||
|
||||
@@ -2,7 +2,8 @@ import { mock } from 'jest-mock-extended';
|
||||
import type { IExecuteFunctions, INode } from 'n8n-workflow';
|
||||
import { jsonParse } from 'n8n-workflow';
|
||||
|
||||
import type { N8nTool } from '../../../../utils/N8nTool';
|
||||
import type { N8nTool } from '@utils/N8nTool';
|
||||
|
||||
import { ToolHttpRequest } from '../ToolHttpRequest.node';
|
||||
|
||||
describe('ToolHttpRequest', () => {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
||||
import { SerpAPI } from '@langchain/community/tools/serpapi';
|
||||
import {
|
||||
NodeConnectionType,
|
||||
type INodeType,
|
||||
@@ -6,9 +7,9 @@ import {
|
||||
type ISupplyDataFunctions,
|
||||
type SupplyData,
|
||||
} from 'n8n-workflow';
|
||||
import { SerpAPI } from '@langchain/community/tools/serpapi';
|
||||
import { logWrapper } from '../../../utils/logWrapper';
|
||||
import { getConnectionHintNoticeField } from '../../../utils/sharedFields';
|
||||
|
||||
import { logWrapper } from '@utils/logWrapper';
|
||||
import { getConnectionHintNoticeField } from '@utils/sharedFields';
|
||||
|
||||
export class ToolSerpApi implements INodeType {
|
||||
description: INodeTypeDescription = {
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
import type { BaseLanguageModel } from '@langchain/core/language_models/base';
|
||||
import type { VectorStore } from '@langchain/core/vectorstores';
|
||||
import { VectorDBQAChain } from 'langchain/chains';
|
||||
import { VectorStoreQATool } from 'langchain/tools';
|
||||
import type {
|
||||
INodeType,
|
||||
INodeTypeDescription,
|
||||
@@ -6,12 +10,8 @@ import type {
|
||||
} from 'n8n-workflow';
|
||||
import { NodeConnectionType } from 'n8n-workflow';
|
||||
|
||||
import { VectorStoreQATool } from 'langchain/tools';
|
||||
import type { VectorStore } from '@langchain/core/vectorstores';
|
||||
import type { BaseLanguageModel } from '@langchain/core/language_models/base';
|
||||
import { VectorDBQAChain } from 'langchain/chains';
|
||||
import { getConnectionHintNoticeField } from '../../../utils/sharedFields';
|
||||
import { logWrapper } from '../../../utils/logWrapper';
|
||||
import { logWrapper } from '@utils/logWrapper';
|
||||
import { getConnectionHintNoticeField } from '@utils/sharedFields';
|
||||
|
||||
export class ToolVectorStore implements INodeType {
|
||||
description: INodeTypeDescription = {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
||||
import { WikipediaQueryRun } from '@langchain/community/tools/wikipedia_query_run';
|
||||
import {
|
||||
NodeConnectionType,
|
||||
type INodeType,
|
||||
@@ -6,9 +7,9 @@ import {
|
||||
type ISupplyDataFunctions,
|
||||
type SupplyData,
|
||||
} from 'n8n-workflow';
|
||||
import { WikipediaQueryRun } from '@langchain/community/tools/wikipedia_query_run';
|
||||
import { logWrapper } from '../../../utils/logWrapper';
|
||||
import { getConnectionHintNoticeField } from '../../../utils/sharedFields';
|
||||
|
||||
import { logWrapper } from '@utils/logWrapper';
|
||||
import { getConnectionHintNoticeField } from '@utils/sharedFields';
|
||||
|
||||
export class ToolWikipedia implements INodeType {
|
||||
description: INodeTypeDescription = {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
||||
import { WolframAlphaTool } from '@langchain/community/tools/wolframalpha';
|
||||
import {
|
||||
NodeConnectionType,
|
||||
type INodeType,
|
||||
@@ -6,9 +7,9 @@ import {
|
||||
type ISupplyDataFunctions,
|
||||
type SupplyData,
|
||||
} from 'n8n-workflow';
|
||||
import { WolframAlphaTool } from '@langchain/community/tools/wolframalpha';
|
||||
import { logWrapper } from '../../../utils/logWrapper';
|
||||
import { getConnectionHintNoticeField } from '../../../utils/sharedFields';
|
||||
|
||||
import { logWrapper } from '@utils/logWrapper';
|
||||
import { getConnectionHintNoticeField } from '@utils/sharedFields';
|
||||
|
||||
export class ToolWolframAlpha implements INodeType {
|
||||
description: INodeTypeDescription = {
|
||||
|
||||
@@ -21,14 +21,11 @@ import type {
|
||||
} from 'n8n-workflow';
|
||||
import { NodeConnectionType, NodeOperationError, jsonParse } from 'n8n-workflow';
|
||||
|
||||
import { jsonSchemaExampleField, schemaTypeField, inputSchemaField } from '@utils/descriptions';
|
||||
import { convertJsonSchemaToZod, generateSchema } from '@utils/schemaParsing';
|
||||
import { getConnectionHintNoticeField } from '@utils/sharedFields';
|
||||
|
||||
import type { DynamicZodObject } from '../../../types/zod.types';
|
||||
import {
|
||||
jsonSchemaExampleField,
|
||||
schemaTypeField,
|
||||
inputSchemaField,
|
||||
} from '../../../utils/descriptions';
|
||||
import { convertJsonSchemaToZod, generateSchema } from '../../../utils/schemaParsing';
|
||||
import { getConnectionHintNoticeField } from '../../../utils/sharedFields';
|
||||
|
||||
export class ToolWorkflow implements INodeType {
|
||||
description: INodeTypeDescription = {
|
||||
|
||||
Reference in New Issue
Block a user