mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 17:46:45 +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,9 @@
|
||||
/* 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';
|
||||
import { LLMChainExtractor } from 'langchain/retrievers/document_compressors/chain_extract';
|
||||
import {
|
||||
NodeConnectionType,
|
||||
type INodeType,
|
||||
@@ -7,12 +12,7 @@ import {
|
||||
type SupplyData,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
import { ContextualCompressionRetriever } from 'langchain/retrievers/contextual_compression';
|
||||
import { LLMChainExtractor } from 'langchain/retrievers/document_compressors/chain_extract';
|
||||
import type { BaseLanguageModel } from '@langchain/core/language_models/base';
|
||||
import type { BaseRetriever } from '@langchain/core/retrievers';
|
||||
|
||||
import { logWrapper } from '../../../utils/logWrapper';
|
||||
import { logWrapper } from '@utils/logWrapper';
|
||||
|
||||
export class RetrieverContextualCompression implements INodeType {
|
||||
description: INodeTypeDescription = {
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
/* 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';
|
||||
import {
|
||||
NodeConnectionType,
|
||||
type INodeType,
|
||||
@@ -7,11 +11,7 @@ import {
|
||||
type SupplyData,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
import { MultiQueryRetriever } from 'langchain/retrievers/multi_query';
|
||||
import type { BaseLanguageModel } from '@langchain/core/language_models/base';
|
||||
import type { BaseRetriever } from '@langchain/core/retrievers';
|
||||
|
||||
import { logWrapper } from '../../../utils/logWrapper';
|
||||
import { logWrapper } from '@utils/logWrapper';
|
||||
|
||||
export class RetrieverMultiQuery implements INodeType {
|
||||
description: INodeTypeDescription = {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
||||
import type { VectorStore } from '@langchain/core/vectorstores';
|
||||
import {
|
||||
NodeConnectionType,
|
||||
type INodeType,
|
||||
@@ -6,8 +7,8 @@ import {
|
||||
type ISupplyDataFunctions,
|
||||
type SupplyData,
|
||||
} from 'n8n-workflow';
|
||||
import type { VectorStore } from '@langchain/core/vectorstores';
|
||||
import { logWrapper } from '../../../utils/logWrapper';
|
||||
|
||||
import { logWrapper } from '@utils/logWrapper';
|
||||
|
||||
export class RetrieverVectorStore implements INodeType {
|
||||
description: INodeTypeDescription = {
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
/* 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';
|
||||
import type { SetField, SetNodeOptions } from 'n8n-nodes-base/dist/nodes/Set/v2/helpers/interfaces';
|
||||
import * as manual from 'n8n-nodes-base/dist/nodes/Set/v2/manual.mode';
|
||||
import { NodeConnectionType, NodeOperationError } from 'n8n-workflow';
|
||||
import type {
|
||||
IDataObject,
|
||||
@@ -13,13 +18,7 @@ import type {
|
||||
ExecuteWorkflowData,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
import { BaseRetriever, type BaseRetrieverInput } from '@langchain/core/retrievers';
|
||||
import { Document } from '@langchain/core/documents';
|
||||
|
||||
import type { SetField, SetNodeOptions } from 'n8n-nodes-base/dist/nodes/Set/v2/helpers/interfaces';
|
||||
import * as manual from 'n8n-nodes-base/dist/nodes/Set/v2/manual.mode';
|
||||
import type { CallbackManagerForRetrieverRun } from '@langchain/core/callbacks/manager';
|
||||
import { logWrapper } from '../../../utils/logWrapper';
|
||||
import { logWrapper } from '@utils/logWrapper';
|
||||
|
||||
function objectToString(obj: Record<string, string> | IDataObject, level = 0) {
|
||||
let result = '';
|
||||
|
||||
Reference in New Issue
Block a user