@typia/interface 12.0.0-dev.20260311 → 12.0.0-dev.20260312-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/http/IHttpLlmApplication.d.ts +1 -1
- package/lib/http/IHttpLlmFunction.d.ts +1 -1
- package/lib/http/IHttpMigrateApplication.d.ts +1 -1
- package/lib/http/IHttpMigrateRoute.d.ts +2 -2
- package/lib/openapi/OpenApi.d.ts +35 -10
- package/lib/openapi/OpenApiV3.d.ts +7 -0
- package/lib/openapi/OpenApiV3_1.d.ts +7 -0
- package/lib/openapi/OpenApiV3_2.d.ts +489 -0
- package/lib/openapi/OpenApiV3_2.js +3 -0
- package/lib/openapi/OpenApiV3_2.js.map +1 -0
- package/lib/openapi/SwaggerV2.d.ts +7 -0
- package/lib/openapi/index.d.ts +1 -0
- package/lib/openapi/index.js +1 -0
- package/lib/openapi/index.js.map +1 -1
- package/lib/schema/ILlmStructuredOutput.d.ts +108 -0
- package/lib/schema/ILlmStructuredOutput.js +3 -0
- package/lib/schema/ILlmStructuredOutput.js.map +1 -0
- package/lib/schema/index.d.ts +1 -0
- package/lib/schema/index.js +1 -0
- package/lib/schema/index.js.map +1 -1
- package/package.json +1 -1
- package/src/http/IHttpLlmApplication.ts +72 -72
- package/src/http/IHttpLlmFunction.ts +34 -34
- package/src/http/IHttpMigrateApplication.ts +48 -48
- package/src/http/IHttpMigrateRoute.ts +165 -165
- package/src/openapi/OpenApi.ts +680 -643
- package/src/openapi/OpenApiV3.ts +663 -655
- package/src/openapi/OpenApiV3_1.ts +743 -735
- package/src/openapi/OpenApiV3_2.ts +773 -0
- package/src/openapi/SwaggerV2.ts +567 -559
- package/src/openapi/index.ts +5 -4
- package/src/schema/ILlmApplication.ts +98 -98
- package/src/schema/ILlmSchema.ts +473 -473
- package/src/schema/ILlmStructuredOutput.ts +112 -0
- package/src/schema/index.ts +15 -14
package/src/openapi/index.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export * from "./OpenApi";
|
|
2
|
-
export * from "./OpenApiV3";
|
|
3
|
-
export * from "./OpenApiV3_1";
|
|
4
|
-
export * from "./
|
|
1
|
+
export * from "./OpenApi";
|
|
2
|
+
export * from "./OpenApiV3";
|
|
3
|
+
export * from "./OpenApiV3_1";
|
|
4
|
+
export * from "./OpenApiV3_2";
|
|
5
|
+
export * from "./SwaggerV2";
|
|
@@ -1,98 +1,98 @@
|
|
|
1
|
-
import { ILlmFunction } from "./ILlmFunction";
|
|
2
|
-
import { ILlmSchema } from "./ILlmSchema";
|
|
3
|
-
import { IValidation } from "./IValidation";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* LLM function calling application.
|
|
7
|
-
*
|
|
8
|
-
* `ILlmApplication` is a collection of {@link ILlmFunction} schemas generated
|
|
9
|
-
* from a TypeScript class or interface by `typia.llm.application<App>()`. Each
|
|
10
|
-
* public method becomes an {@link ILlmFunction} that LLM agents can invoke.
|
|
11
|
-
*
|
|
12
|
-
* Configure behavior via {@link ILlmApplication.IConfig}:
|
|
13
|
-
*
|
|
14
|
-
* - {@link ILlmApplication.IConfig.validate}: Custom validation per method
|
|
15
|
-
* - {@link ILlmSchema.IConfig.strict}: OpenAI structured output mode
|
|
16
|
-
*
|
|
17
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
18
|
-
* @template Class Source class/interface type
|
|
19
|
-
*/
|
|
20
|
-
export interface ILlmApplication<Class extends object = any> {
|
|
21
|
-
/**
|
|
22
|
-
* Array of callable function schemas.
|
|
23
|
-
*
|
|
24
|
-
* Each function represents a method from the source class that the LLM can
|
|
25
|
-
* invoke. Functions include parameter schemas, descriptions, and validation
|
|
26
|
-
* logic for type-safe function calling.
|
|
27
|
-
*/
|
|
28
|
-
functions: ILlmFunction[];
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Configuration used to generate this application.
|
|
32
|
-
*
|
|
33
|
-
* Contains the settings that were applied during schema generation, including
|
|
34
|
-
* strict mode and any custom validation hooks.
|
|
35
|
-
*/
|
|
36
|
-
config: ILlmApplication.IConfig<Class>;
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Phantom property for TypeScript generic type preservation.
|
|
40
|
-
*
|
|
41
|
-
* This property exists only in the type system to preserve the `Class`
|
|
42
|
-
* generic parameter at compile time. It is always `undefined` at runtime and
|
|
43
|
-
* should not be accessed or used in application code.
|
|
44
|
-
*
|
|
45
|
-
* This pattern enables type inference to recover the original class type from
|
|
46
|
-
* an `ILlmApplication` instance, useful for type-safe function routing.
|
|
47
|
-
*/
|
|
48
|
-
__class?: Class | undefined;
|
|
49
|
-
}
|
|
50
|
-
export namespace ILlmApplication {
|
|
51
|
-
/**
|
|
52
|
-
* Configuration for LLM application generation.
|
|
53
|
-
*
|
|
54
|
-
* Extends {@link ILlmSchema.IConfig} with application-specific options for
|
|
55
|
-
* custom validation. These settings control how the application schema is
|
|
56
|
-
* generated from the source class.
|
|
57
|
-
*/
|
|
58
|
-
export interface IConfig<Class extends object = any>
|
|
59
|
-
extends ILlmSchema.IConfig {
|
|
60
|
-
/**
|
|
61
|
-
* Custom validation functions per method name.
|
|
62
|
-
*
|
|
63
|
-
* Allows overriding the default type-based validation with custom business
|
|
64
|
-
* logic. Useful for complex validation rules that cannot be expressed in
|
|
65
|
-
* JSON Schema.
|
|
66
|
-
*
|
|
67
|
-
* @default null (use default type validation)
|
|
68
|
-
*/
|
|
69
|
-
validate: null | Partial<ILlmApplication.IValidationHook<Class>>;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* Type-safe mapping of method names to custom validators.
|
|
74
|
-
*
|
|
75
|
-
* Maps each method name to a validation function that receives the raw input
|
|
76
|
-
* and returns a validation result. The type inference ensures validators
|
|
77
|
-
* match the expected argument types.
|
|
78
|
-
*
|
|
79
|
-
* @template Class - The source class type for type inference
|
|
80
|
-
*/
|
|
81
|
-
export type IValidationHook<Class extends object> = {
|
|
82
|
-
[K in keyof Class]?: Class[K] extends (args: infer Argument) => unknown
|
|
83
|
-
? (input: unknown) => IValidation<Argument>
|
|
84
|
-
: never;
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* Internal type for typia transformer.
|
|
89
|
-
*
|
|
90
|
-
* @ignore
|
|
91
|
-
*/
|
|
92
|
-
export interface __IPrimitive<Class extends object = any> extends Omit<
|
|
93
|
-
ILlmApplication<Class>,
|
|
94
|
-
"config" | "functions"
|
|
95
|
-
> {
|
|
96
|
-
functions: Omit<ILlmFunction, "parse" | "coerce">[];
|
|
97
|
-
}
|
|
98
|
-
}
|
|
1
|
+
import { ILlmFunction } from "./ILlmFunction";
|
|
2
|
+
import { ILlmSchema } from "./ILlmSchema";
|
|
3
|
+
import { IValidation } from "./IValidation";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* LLM function calling application.
|
|
7
|
+
*
|
|
8
|
+
* `ILlmApplication` is a collection of {@link ILlmFunction} schemas generated
|
|
9
|
+
* from a TypeScript class or interface by `typia.llm.application<App>()`. Each
|
|
10
|
+
* public method becomes an {@link ILlmFunction} that LLM agents can invoke.
|
|
11
|
+
*
|
|
12
|
+
* Configure behavior via {@link ILlmApplication.IConfig}:
|
|
13
|
+
*
|
|
14
|
+
* - {@link ILlmApplication.IConfig.validate}: Custom validation per method
|
|
15
|
+
* - {@link ILlmSchema.IConfig.strict}: OpenAI structured output mode
|
|
16
|
+
*
|
|
17
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
18
|
+
* @template Class Source class/interface type
|
|
19
|
+
*/
|
|
20
|
+
export interface ILlmApplication<Class extends object = any> {
|
|
21
|
+
/**
|
|
22
|
+
* Array of callable function schemas.
|
|
23
|
+
*
|
|
24
|
+
* Each function represents a method from the source class that the LLM can
|
|
25
|
+
* invoke. Functions include parameter schemas, descriptions, and validation
|
|
26
|
+
* logic for type-safe function calling.
|
|
27
|
+
*/
|
|
28
|
+
functions: ILlmFunction[];
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Configuration used to generate this application.
|
|
32
|
+
*
|
|
33
|
+
* Contains the settings that were applied during schema generation, including
|
|
34
|
+
* strict mode and any custom validation hooks.
|
|
35
|
+
*/
|
|
36
|
+
config: ILlmApplication.IConfig<Class>;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Phantom property for TypeScript generic type preservation.
|
|
40
|
+
*
|
|
41
|
+
* This property exists only in the type system to preserve the `Class`
|
|
42
|
+
* generic parameter at compile time. It is always `undefined` at runtime and
|
|
43
|
+
* should not be accessed or used in application code.
|
|
44
|
+
*
|
|
45
|
+
* This pattern enables type inference to recover the original class type from
|
|
46
|
+
* an `ILlmApplication` instance, useful for type-safe function routing.
|
|
47
|
+
*/
|
|
48
|
+
__class?: Class | undefined;
|
|
49
|
+
}
|
|
50
|
+
export namespace ILlmApplication {
|
|
51
|
+
/**
|
|
52
|
+
* Configuration for LLM application generation.
|
|
53
|
+
*
|
|
54
|
+
* Extends {@link ILlmSchema.IConfig} with application-specific options for
|
|
55
|
+
* custom validation. These settings control how the application schema is
|
|
56
|
+
* generated from the source class.
|
|
57
|
+
*/
|
|
58
|
+
export interface IConfig<Class extends object = any>
|
|
59
|
+
extends ILlmSchema.IConfig {
|
|
60
|
+
/**
|
|
61
|
+
* Custom validation functions per method name.
|
|
62
|
+
*
|
|
63
|
+
* Allows overriding the default type-based validation with custom business
|
|
64
|
+
* logic. Useful for complex validation rules that cannot be expressed in
|
|
65
|
+
* JSON Schema.
|
|
66
|
+
*
|
|
67
|
+
* @default null (use default type validation)
|
|
68
|
+
*/
|
|
69
|
+
validate: null | Partial<ILlmApplication.IValidationHook<Class>>;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Type-safe mapping of method names to custom validators.
|
|
74
|
+
*
|
|
75
|
+
* Maps each method name to a validation function that receives the raw input
|
|
76
|
+
* and returns a validation result. The type inference ensures validators
|
|
77
|
+
* match the expected argument types.
|
|
78
|
+
*
|
|
79
|
+
* @template Class - The source class type for type inference
|
|
80
|
+
*/
|
|
81
|
+
export type IValidationHook<Class extends object> = {
|
|
82
|
+
[K in keyof Class]?: Class[K] extends (args: infer Argument) => unknown
|
|
83
|
+
? (input: unknown) => IValidation<Argument>
|
|
84
|
+
: never;
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Internal type for typia transformer.
|
|
89
|
+
*
|
|
90
|
+
* @ignore
|
|
91
|
+
*/
|
|
92
|
+
export interface __IPrimitive<Class extends object = any> extends Omit<
|
|
93
|
+
ILlmApplication<Class>,
|
|
94
|
+
"config" | "functions"
|
|
95
|
+
> {
|
|
96
|
+
functions: Omit<ILlmFunction, "parse" | "coerce">[];
|
|
97
|
+
}
|
|
98
|
+
}
|