refactor(core): Shovel around more of AI code (no-changelog) (#12218)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2024-12-16 13:46:19 +01:00
committed by GitHub
parent a8e7a05856
commit 2ce1644d01
138 changed files with 590 additions and 529 deletions

View File

@@ -1,7 +1,7 @@
import type { OpenAIEmbeddings } from '@langchain/openai';
import { mock } from 'jest-mock-extended';
import { MemoryVectorStoreManager } from './MemoryVectorStoreManager';
import { mock } from 'jest-mock-extended';
describe('MemoryVectorStoreManager', () => {
it('should create an instance of MemoryVectorStoreManager', () => {

View File

@@ -19,12 +19,13 @@ import type {
INodePropertyOptions,
} from 'n8n-workflow';
import { getMetadataFiltersValues, logAiEvent } from '@utils/helpers';
import { logWrapper } from '@utils/logWrapper';
import type { N8nBinaryLoader } from '@utils/N8nBinaryLoader';
import { N8nJsonLoader } from '@utils/N8nJsonLoader';
import { getConnectionHintNoticeField } from '@utils/sharedFields';
import { processDocument } from './processDocuments';
import { getMetadataFiltersValues, logAiEvent } from '../../../utils/helpers';
import { logWrapper } from '../../../utils/logWrapper';
import type { N8nBinaryLoader } from '../../../utils/N8nBinaryLoader';
import { N8nJsonLoader } from '../../../utils/N8nJsonLoader';
import { getConnectionHintNoticeField } from '../../../utils/sharedFields';
type NodeOperationMode = 'insert' | 'load' | 'retrieve' | 'update';

View File

@@ -1,6 +1,6 @@
import { ApplicationError, type IDataObject, type ILoadOptionsFunctions } from 'n8n-workflow';
import { Pinecone } from '@pinecone-database/pinecone';
import { QdrantClient } from '@qdrant/js-client-rest';
import { ApplicationError, type IDataObject, type ILoadOptionsFunctions } from 'n8n-workflow';
export async function pineconeIndexSearch(this: ILoadOptionsFunctions) {
const credentials = await this.getCredentials('pineconeApi');

View File

@@ -1,7 +1,8 @@
import type { Document } from '@langchain/core/documents';
import type { INodeExecutionData } from 'n8n-workflow';
import { N8nJsonLoader } from '../../../utils/N8nJsonLoader';
import { N8nBinaryLoader } from '../../../utils/N8nBinaryLoader';
import { N8nBinaryLoader } from '@utils/N8nBinaryLoader';
import { N8nJsonLoader } from '@utils/N8nJsonLoader';
export async function processDocuments(
documentInput: N8nJsonLoader | N8nBinaryLoader | Array<Document<Record<string, unknown>>>,