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

@@ -13,15 +13,12 @@ import type {
} from 'n8n-workflow';
import type { z } from 'zod';
import { inputSchemaField, jsonSchemaExampleField, schemaTypeField } from '@utils/descriptions';
import { convertJsonSchemaToZod, generateSchema } from '@utils/schemaParsing';
import { getTracingConfig } from '@utils/tracing';
import { makeZodSchemaFromAttributes } from './helpers';
import type { AttributeDefinition } from './types';
import {
inputSchemaField,
jsonSchemaExampleField,
schemaTypeField,
} from '../../../utils/descriptions';
import { convertJsonSchemaToZod, generateSchema } from '../../../utils/schemaParsing';
import { getTracingConfig } from '../../../utils/tracing';
const SYSTEM_PROMPT_TEMPLATE = `You are an expert extraction algorithm.
Only extract relevant information from the text.

View File

@@ -1,4 +1,5 @@
import { z } from 'zod';
import type { AttributeDefinition } from './types';
function makeAttributeSchema(attributeDefinition: AttributeDefinition, required: boolean = true) {

View File

@@ -1,10 +1,10 @@
import type { IDataObject, IExecuteFunctions } from 'n8n-workflow/src';
import get from 'lodash/get';
import { FakeLLM, FakeListChatModel } from '@langchain/core/utils/testing';
import type { BaseLanguageModel } from '@langchain/core/language_models/base';
import { InformationExtractor } from '../InformationExtractor.node';
import { FakeLLM, FakeListChatModel } from '@langchain/core/utils/testing';
import get from 'lodash/get';
import type { IDataObject, IExecuteFunctions } from 'n8n-workflow/src';
import { makeZodSchemaFromAttributes } from '../helpers';
import { InformationExtractor } from '../InformationExtractor.node';
import type { AttributeDefinition } from '../types';
const mockPersonAttributes: AttributeDefinition[] = [