diff --git a/package.json b/package.json index b1e87a3..bf64229 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@samchon/openapi", - "version": "2.0.0-dev.20241201", + "version": "2.0.0-dev.20241201-2", "description": "OpenAPI definitions and converters for 'typia' and 'nestia'.", "main": "./lib/index.js", "module": "./lib/index.mjs", diff --git a/src/composers/HttpLlmApplicationComposer.ts b/src/composers/HttpLlmApplicationComposer.ts index 7f475f0..6d7316a 100644 --- a/src/composers/HttpLlmApplicationComposer.ts +++ b/src/composers/HttpLlmApplicationComposer.ts @@ -4,6 +4,7 @@ import { IHttpLlmApplication } from "../structures/IHttpLlmApplication"; import { IHttpLlmFunction } from "../structures/IHttpLlmFunction"; import { IHttpMigrateApplication } from "../structures/IHttpMigrateApplication"; import { IHttpMigrateRoute } from "../structures/IHttpMigrateRoute"; +import { ILlmFunction } from "../structures/ILlmFunction"; import { ILlmSchema } from "../structures/ILlmSchema"; import { LlmSchemaComposer } from "./LlmSchemaComposer"; @@ -77,29 +78,6 @@ export namespace HttpLlmComposer { }; }; - export const separate = (props: { - model: Model; - parameters: ILlmSchema.ModelParameters[Model]; - predicate: (schema: ILlmSchema.ModelSchema[Model]) => boolean; - }): IHttpLlmFunction.ISeparated => { - const separator: (props: { - predicate: (schema: ILlmSchema.ModelSchema[Model]) => boolean; - schema: ILlmSchema.ModelSchema[Model]; - }) => [ - ILlmSchema.ModelParameters[Model] | null, - ILlmSchema.ModelParameters[Model] | null, - ] = LlmSchemaComposer.separate(props.model) as any; - - const [llm, human] = separator({ - predicate: props.predicate, - schema: props.parameters, - }); - return { - llm, - human, - } satisfies IHttpLlmFunction.ISeparated; - }; - const composeFunction = (props: { model: Model; components: OpenApi.IComponents; @@ -207,11 +185,11 @@ export namespace HttpLlmComposer { strict: true, parameters, separated: props.options.separate - ? separate({ - model: props.model, - predicate: props.options.separate, - parameters, - }) + ? (LlmSchemaComposer.separateParameters(props.model)({ + predicate: props.options.separate as any, + parameters: + parameters satisfies ILlmSchema.ModelParameters[Model] as any, + }) as ILlmFunction.ISeparated) : undefined, output: output as any, description: (() => { diff --git a/src/composers/LlmSchemaComposer.ts b/src/composers/LlmSchemaComposer.ts index 5d211ee..25188a0 100644 --- a/src/composers/LlmSchemaComposer.ts +++ b/src/composers/LlmSchemaComposer.ts @@ -25,14 +25,15 @@ export namespace LlmSchemaComposer { export const schema = (model: Model) => SCHEMA_CASTERS[model]; - export const separate = (model: Model) => - SEPARATORS[model]; - export const defaultConfig = (model: Model) => DEFAULT_CONFIGS[model]; export const typeChecker = (model: Model) => TYPE_CHECKERS[model]; + + export const separateParameters = ( + model: Model, + ) => SEPARATE_PARAMETERS[model]; } const PARAMETERS_CASTERS = { @@ -53,13 +54,13 @@ const SCHEMA_CASTERS = { "3.1": LlmSchemaV3_1Composer.schema, }; -const SEPARATORS = { - chatgpt: ChatGptSchemaComposer.separate, - claude: ClaudeSchemaComposer.separate, - gemini: GeminiSchemaComposer.separate, - llama: LlamaSchemaComposer.separate, - "3.0": LlmSchemaV3Composer.separate, - "3.1": LlmSchemaV3_1Composer.separate, +const SEPARATE_PARAMETERS = { + chatgpt: ChatGptSchemaComposer.separateParameters, + claude: ClaudeSchemaComposer.separateParameters, + gemini: GeminiSchemaComposer.separateParameters, + llama: LlamaSchemaComposer.separateParameters, + "3.0": LlmSchemaV3Composer.separateParameters, + "3.1": LlmSchemaV3_1Composer.separateParameters, }; const DEFAULT_CONFIGS = { diff --git a/src/composers/llm/ChatGptSchemaComposer.ts b/src/composers/llm/ChatGptSchemaComposer.ts index 7db60e2..97bbbb9 100644 --- a/src/composers/llm/ChatGptSchemaComposer.ts +++ b/src/composers/llm/ChatGptSchemaComposer.ts @@ -1,5 +1,6 @@ import { OpenApi } from "../../OpenApi"; import { IChatGptSchema } from "../../structures/IChatGptSchema"; +import { ILlmFunction } from "../../structures/ILlmFunction"; import { ILlmSchemaV3_1 } from "../../structures/ILlmSchemaV3_1"; import { ChatGptTypeChecker } from "../../utils/ChatGptTypeChecker"; import { LlmTypeCheckerV3_1 } from "../../utils/LlmTypeCheckerV3_1"; @@ -150,44 +151,41 @@ export namespace ChatGptSchemaComposer { }; }; - export const separate = (props: { + export const separateParameters = (props: { predicate: (schema: IChatGptSchema) => boolean; - schema: IChatGptSchema.IParameters; - }): [ - IChatGptSchema.IParameters | null, - IChatGptSchema.IParameters | null, - ] => { + parameters: IChatGptSchema.IParameters; + }): ILlmFunction.ISeparated<"chatgpt"> => { const [llm, human] = separateObject({ - $defs: props.schema.$defs, + $defs: props.parameters.$defs, predicate: props.predicate, - schema: props.schema, + schema: props.parameters, }); if (llm === null || human === null) - return [ - llm as IChatGptSchema.IParameters | null, - human as IChatGptSchema.IParameters | null, - ]; - const output: [IChatGptSchema.IParameters, IChatGptSchema.IParameters] = [ - { + return { + llm: llm as IChatGptSchema.IParameters | null, + human: human as IChatGptSchema.IParameters | null, + }; + const output: ILlmFunction.ISeparated<"chatgpt"> = { + llm: { ...llm, $defs: Object.fromEntries( - Object.entries(props.schema.$defs).filter(([key]) => + Object.entries(props.parameters.$defs).filter(([key]) => key.endsWith(".Llm"), ), ), }, - { + human: { ...human, $defs: Object.fromEntries( - Object.entries(props.schema.$defs).filter(([key]) => + Object.entries(props.parameters.$defs).filter(([key]) => key.endsWith(".Human"), ), ), }, - ]; - for (const key of Object.keys(props.schema.$defs)) + }; + for (const key of Object.keys(props.parameters.$defs)) if (key.endsWith(".Llm") === false && key.endsWith(".Human") === false) - delete props.schema.$defs[key]; + delete props.parameters.$defs[key]; return output; }; diff --git a/src/composers/llm/ClaudeSchemaComposer.ts b/src/composers/llm/ClaudeSchemaComposer.ts index bd5d61a..85742d3 100644 --- a/src/composers/llm/ClaudeSchemaComposer.ts +++ b/src/composers/llm/ClaudeSchemaComposer.ts @@ -1,5 +1,6 @@ import { OpenApi } from "../../OpenApi"; import { IClaudeSchema } from "../../structures/IClaudeSchema"; +import { ILlmFunction } from "../../structures/ILlmFunction"; import { LlmSchemaV3_1Composer } from "./LlmSchemaV3_1Composer"; export namespace ClaudeSchemaComposer { @@ -35,9 +36,11 @@ export namespace ClaudeSchemaComposer { }, }); - export const separate = (props: { + export const separateParameters = (props: { predicate: (schema: IClaudeSchema) => boolean; - schema: IClaudeSchema.IParameters; - }): [IClaudeSchema | null, IClaudeSchema | null] => - LlmSchemaV3_1Composer.separate(props); + parameters: IClaudeSchema.IParameters; + }): ILlmFunction.ISeparated<"claude"> => + LlmSchemaV3_1Composer.separateParameters( + props, + ) as any as ILlmFunction.ISeparated<"claude">; } diff --git a/src/composers/llm/GeminiSchemaComposer.ts b/src/composers/llm/GeminiSchemaComposer.ts index 804eaf4..ff6a53e 100644 --- a/src/composers/llm/GeminiSchemaComposer.ts +++ b/src/composers/llm/GeminiSchemaComposer.ts @@ -2,6 +2,7 @@ import { OpenApi } from "../../OpenApi"; import { OpenApiV3 } from "../../OpenApiV3"; import { OpenApiV3_1 } from "../../OpenApiV3_1"; import { IGeminiSchema } from "../../structures/IGeminiSchema"; +import { ILlmFunction } from "../../structures/ILlmFunction"; import { ILlmSchemaV3 } from "../../structures/ILlmSchemaV3"; import { LlmTypeCheckerV3 } from "../../utils/LlmTypeCheckerV3"; import { OpenApiTypeChecker } from "../../utils/OpenApiTypeChecker"; @@ -91,16 +92,16 @@ export namespace GeminiSchemaComposer { return schema as IGeminiSchema; }; - export const separate = (props: { + export const separateParameters = (props: { predicate: (schema: IGeminiSchema) => boolean; - schema: IGeminiSchema.IParameters; - }): [IGeminiSchema.IParameters | null, IGeminiSchema.IParameters | null] => - LlmSchemaV3Composer.separate( + parameters: IGeminiSchema.IParameters; + }): ILlmFunction.ISeparated<"gemini"> => + LlmSchemaV3Composer.separateParameters( props as { predicate: (schema: ILlmSchemaV3) => boolean; - schema: ILlmSchemaV3.IParameters; + parameters: ILlmSchemaV3.IParameters; }, - ); + ) as any as ILlmFunction.ISeparated<"gemini">; } const isOneOf = diff --git a/src/composers/llm/LlamaSchemaComposer.ts b/src/composers/llm/LlamaSchemaComposer.ts index eeca4bf..9aff368 100644 --- a/src/composers/llm/LlamaSchemaComposer.ts +++ b/src/composers/llm/LlamaSchemaComposer.ts @@ -1,5 +1,6 @@ import { OpenApi } from "../../OpenApi"; import { ILlamaSchema } from "../../structures/ILlamaSchema"; +import { ILlmFunction } from "../../structures/ILlmFunction"; import { LlmSchemaV3_1Composer } from "./LlmSchemaV3_1Composer"; export namespace LlamaSchemaComposer { @@ -35,9 +36,11 @@ export namespace LlamaSchemaComposer { }, }); - export const separate = (props: { + export const separateParameters = (props: { predicate: (schema: ILlamaSchema) => boolean; - schema: ILlamaSchema.IParameters; - }): [ILlamaSchema | null, ILlamaSchema | null] => - LlmSchemaV3_1Composer.separate(props); + parameters: ILlamaSchema.IParameters; + }): ILlmFunction.ISeparated<"llama"> => + LlmSchemaV3_1Composer.separateParameters( + props, + ) as any as ILlmFunction.ISeparated<"llama">; } diff --git a/src/composers/llm/LlmSchemaV3Composer.ts b/src/composers/llm/LlmSchemaV3Composer.ts index 388a3d4..a28530d 100644 --- a/src/composers/llm/LlmSchemaV3Composer.ts +++ b/src/composers/llm/LlmSchemaV3Composer.ts @@ -1,5 +1,6 @@ import { OpenApi } from "../../OpenApi"; import { OpenApiV3Downgrader } from "../../converters/OpenApiV3Downgrader"; +import { ILlmFunction } from "../../structures/ILlmFunction"; import { ILlmSchemaV3 } from "../../structures/ILlmSchemaV3"; import { LlmTypeCheckerV3 } from "../../utils/LlmTypeCheckerV3"; import { OpenApiContraintShifter } from "../../utils/OpenApiContraintShifter"; @@ -122,14 +123,16 @@ export namespace LlmSchemaV3Composer { return downgraded; }; - export const separate = (props: { + export const separateParameters = (props: { predicate: (schema: ILlmSchemaV3) => boolean; - schema: ILlmSchemaV3.IParameters; - }): [ILlmSchemaV3.IParameters | null, ILlmSchemaV3.IParameters | null] => - separateObject({ + parameters: ILlmSchemaV3.IParameters; + }): ILlmFunction.ISeparated<"3.0"> => { + const [llm, human] = separateObject({ predicate: props.predicate, - schema: props.schema, + schema: props.parameters, }); + return { llm, human }; + }; const separateStation = (props: { predicate: (schema: ILlmSchemaV3) => boolean; diff --git a/src/composers/llm/LlmSchemaV3_1Composer.ts b/src/composers/llm/LlmSchemaV3_1Composer.ts index 6122b5a..852dd31 100644 --- a/src/composers/llm/LlmSchemaV3_1Composer.ts +++ b/src/composers/llm/LlmSchemaV3_1Composer.ts @@ -1,4 +1,5 @@ import { OpenApi } from "../../OpenApi"; +import { ILlmFunction } from "../../structures/ILlmFunction"; import { ILlmSchemaV3_1 } from "../../structures/ILlmSchemaV3_1"; import { LlmTypeCheckerV3_1 } from "../../utils/LlmTypeCheckerV3_1"; import { OpenApiContraintShifter } from "../../utils/OpenApiContraintShifter"; @@ -274,44 +275,41 @@ export namespace LlmSchemaV3_1Composer { }; }; - export const separate = (props: { + export const separateParameters = (props: { predicate: (schema: ILlmSchemaV3_1) => boolean; - schema: ILlmSchemaV3_1.IParameters; - }): [ - ILlmSchemaV3_1.IParameters | null, - ILlmSchemaV3_1.IParameters | null, - ] => { + parameters: ILlmSchemaV3_1.IParameters; + }): ILlmFunction.ISeparated<"3.1"> => { const [llm, human] = separateObject({ - $defs: props.schema.$defs, + $defs: props.parameters.$defs, predicate: props.predicate, - schema: props.schema, + schema: props.parameters, }); if (llm === null || human === null) - return [ - llm as ILlmSchemaV3_1.IParameters | null, - human as ILlmSchemaV3_1.IParameters | null, - ]; - const output: [ILlmSchemaV3_1.IParameters, ILlmSchemaV3_1.IParameters] = [ - { + return { + llm: llm as ILlmSchemaV3_1.IParameters | null, + human: human as ILlmSchemaV3_1.IParameters | null, + }; + const output: ILlmFunction.ISeparated<"3.1"> = { + llm: { ...llm, $defs: Object.fromEntries( - Object.entries(props.schema.$defs).filter(([key]) => + Object.entries(props.parameters.$defs).filter(([key]) => key.endsWith(".Llm"), ), ), }, - { + human: { ...human, $defs: Object.fromEntries( - Object.entries(props.schema.$defs).filter(([key]) => + Object.entries(props.parameters.$defs).filter(([key]) => key.endsWith(".Human"), ), ), }, - ]; - for (const key of Object.keys(props.schema.$defs)) + }; + for (const key of Object.keys(props.parameters.$defs)) if (key.endsWith(".Llm") === false && key.endsWith(".Human") === false) - delete props.schema.$defs[key]; + delete props.parameters.$defs[key]; return output; }; diff --git a/test/features/llm/validate_llm_parameters_separate_array.ts b/test/features/llm/validate_llm_parameters_separate_array.ts index 79b11e8..76d3c45 100644 --- a/test/features/llm/validate_llm_parameters_separate_array.ts +++ b/test/features/llm/validate_llm_parameters_separate_array.ts @@ -30,7 +30,7 @@ const validate_llm_parameters_separate_array = ( constraint: boolean, ): void => { const separator = (schema: ILlmSchema.IParameters) => - LlmSchemaComposer.separate(model)({ + LlmSchemaComposer.separateParameters(model)({ predicate: (s) => LlmSchemaComposer.typeChecker(model).isString( s as OpenApi.IJsonSchema.IString, @@ -38,7 +38,7 @@ const validate_llm_parameters_separate_array = ( (constraint ? (s as OpenApi.IJsonSchema.IString).contentMediaType !== undefined : s.description?.includes("@contentMediaType") === true), - schema: schema as any, + parameters: schema as any, }); const member: ILlmSchema.IParameters = schema( model, @@ -53,9 +53,18 @@ const validate_llm_parameters_separate_array = ( constraint, )(typia.json.schemas<[IManagement]>()); - TestValidator.equals("member")(separator(member))([member, null]); - TestValidator.equals("upload")(separator(upload))([null, upload]); - TestValidator.equals("combined")(separator(combined))([member, upload]); + TestValidator.equals("member")(separator(member))({ + llm: member, + human: null, + }); + TestValidator.equals("upload")(separator(upload))({ + llm: null, + human: upload, + }); + TestValidator.equals("combined")(separator(combined))({ + llm: member, + human: upload, + }); }; interface IManagement { diff --git a/test/features/llm/validate_llm_parameters_separate_nested.ts b/test/features/llm/validate_llm_parameters_separate_nested.ts index 07eab81..65dcb73 100644 --- a/test/features/llm/validate_llm_parameters_separate_nested.ts +++ b/test/features/llm/validate_llm_parameters_separate_nested.ts @@ -32,7 +32,7 @@ const validate_llm_parameters_separate_nested = < constraint: boolean, ): void => { const separator = (schema: ILlmSchema.IParameters) => - LlmSchemaComposer.separate(model)({ + LlmSchemaComposer.separateParameters(model)({ predicate: (s) => LlmSchemaComposer.typeChecker(model).isString( s as OpenApi.IJsonSchema.IString, @@ -40,7 +40,7 @@ const validate_llm_parameters_separate_nested = < (constraint ? (s as OpenApi.IJsonSchema.IString).contentMediaType !== undefined : s.description?.includes("@contentMediaType") === true), - schema: schema as any, + parameters: schema as any, }); const member: ILlmSchema.IParameters = schema( model, @@ -55,9 +55,18 @@ const validate_llm_parameters_separate_nested = < constraint, )(typia.json.schemas<[INested]>()); - TestValidator.equals("member")(separator(member))([member, null]); - TestValidator.equals("upload")(separator(upload))([null, upload]); - TestValidator.equals("combined")(separator(combined))([member, upload]); + TestValidator.equals("member")(separator(member))({ + llm: member, + human: null, + }); + TestValidator.equals("upload")(separator(upload))({ + llm: null, + human: upload, + }); + TestValidator.equals("combined")(separator(combined))({ + llm: member, + human: upload, + }); }; interface INested { diff --git a/test/features/llm/validate_llm_parameters_separate_object.ts b/test/features/llm/validate_llm_parameters_separate_object.ts index 3b54a83..48e38df 100644 --- a/test/features/llm/validate_llm_parameters_separate_object.ts +++ b/test/features/llm/validate_llm_parameters_separate_object.ts @@ -32,7 +32,7 @@ const validate_llm_parameters_separate_object = < constraint: boolean, ): void => { const separator = (schema: ILlmSchema.IParameters) => - LlmSchemaComposer.separate(model)({ + LlmSchemaComposer.separateParameters(model)({ predicate: (s) => LlmSchemaComposer.typeChecker(model).isString( s as OpenApi.IJsonSchema.IString, @@ -40,7 +40,7 @@ const validate_llm_parameters_separate_object = < (constraint ? (s as OpenApi.IJsonSchema.IString).contentMediaType !== undefined : s.description?.includes("@contentMediaType") === true), - schema: schema as any, + parameters: schema as any, }); const member: ILlmSchema.IParameters = schema( model, @@ -55,9 +55,18 @@ const validate_llm_parameters_separate_object = < constraint, )(typia.json.schemas<[ICombined]>()); - TestValidator.equals("member")(separator(member))([member, null]); - TestValidator.equals("upload")(separator(upload))([null, upload]); - TestValidator.equals("combined")(separator(combined))([member, upload]); + TestValidator.equals("member")(separator(member))({ + llm: member, + human: null, + }); + TestValidator.equals("upload")(separator(upload))({ + llm: null, + human: upload, + }); + TestValidator.equals("combined")(separator(combined))({ + llm: member, + human: upload, + }); }; interface IMember { diff --git a/test/features/llm/validate_llm_parameters_separate_object_additionalProperties.ts b/test/features/llm/validate_llm_parameters_separate_object_additionalProperties.ts index c793b94..68e94d5 100644 --- a/test/features/llm/validate_llm_parameters_separate_object_additionalProperties.ts +++ b/test/features/llm/validate_llm_parameters_separate_object_additionalProperties.ts @@ -44,7 +44,7 @@ const validate_llm_parameters_separate_object_additionalProperties = < constraint: boolean, ): void => { const separator = (schema: ILlmSchema.IParameters) => - LlmSchemaComposer.separate(model)({ + LlmSchemaComposer.separateParameters(model)({ predicate: (s) => LlmSchemaComposer.typeChecker(model).isString( s as OpenApi.IJsonSchema.IString, @@ -52,7 +52,7 @@ const validate_llm_parameters_separate_object_additionalProperties = < (constraint ? (s as OpenApi.IJsonSchema.IString).contentMediaType !== undefined : s.description?.includes("@contentMediaType") === true), - schema: schema as any, + parameters: schema as any, }); const member: ILlmSchema.IParameters = schema( model, @@ -67,9 +67,18 @@ const validate_llm_parameters_separate_object_additionalProperties = < constraint, )(typia.json.schemas<[IWrapper]>()); - TestValidator.equals("member")(separator(member))([member, null]); - TestValidator.equals("upload")(separator(upload))([null, upload]); - TestValidator.equals("combined")(separator(combined))([member, upload]); + TestValidator.equals("member")(separator(member))({ + llm: member, + human: null, + }); + TestValidator.equals("upload")(separator(upload))({ + llm: null, + human: upload, + }); + TestValidator.equals("combined")(separator(combined))({ + llm: member, + human: upload, + }); }; interface IWrapper { diff --git a/test/features/llm/validate_llm_parameters_separate_ref.ts b/test/features/llm/validate_llm_parameters_separate_ref.ts index b46767f..6702d8b 100644 --- a/test/features/llm/validate_llm_parameters_separate_ref.ts +++ b/test/features/llm/validate_llm_parameters_separate_ref.ts @@ -24,7 +24,7 @@ const validate_llm_parameters_separate_ref = < constraint: boolean, ): void => { const separator = (schema: ILlmSchema.IParameters) => - LlmSchemaComposer.separate(model)({ + LlmSchemaComposer.separateParameters(model)({ predicate: (s) => LlmSchemaComposer.typeChecker(model).isString( s as OpenApi.IJsonSchema.IString, @@ -32,7 +32,7 @@ const validate_llm_parameters_separate_ref = < (constraint ? (s as OpenApi.IJsonSchema.IString).contentMediaType !== undefined : s.description?.includes("@contentMediaType") === true), - schema: schema as any, + parameters: schema as any, }); const member: ILlmSchema.IParameters = schema( model, @@ -47,19 +47,23 @@ const validate_llm_parameters_separate_ref = < constraint, )(typia.json.schemas<[IWrapper]>()); - TestValidator.equals("member")(separator(member))([member, null]); - TestValidator.equals("upload")(separator(upload))([null, upload]); - TestValidator.equals("combined")( - separator(combined).map((p) => - p !== null - ? { - ...p, - $defs: {}, - } - : null, - ), - )([ - { + TestValidator.equals("member")(separator(member))({ + llm: member, + human: null, + }); + TestValidator.equals("upload")(separator(upload))({ + llm: null, + human: upload, + }); + TestValidator.equals("combined")({ + llm: separator(combined).llm + ? { ...separator(combined).llm, $defs: {} } + : null, + human: separator(combined).human + ? { ...separator(combined).human, $defs: {} } + : null, + })({ + llm: { $defs: {}, type: "object", properties: { @@ -70,7 +74,7 @@ const validate_llm_parameters_separate_ref = < required: ["value"], additionalProperties: false, } satisfies IChatGptSchema.IParameters, - { + human: { $defs: {}, type: "object", properties: { @@ -81,7 +85,7 @@ const validate_llm_parameters_separate_ref = < required: ["value"], additionalProperties: false, } satisfies IChatGptSchema.IParameters, - ]); + }); }; interface IWrapper { diff --git a/test/features/llm/validate_llm_schema_separate_string.ts b/test/features/llm/validate_llm_schema_separate_string.ts index 5da9207..d8a37c1 100644 --- a/test/features/llm/validate_llm_schema_separate_string.ts +++ b/test/features/llm/validate_llm_schema_separate_string.ts @@ -30,7 +30,7 @@ const validate_llm_schema_separate_string = ( constraint: boolean, ): void => { const separator = (schema: ILlmSchema.IParameters) => - LlmSchemaComposer.separate(model)({ + LlmSchemaComposer.separateParameters(model)({ predicate: (s) => LlmSchemaComposer.typeChecker(model).isString( s as OpenApi.IJsonSchema.IString, @@ -38,7 +38,7 @@ const validate_llm_schema_separate_string = ( (constraint ? (s as OpenApi.IJsonSchema.IString).contentMediaType !== undefined : s.description?.includes("@contentMediaType") === true), - schema: schema as any, + parameters: schema as any, }); const plain: ILlmSchema.IParameters = schema( model, @@ -64,8 +64,14 @@ const validate_llm_schema_separate_string = ( ] >(), ); - TestValidator.equals("plain")(separator(plain))([plain, null]); - TestValidator.equals("upload")(separator(upload))([null, upload]); + TestValidator.equals("plain")(separator(plain))({ + llm: plain, + human: null, + }); + TestValidator.equals("upload")(separator(upload))({ + llm: null, + human: upload, + }); }; const schema =