typia 9.6.1 → 9.7.0
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/CamelCase.d.mts +1 -1
- package/lib/CamelCase.d.ts +1 -1
- package/lib/IRandomGenerator.d.mts +240 -0
- package/lib/IRandomGenerator.d.ts +240 -0
- package/lib/PascalCase.d.mts +1 -1
- package/lib/PascalCase.d.ts +1 -1
- package/lib/Primitive.d.mts +8 -8
- package/lib/Primitive.d.ts +8 -8
- package/lib/Resolved.d.mts +9 -9
- package/lib/Resolved.d.ts +9 -9
- package/lib/SnakeCase.d.mts +1 -1
- package/lib/SnakeCase.d.ts +1 -1
- package/lib/factories/TypeFactory.d.mts +1 -0
- package/lib/factories/TypeFactory.d.ts +1 -0
- package/lib/factories/TypeFactory.js +1 -1
- package/lib/factories/TypeFactory.js.map +1 -1
- package/lib/factories/TypeFactory.mjs +1 -1
- package/lib/factories/internal/metadata/iterate_metadata_map.js +2 -3
- package/lib/factories/internal/metadata/iterate_metadata_map.js.map +1 -1
- package/lib/factories/internal/metadata/iterate_metadata_map.mjs +2 -3
- package/lib/factories/internal/metadata/iterate_metadata_set.js +2 -3
- package/lib/factories/internal/metadata/iterate_metadata_set.js.map +1 -1
- package/lib/factories/internal/metadata/iterate_metadata_set.mjs +2 -3
- package/lib/functional.js +1 -1
- package/lib/functional.js.map +1 -1
- package/lib/functional.mjs +1 -1
- package/lib/http.d.mts +23 -23
- package/lib/http.d.ts +23 -23
- package/lib/internal/_llmApplicationFinalize.d.mts +1 -1
- package/lib/internal/_llmApplicationFinalize.d.ts +1 -1
- package/lib/internal/_llmApplicationFinalize.js +14 -11
- package/lib/internal/_llmApplicationFinalize.js.map +1 -1
- package/lib/internal/_llmApplicationFinalize.mjs +13 -9
- package/lib/json.d.mts +16 -16
- package/lib/json.d.ts +16 -16
- package/lib/llm.d.mts +18 -18
- package/lib/llm.d.ts +18 -18
- package/lib/llm.js.map +1 -1
- package/lib/misc.d.mts +23 -23
- package/lib/misc.d.ts +23 -23
- package/lib/module.d.mts +75 -75
- package/lib/module.d.ts +75 -75
- package/lib/module.js.map +1 -1
- package/lib/transformers/features/llm/LlmApplicationTransformer.js +8 -9
- package/lib/transformers/features/llm/LlmApplicationTransformer.js.map +1 -1
- package/lib/transformers/features/llm/LlmApplicationTransformer.mjs +8 -9
- package/package.json +2 -2
- package/src/CamelCase.ts +1 -1
- package/src/IRandomGenerator.ts +284 -6
- package/src/PascalCase.ts +1 -1
- package/src/Primitive.ts +8 -8
- package/src/Resolved.ts +9 -9
- package/src/SnakeCase.ts +1 -1
- package/src/factories/TypeFactory.ts +5 -3
- package/src/factories/internal/metadata/iterate_metadata_map.ts +3 -3
- package/src/factories/internal/metadata/iterate_metadata_set.ts +2 -3
- package/src/functional.ts +1 -1
- package/src/http.ts +23 -23
- package/src/internal/_llmApplicationFinalize.ts +25 -11
- package/src/json.ts +16 -16
- package/src/llm.ts +26 -18
- package/src/misc.ts +23 -23
- package/src/module.ts +76 -75
- package/src/transformers/features/llm/LlmApplicationTransformer.ts +18 -22
|
@@ -3,17 +3,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports._llmApplicationFinalize = void 0;
|
|
4
4
|
const LlmSchemaComposer_1 = require("@samchon/openapi/lib/composers/LlmSchemaComposer");
|
|
5
5
|
const _llmApplicationFinalize = (app, options) => {
|
|
6
|
-
var _a, _b;
|
|
7
|
-
app.options = Object.assign(Object.assign({}, LlmSchemaComposer_1.LlmSchemaComposer.defaultConfig(app.model)), { separate: (_a = options === null || options === void 0 ? void 0 : options.separate) !== null && _a !== void 0 ? _a : null });
|
|
8
|
-
if (app.options.separate
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
.
|
|
15
|
-
|
|
16
|
-
|
|
6
|
+
var _a, _b, _c, _d;
|
|
7
|
+
app.options = Object.assign(Object.assign({}, LlmSchemaComposer_1.LlmSchemaComposer.defaultConfig(app.model)), { separate: (_a = options === null || options === void 0 ? void 0 : options.separate) !== null && _a !== void 0 ? _a : null, validate: (_b = options === null || options === void 0 ? void 0 : options.validate) !== null && _b !== void 0 ? _b : null });
|
|
8
|
+
if (app.options.separate !== null)
|
|
9
|
+
for (const func of app.functions)
|
|
10
|
+
func.separated = LlmSchemaComposer_1.LlmSchemaComposer.separateParameters(app.model)({
|
|
11
|
+
parameters: func.parameters,
|
|
12
|
+
predicate: app.options
|
|
13
|
+
.separate,
|
|
14
|
+
equals: (_c = options === null || options === void 0 ? void 0 : options.equals) !== null && _c !== void 0 ? _c : false,
|
|
15
|
+
});
|
|
16
|
+
if (app.options.validate !== null)
|
|
17
|
+
for (const func of app.functions)
|
|
18
|
+
if (typeof ((_d = app.options.validate) === null || _d === void 0 ? void 0 : _d[func.name]) === "function")
|
|
19
|
+
func.validate = app.options.validate[func.name];
|
|
17
20
|
};
|
|
18
21
|
exports._llmApplicationFinalize = _llmApplicationFinalize;
|
|
19
22
|
//# sourceMappingURL=_llmApplicationFinalize.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_llmApplicationFinalize.js","sourceRoot":"","sources":["../../src/internal/_llmApplicationFinalize.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"_llmApplicationFinalize.js","sourceRoot":"","sources":["../../src/internal/_llmApplicationFinalize.ts"],"names":[],"mappings":";;;AAMA,wFAAqF;AAE9E,MAAM,uBAAuB,GAAG,CACrC,GAA2B,EAC3B,OAIC,EACK,EAAE;;IACR,GAAG,CAAC,OAAO,mCACN,qCAAiB,CAAC,aAAa,CAAC,GAAG,CAAC,KAAK,CAAC,KAC7C,QAAQ,EAAE,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,QAAQ,mCAAI,IAAI,EACnC,QAAQ,EAAE,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,QAAQ,mCAAI,IAAI,GACpC,CAAC;IACF,IAAI,GAAG,CAAC,OAAO,CAAC,QAAQ,KAAK,IAAI;QAC/B,KAAK,MAAM,IAAI,IAAI,GAAG,CAAC,SAAS;YAC9B,IAAI,CAAC,SAAS,GAAG,qCAAiB,CAAC,kBAAkB,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;gBAC/D,UAAU,EACR,IAAI,CAAC,UAAyD;gBAChE,SAAS,EAAE,GAAG,CAAC,OAAO;qBACnB,QAA8D;gBACjE,MAAM,EAAE,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,mCAAI,KAAK;aACjC,CAAmC,CAAC;IACzC,IAAI,GAAG,CAAC,OAAO,CAAC,QAAQ,KAAK,IAAI;QAC/B,KAAK,MAAM,IAAI,IAAI,GAAG,CAAC,SAAS;YAC9B,IAAI,OAAO,CAAA,MAAA,GAAG,CAAC,OAAO,CAAC,QAAQ,0CAAG,IAAI,CAAC,IAAI,CAAC,CAAA,KAAK,UAAU;gBACzD,IAAI,CAAC,QAAQ,GAAG,GAAG,CAAC,OAAO,CAAC,QAAQ,CAClC,IAAI,CAAC,IAAI,CACwB,CAAC;AAC5C,CAAC,CAAC;AA5BW,QAAA,uBAAuB,2BA4BlC"}
|
|
@@ -4,16 +4,20 @@ const _llmApplicationFinalize = (app, options) => {
|
|
|
4
4
|
app.options = {
|
|
5
5
|
...LlmSchemaComposer.defaultConfig(app.model),
|
|
6
6
|
separate: options?.separate ?? null,
|
|
7
|
+
validate: options?.validate ?? null,
|
|
7
8
|
};
|
|
8
|
-
if (app.options.separate
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
if (app.options.separate !== null)
|
|
10
|
+
for (const func of app.functions)
|
|
11
|
+
func.separated = LlmSchemaComposer.separateParameters(app.model)({
|
|
12
|
+
parameters: func.parameters,
|
|
13
|
+
predicate: app.options
|
|
14
|
+
.separate,
|
|
15
|
+
equals: options?.equals ?? false,
|
|
16
|
+
});
|
|
17
|
+
if (app.options.validate !== null)
|
|
18
|
+
for (const func of app.functions)
|
|
19
|
+
if (typeof app.options.validate?.[func.name] === "function")
|
|
20
|
+
func.validate = app.options.validate[func.name];
|
|
17
21
|
};
|
|
18
22
|
|
|
19
23
|
export { _llmApplicationFinalize };
|
package/lib/json.d.mts
CHANGED
|
@@ -13,8 +13,8 @@ import { TypeGuardError } from "./TypeGuardError";
|
|
|
13
13
|
* {@link IJsonSchemaCollection.components} property for the `$ref` referencing.
|
|
14
14
|
*
|
|
15
15
|
* Also, you can specify the OpenAPI version by configuring the second generic
|
|
16
|
-
* argument `Version`. For reference, the default version is `"3.1"`, and key
|
|
17
|
-
*
|
|
16
|
+
* argument `Version`. For reference, the default version is `"3.1"`, and the key
|
|
17
|
+
* difference between `"3.0"` and `"3.1"` is whether supporting the tuple type or not.
|
|
18
18
|
*
|
|
19
19
|
* @template Types Tuple of target types
|
|
20
20
|
* @template Version Version of OpenAPI specification. Default is 3.1
|
|
@@ -31,8 +31,8 @@ export declare function schemas(): never;
|
|
|
31
31
|
* {@link IJsonSchemaCollection.components} property for the `$ref` referencing.
|
|
32
32
|
*
|
|
33
33
|
* Also, you can specify the OpenAPI version by configuring the second generic
|
|
34
|
-
* argument `Version`. For reference, the default version is `"3.1"`, and key
|
|
35
|
-
*
|
|
34
|
+
* argument `Version`. For reference, the default version is `"3.1"`, and the key
|
|
35
|
+
* difference between `"3.0"` and `"3.1"` is whether supporting the tuple type or not.
|
|
36
36
|
*
|
|
37
37
|
* @template Types Tuple of target types
|
|
38
38
|
* @template Version Version of OpenAPI specification. Default is 3.1
|
|
@@ -92,7 +92,7 @@ export declare function schema<Type extends unknown, Version extends "3.0" | "3.
|
|
|
92
92
|
*
|
|
93
93
|
* In such reason, when parsed JSON string value is not matched with the type `T`, it
|
|
94
94
|
* throws {@link TypeGuardError} or custom error generated by *errorFactory*. Otherwise,
|
|
95
|
-
* there's no problem
|
|
95
|
+
* if there's no problem with the parsed value, the parsed value will be returned.
|
|
96
96
|
*
|
|
97
97
|
* @template T Expected type of parsed value
|
|
98
98
|
* @param input JSON string
|
|
@@ -133,7 +133,7 @@ export declare function assertParse<T>(input: string, errorFactory?: undefined |
|
|
|
133
133
|
*
|
|
134
134
|
* In such reason, when parsed JSON string value is not matched with the type `T`, it
|
|
135
135
|
* returns `null` value. Otherwise, there's no problem on the parsed value, the parsed
|
|
136
|
-
* value
|
|
136
|
+
* value will be returned.
|
|
137
137
|
*
|
|
138
138
|
* @template T Expected type of parsed value
|
|
139
139
|
* @param input JSON string
|
|
@@ -151,7 +151,7 @@ export declare function isParse(input: string): never;
|
|
|
151
151
|
*
|
|
152
152
|
* In such reason, when parsed JSON string value is not matched with the type `T`, it
|
|
153
153
|
* returns `null` value. Otherwise, there's no problem on the parsed value, the parsed
|
|
154
|
-
* value
|
|
154
|
+
* value will be returned.
|
|
155
155
|
*
|
|
156
156
|
* @template T Expected type of parsed value
|
|
157
157
|
* @param input JSON string
|
|
@@ -171,7 +171,7 @@ export declare function isParse<T>(input: string): Primitive<T> | null;
|
|
|
171
171
|
*
|
|
172
172
|
* In such reason, when parsed JSON string value is not matched with the type `T`, it
|
|
173
173
|
* returns {@link IValidation.IFailure} value with detailed error reasons. Otherwise,
|
|
174
|
-
* there's no problem on the parsed value, the parsed value
|
|
174
|
+
* there's no problem on the parsed value, the parsed value will be stored in `data`
|
|
175
175
|
* property of the output {@link IValidation.ISuccess} instance.
|
|
176
176
|
*
|
|
177
177
|
* @template T Expected type of parsed value
|
|
@@ -190,7 +190,7 @@ export declare function validateParse(input: string): never;
|
|
|
190
190
|
*
|
|
191
191
|
* In such reason, when parsed JSON string value is not matched with the type `T`, it
|
|
192
192
|
* returns {@link IValidation.IFailure} value with detailed error reasons. Otherwise,
|
|
193
|
-
* there's no problem on the parsed value, the parsed value
|
|
193
|
+
* there's no problem on the parsed value, the parsed value will be stored in `data`
|
|
194
194
|
* property of the output {@link IValidation.ISuccess} instance.
|
|
195
195
|
*
|
|
196
196
|
* @template T Expected type of parsed value
|
|
@@ -209,7 +209,7 @@ export declare function validateParse<T>(input: string): IValidation<Primitive<T
|
|
|
209
209
|
*
|
|
210
210
|
* For reference, this `typia.json.stringify()` does not validate the input value type.
|
|
211
211
|
* It just believes that the input value is following the type `T`. Therefore, if you
|
|
212
|
-
* can't ensure the input value type, it
|
|
212
|
+
* can't ensure the input value type, it will be better to call one of below
|
|
213
213
|
* functions instead.
|
|
214
214
|
*
|
|
215
215
|
* - {@link assertStringify}
|
|
@@ -232,7 +232,7 @@ export declare function stringify<T>(input: T): string;
|
|
|
232
232
|
*
|
|
233
233
|
* In such reason, when `input` value is not matched with the type `T`, it throws an
|
|
234
234
|
* {@link TypeGuardError} or custom error generated by *errorFactory*. Otherwise,
|
|
235
|
-
* there's no problem on the `input` value, JSON string
|
|
235
|
+
* there's no problem on the `input` value, JSON string will be returned.
|
|
236
236
|
*
|
|
237
237
|
* For reference, with type assertion, it is even 5x times faster than the native
|
|
238
238
|
* `JSON.stringify()` function. So, just enjoy the safe and fast JSON conversion
|
|
@@ -255,7 +255,7 @@ export declare function assertStringify<T>(input: T, errorFactory?: undefined |
|
|
|
255
255
|
*
|
|
256
256
|
* In such reason, when `input` value is not matched with the type `T`, it throws an
|
|
257
257
|
* {@link TypeGuardError} or custom error generated by *errorFactory*. Otherwise,
|
|
258
|
-
* there's no problem on the `input` value, JSON string
|
|
258
|
+
* there's no problem on the `input` value, JSON string will be returned.
|
|
259
259
|
*
|
|
260
260
|
* For reference, with type assertion, it is even 5x times faster than the native
|
|
261
261
|
* `JSON.stringify()` function. So, just enjoy the safe and fast JSON conversion
|
|
@@ -278,7 +278,7 @@ export declare function assertStringify<T>(input: T, errorFactory?: undefined |
|
|
|
278
278
|
*
|
|
279
279
|
* In such reason, when `input` value is not matched with the type `T`, it returns
|
|
280
280
|
* `null` value. Otherwise, there's no problem on the `input` value, JSON string
|
|
281
|
-
*
|
|
281
|
+
* will be returned.
|
|
282
282
|
*
|
|
283
283
|
* For reference, with type checking, it is even 7x times faster than the native
|
|
284
284
|
* `JSON.stringify()` function. So, just enjoy the safe and fast JSON conversion
|
|
@@ -300,7 +300,7 @@ export declare function isStringify<T>(input: T): string | null;
|
|
|
300
300
|
*
|
|
301
301
|
* In such reason, when `input` value is not matched with the type `T`, it returns
|
|
302
302
|
* `null` value. Otherwise, there's no problem on the `input` value, JSON string
|
|
303
|
-
*
|
|
303
|
+
* will be returned.
|
|
304
304
|
*
|
|
305
305
|
* For reference, with type checking, it is even 7x times faster than the native
|
|
306
306
|
* `JSON.stringify()` function. So, just enjoy the safe and fast JSON conversion
|
|
@@ -322,7 +322,7 @@ export declare function isStringify<T>(input: unknown): string | null;
|
|
|
322
322
|
*
|
|
323
323
|
* In such reason, when `input` value is not matched with the type `T`, it returns
|
|
324
324
|
* {@link IValidation.IFailure} value with detailed error reasons. Otherwise,
|
|
325
|
-
* there's no problem on the `input` value, JSON string
|
|
325
|
+
* there's no problem on the `input` value, JSON string will be stored in `data`
|
|
326
326
|
* property of the output {@link IValidation.ISuccess} instance.
|
|
327
327
|
*
|
|
328
328
|
* For reference, with detailed type validation, it is even 5x times faster than the
|
|
@@ -345,7 +345,7 @@ export declare function validateStringify<T>(input: T): IValidation<string>;
|
|
|
345
345
|
*
|
|
346
346
|
* In such reason, when `input` value is not matched with the type `T`, it returns
|
|
347
347
|
* {@link IValidation.IFailure} value with detailed error reasons. Otherwise,
|
|
348
|
-
* there's no problem on the `input` value, JSON string
|
|
348
|
+
* there's no problem on the `input` value, JSON string will be stored in `data`
|
|
349
349
|
* property of the output {@link IValidation.ISuccess} instance.
|
|
350
350
|
*
|
|
351
351
|
* For reference, with detailed type validation, it is even 5x times faster than the
|
package/lib/json.d.ts
CHANGED
|
@@ -13,8 +13,8 @@ import { TypeGuardError } from "./TypeGuardError";
|
|
|
13
13
|
* {@link IJsonSchemaCollection.components} property for the `$ref` referencing.
|
|
14
14
|
*
|
|
15
15
|
* Also, you can specify the OpenAPI version by configuring the second generic
|
|
16
|
-
* argument `Version`. For reference, the default version is `"3.1"`, and key
|
|
17
|
-
*
|
|
16
|
+
* argument `Version`. For reference, the default version is `"3.1"`, and the key
|
|
17
|
+
* difference between `"3.0"` and `"3.1"` is whether supporting the tuple type or not.
|
|
18
18
|
*
|
|
19
19
|
* @template Types Tuple of target types
|
|
20
20
|
* @template Version Version of OpenAPI specification. Default is 3.1
|
|
@@ -31,8 +31,8 @@ export declare function schemas(): never;
|
|
|
31
31
|
* {@link IJsonSchemaCollection.components} property for the `$ref` referencing.
|
|
32
32
|
*
|
|
33
33
|
* Also, you can specify the OpenAPI version by configuring the second generic
|
|
34
|
-
* argument `Version`. For reference, the default version is `"3.1"`, and key
|
|
35
|
-
*
|
|
34
|
+
* argument `Version`. For reference, the default version is `"3.1"`, and the key
|
|
35
|
+
* difference between `"3.0"` and `"3.1"` is whether supporting the tuple type or not.
|
|
36
36
|
*
|
|
37
37
|
* @template Types Tuple of target types
|
|
38
38
|
* @template Version Version of OpenAPI specification. Default is 3.1
|
|
@@ -92,7 +92,7 @@ export declare function schema<Type extends unknown, Version extends "3.0" | "3.
|
|
|
92
92
|
*
|
|
93
93
|
* In such reason, when parsed JSON string value is not matched with the type `T`, it
|
|
94
94
|
* throws {@link TypeGuardError} or custom error generated by *errorFactory*. Otherwise,
|
|
95
|
-
* there's no problem
|
|
95
|
+
* if there's no problem with the parsed value, the parsed value will be returned.
|
|
96
96
|
*
|
|
97
97
|
* @template T Expected type of parsed value
|
|
98
98
|
* @param input JSON string
|
|
@@ -133,7 +133,7 @@ export declare function assertParse<T>(input: string, errorFactory?: undefined |
|
|
|
133
133
|
*
|
|
134
134
|
* In such reason, when parsed JSON string value is not matched with the type `T`, it
|
|
135
135
|
* returns `null` value. Otherwise, there's no problem on the parsed value, the parsed
|
|
136
|
-
* value
|
|
136
|
+
* value will be returned.
|
|
137
137
|
*
|
|
138
138
|
* @template T Expected type of parsed value
|
|
139
139
|
* @param input JSON string
|
|
@@ -151,7 +151,7 @@ export declare function isParse(input: string): never;
|
|
|
151
151
|
*
|
|
152
152
|
* In such reason, when parsed JSON string value is not matched with the type `T`, it
|
|
153
153
|
* returns `null` value. Otherwise, there's no problem on the parsed value, the parsed
|
|
154
|
-
* value
|
|
154
|
+
* value will be returned.
|
|
155
155
|
*
|
|
156
156
|
* @template T Expected type of parsed value
|
|
157
157
|
* @param input JSON string
|
|
@@ -171,7 +171,7 @@ export declare function isParse<T>(input: string): Primitive<T> | null;
|
|
|
171
171
|
*
|
|
172
172
|
* In such reason, when parsed JSON string value is not matched with the type `T`, it
|
|
173
173
|
* returns {@link IValidation.IFailure} value with detailed error reasons. Otherwise,
|
|
174
|
-
* there's no problem on the parsed value, the parsed value
|
|
174
|
+
* there's no problem on the parsed value, the parsed value will be stored in `data`
|
|
175
175
|
* property of the output {@link IValidation.ISuccess} instance.
|
|
176
176
|
*
|
|
177
177
|
* @template T Expected type of parsed value
|
|
@@ -190,7 +190,7 @@ export declare function validateParse(input: string): never;
|
|
|
190
190
|
*
|
|
191
191
|
* In such reason, when parsed JSON string value is not matched with the type `T`, it
|
|
192
192
|
* returns {@link IValidation.IFailure} value with detailed error reasons. Otherwise,
|
|
193
|
-
* there's no problem on the parsed value, the parsed value
|
|
193
|
+
* there's no problem on the parsed value, the parsed value will be stored in `data`
|
|
194
194
|
* property of the output {@link IValidation.ISuccess} instance.
|
|
195
195
|
*
|
|
196
196
|
* @template T Expected type of parsed value
|
|
@@ -209,7 +209,7 @@ export declare function validateParse<T>(input: string): IValidation<Primitive<T
|
|
|
209
209
|
*
|
|
210
210
|
* For reference, this `typia.json.stringify()` does not validate the input value type.
|
|
211
211
|
* It just believes that the input value is following the type `T`. Therefore, if you
|
|
212
|
-
* can't ensure the input value type, it
|
|
212
|
+
* can't ensure the input value type, it will be better to call one of below
|
|
213
213
|
* functions instead.
|
|
214
214
|
*
|
|
215
215
|
* - {@link assertStringify}
|
|
@@ -232,7 +232,7 @@ export declare function stringify<T>(input: T): string;
|
|
|
232
232
|
*
|
|
233
233
|
* In such reason, when `input` value is not matched with the type `T`, it throws an
|
|
234
234
|
* {@link TypeGuardError} or custom error generated by *errorFactory*. Otherwise,
|
|
235
|
-
* there's no problem on the `input` value, JSON string
|
|
235
|
+
* there's no problem on the `input` value, JSON string will be returned.
|
|
236
236
|
*
|
|
237
237
|
* For reference, with type assertion, it is even 5x times faster than the native
|
|
238
238
|
* `JSON.stringify()` function. So, just enjoy the safe and fast JSON conversion
|
|
@@ -255,7 +255,7 @@ export declare function assertStringify<T>(input: T, errorFactory?: undefined |
|
|
|
255
255
|
*
|
|
256
256
|
* In such reason, when `input` value is not matched with the type `T`, it throws an
|
|
257
257
|
* {@link TypeGuardError} or custom error generated by *errorFactory*. Otherwise,
|
|
258
|
-
* there's no problem on the `input` value, JSON string
|
|
258
|
+
* there's no problem on the `input` value, JSON string will be returned.
|
|
259
259
|
*
|
|
260
260
|
* For reference, with type assertion, it is even 5x times faster than the native
|
|
261
261
|
* `JSON.stringify()` function. So, just enjoy the safe and fast JSON conversion
|
|
@@ -278,7 +278,7 @@ export declare function assertStringify<T>(input: T, errorFactory?: undefined |
|
|
|
278
278
|
*
|
|
279
279
|
* In such reason, when `input` value is not matched with the type `T`, it returns
|
|
280
280
|
* `null` value. Otherwise, there's no problem on the `input` value, JSON string
|
|
281
|
-
*
|
|
281
|
+
* will be returned.
|
|
282
282
|
*
|
|
283
283
|
* For reference, with type checking, it is even 7x times faster than the native
|
|
284
284
|
* `JSON.stringify()` function. So, just enjoy the safe and fast JSON conversion
|
|
@@ -300,7 +300,7 @@ export declare function isStringify<T>(input: T): string | null;
|
|
|
300
300
|
*
|
|
301
301
|
* In such reason, when `input` value is not matched with the type `T`, it returns
|
|
302
302
|
* `null` value. Otherwise, there's no problem on the `input` value, JSON string
|
|
303
|
-
*
|
|
303
|
+
* will be returned.
|
|
304
304
|
*
|
|
305
305
|
* For reference, with type checking, it is even 7x times faster than the native
|
|
306
306
|
* `JSON.stringify()` function. So, just enjoy the safe and fast JSON conversion
|
|
@@ -322,7 +322,7 @@ export declare function isStringify<T>(input: unknown): string | null;
|
|
|
322
322
|
*
|
|
323
323
|
* In such reason, when `input` value is not matched with the type `T`, it returns
|
|
324
324
|
* {@link IValidation.IFailure} value with detailed error reasons. Otherwise,
|
|
325
|
-
* there's no problem on the `input` value, JSON string
|
|
325
|
+
* there's no problem on the `input` value, JSON string will be stored in `data`
|
|
326
326
|
* property of the output {@link IValidation.ISuccess} instance.
|
|
327
327
|
*
|
|
328
328
|
* For reference, with detailed type validation, it is even 5x times faster than the
|
|
@@ -345,7 +345,7 @@ export declare function validateStringify<T>(input: T): IValidation<string>;
|
|
|
345
345
|
*
|
|
346
346
|
* In such reason, when `input` value is not matched with the type `T`, it returns
|
|
347
347
|
* {@link IValidation.IFailure} value with detailed error reasons. Otherwise,
|
|
348
|
-
* there's no problem on the `input` value, JSON string
|
|
348
|
+
* there's no problem on the `input` value, JSON string will be stored in `data`
|
|
349
349
|
* property of the output {@link IValidation.ISuccess} instance.
|
|
350
350
|
*
|
|
351
351
|
* For reference, with detailed type validation, it is even 5x times faster than the
|
package/lib/llm.d.mts
CHANGED
|
@@ -57,7 +57,7 @@ import { ILlmApplication, ILlmController, ILlmSchema } from "@samchon/openapi";
|
|
|
57
57
|
* - `deepseek`: [`IDeepSeekSchema`](https://samchon.github.io/openapi/api/types/IClaudeSchema-1.html)
|
|
58
58
|
* - `gemini`: [`IGeminiSchema`](https://samchon.github.io/openapi/api/types/IGeminiSchema-1.html)
|
|
59
59
|
* - `llama`: [`ILlamaSchema`](https://samchon.github.io/openapi/api/types/ILlamaSchema-1.html)
|
|
60
|
-
* -
|
|
60
|
+
* - Middle layer schemas
|
|
61
61
|
* - `3.0`: [`ILlmSchemaV3`](https://samchon.github.io/openapi/api/types/ILlmSchemaV3-1.html)
|
|
62
62
|
* - `3.1`: [`ILlmSchemaV3_1`](https://samchon.github.io/openapi/api/types/ILlmSchemaV3_1-1.html)
|
|
63
63
|
*
|
|
@@ -71,7 +71,7 @@ import { ILlmApplication, ILlmController, ILlmSchema } from "@samchon/openapi";
|
|
|
71
71
|
* @reference https://wrtnlabs.io/agentica/docs/core/controller/typescript/
|
|
72
72
|
* @author Jeongho Nam - https://github.com/samchon
|
|
73
73
|
*/
|
|
74
|
-
export declare function controller(name: string, execute: object, options?: Partial<Pick<ILlmApplication.IOptions<any>, "separate">>): never;
|
|
74
|
+
export declare function controller(name: string, execute: object, options?: Partial<Pick<ILlmApplication.IOptions<any, any>, "separate" | "validate">>): never;
|
|
75
75
|
/**
|
|
76
76
|
* TypeScript functions to LLM function calling controller.
|
|
77
77
|
*
|
|
@@ -128,7 +128,7 @@ export declare function controller(name: string, execute: object, options?: Part
|
|
|
128
128
|
* - `deepseek`: [`IDeepSeekSchema`](https://samchon.github.io/openapi/api/types/IClaudeSchema-1.html)
|
|
129
129
|
* - `gemini`: [`IGeminiSchema`](https://samchon.github.io/openapi/api/types/IGeminiSchema-1.html)
|
|
130
130
|
* - `llama`: [`ILlamaSchema`](https://samchon.github.io/openapi/api/types/ILlamaSchema-1.html)
|
|
131
|
-
* -
|
|
131
|
+
* - Middle layer schemas
|
|
132
132
|
* - `3.0`: [`ILlmSchemaV3`](https://samchon.github.io/openapi/api/types/ILlmSchemaV3-1.html)
|
|
133
133
|
* - `3.1`: [`ILlmSchemaV3_1`](https://samchon.github.io/openapi/api/types/ILlmSchemaV3_1-1.html)
|
|
134
134
|
*
|
|
@@ -153,7 +153,7 @@ export declare function controller<Class extends Record<string, any>, Model exte
|
|
|
153
153
|
* @default false
|
|
154
154
|
*/
|
|
155
155
|
equals: boolean;
|
|
156
|
-
}> = {}>(name: string, execute: Class, options?: Partial<Pick<ILlmApplication.IOptions<Model>, "separate">>): ILlmController<Model>;
|
|
156
|
+
}> = {}>(name: string, execute: Class, options?: Partial<Pick<ILlmApplication.IOptions<Model, Class>, "separate" | "validate">>): ILlmController<Model>;
|
|
157
157
|
/**
|
|
158
158
|
* > You must configure the generic argument `Class`.
|
|
159
159
|
*
|
|
@@ -183,7 +183,7 @@ export declare function controller<Class extends Record<string, any>, Model exte
|
|
|
183
183
|
*
|
|
184
184
|
* Additionally, if you've configured {@link ILlmApplication.IOptions.separate},
|
|
185
185
|
* so that the parameters are separated to human and LLM sides, you can merge these
|
|
186
|
-
*
|
|
186
|
+
* human and LLM sides' parameters into one through {@link HttpLlm.mergeParameters}
|
|
187
187
|
* before the actual LLM function call execution.
|
|
188
188
|
*
|
|
189
189
|
* Here is the list of available `Model` types with their corresponding LLM schema.
|
|
@@ -196,7 +196,7 @@ export declare function controller<Class extends Record<string, any>, Model exte
|
|
|
196
196
|
* - `deepseek`: [`IDeepSeekSchema`](https://samchon.github.io/openapi/api/types/IClaudeSchema-1.html)
|
|
197
197
|
* - `gemini`: [`IGeminiSchema`](https://samchon.github.io/openapi/api/types/IGeminiSchema-1.html)
|
|
198
198
|
* - `llama`: [`ILlamaSchema`](https://samchon.github.io/openapi/api/types/ILlamaSchema-1.html)
|
|
199
|
-
* -
|
|
199
|
+
* - Middle layer schemas
|
|
200
200
|
* - `3.0`: [`ILlmSchemaV3`](https://samchon.github.io/openapi/api/types/ILlmSchemaV3-1.html)
|
|
201
201
|
* - `3.1`: [`ILlmSchemaV3_1`](https://samchon.github.io/openapi/api/types/ILlmSchemaV3_1-1.html)
|
|
202
202
|
*
|
|
@@ -208,7 +208,7 @@ export declare function controller<Class extends Record<string, any>, Model exte
|
|
|
208
208
|
* @reference https://platform.openai.com/docs/guides/function-calling
|
|
209
209
|
* @author Jeongho Nam - https://github.com/samchon
|
|
210
210
|
*/
|
|
211
|
-
export declare function application(options?: Partial<Pick<ILlmApplication.IOptions<any>, "separate">>): never;
|
|
211
|
+
export declare function application(options?: Partial<Pick<ILlmApplication.IOptions<any, any>, "separate" | "validate">>): never;
|
|
212
212
|
/**
|
|
213
213
|
* TypeScript functions to LLM function calling application.
|
|
214
214
|
*
|
|
@@ -236,7 +236,7 @@ export declare function application(options?: Partial<Pick<ILlmApplication.IOpti
|
|
|
236
236
|
*
|
|
237
237
|
* Additionally, if you've configured {@link ILlmApplication.IOptions.separate},
|
|
238
238
|
* so that the parameters are separated to human and LLM sides, you can merge these
|
|
239
|
-
*
|
|
239
|
+
* human and LLM sides' parameters into one through {@link HttpLlm.mergeParameters}
|
|
240
240
|
* before the actual LLM function call execution.
|
|
241
241
|
*
|
|
242
242
|
* Here is the list of available `Model` types with their corresponding LLM schema.
|
|
@@ -249,7 +249,7 @@ export declare function application(options?: Partial<Pick<ILlmApplication.IOpti
|
|
|
249
249
|
* - `deepseek`: [`IDeepSeekSchema`](https://samchon.github.io/openapi/api/types/IClaudeSchema-1.html)
|
|
250
250
|
* - `gemini`: [`IGeminiSchema`](https://samchon.github.io/openapi/api/types/IGeminiSchema-1.html)
|
|
251
251
|
* - `llama`: [`ILlamaSchema`](https://samchon.github.io/openapi/api/types/ILlamaSchema-1.html)
|
|
252
|
-
* -
|
|
252
|
+
* - Middle layer schemas
|
|
253
253
|
* - `3.0`: [`ILlmSchemaV3`](https://samchon.github.io/openapi/api/types/ILlmSchemaV3-1.html)
|
|
254
254
|
* - `3.1`: [`ILlmSchemaV3_1`](https://samchon.github.io/openapi/api/types/ILlmSchemaV3_1-1.html)
|
|
255
255
|
*
|
|
@@ -272,7 +272,7 @@ export declare function application<Class extends Record<string, any>, Model ext
|
|
|
272
272
|
* @default false
|
|
273
273
|
*/
|
|
274
274
|
equals: boolean;
|
|
275
|
-
} & ILlmSchema.ModelConfig[Model]> = {}>(options?: Partial<Pick<ILlmApplication.IOptions<Model>, "separate">>): ILlmApplication<Model, Class>;
|
|
275
|
+
} & ILlmSchema.ModelConfig[Model]> = {}>(options?: Partial<Pick<ILlmApplication.IOptions<Model, Class>, "separate" | "validate">>): ILlmApplication<Model, Class>;
|
|
276
276
|
/**
|
|
277
277
|
* > You must configure the generic argument `Parameters`.
|
|
278
278
|
*
|
|
@@ -285,7 +285,7 @@ export declare function application<Class extends Record<string, any>, Model ext
|
|
|
285
285
|
*
|
|
286
286
|
* For references, LLM identifies only keyworded arguments, not positional arguments.
|
|
287
287
|
* Therefore, the TypeScript parameters type must be an object type, and its properties
|
|
288
|
-
* must be static. If dynamic properties are, it
|
|
288
|
+
* must be static. If dynamic properties are, it will be compilation error.
|
|
289
289
|
*
|
|
290
290
|
* Also, such parameters type can be utilized not only for the LLM function calling,
|
|
291
291
|
* but also for the LLM structured outputs. The LLM structured outputs is a feature
|
|
@@ -303,7 +303,7 @@ export declare function application<Class extends Record<string, any>, Model ext
|
|
|
303
303
|
* - `deepseek`: [`IDeepSeekSchema`](https://samchon.github.io/openapi/api/types/IClaudeSchema-1.html)
|
|
304
304
|
* - `gemini`: [`IGeminiSchema`](https://samchon.github.io/openapi/api/types/IGeminiSchema-1.html)
|
|
305
305
|
* - `llama`: [`ILlamaSchema`](https://samchon.github.io/openapi/api/types/ILlamaSchema-1.html)
|
|
306
|
-
* -
|
|
306
|
+
* - Middle layer schemas
|
|
307
307
|
* - `3.0`: [`ILlmSchemaV3`](https://samchon.github.io/openapi/api/types/ILlmSchemaV3-1.html)
|
|
308
308
|
* - `3.1`: [`ILlmSchemaV3_1`](https://samchon.github.io/openapi/api/types/ILlmSchemaV3_1-1.html)
|
|
309
309
|
*
|
|
@@ -325,7 +325,7 @@ export declare function parameters(): never;
|
|
|
325
325
|
*
|
|
326
326
|
* For references, LLM identifies only keyworded arguments, not positional arguments.
|
|
327
327
|
* Therefore, the TypeScript parameters type must be an object type, and its properties
|
|
328
|
-
* must be static. If dynamic properties are, it
|
|
328
|
+
* must be static. If dynamic properties are, it will be compilation error.
|
|
329
329
|
*
|
|
330
330
|
* Also, such parameters type can be utilized not only for the LLM function calling,
|
|
331
331
|
* but also for the LLM structured outputs. The LLM structured outputs is a feature
|
|
@@ -343,7 +343,7 @@ export declare function parameters(): never;
|
|
|
343
343
|
* - `deepseek`: [`IDeepSeekSchema`](https://samchon.github.io/openapi/api/types/IClaudeSchema-1.html)
|
|
344
344
|
* - `gemini`: [`IGeminiSchema`](https://samchon.github.io/openapi/api/types/IGeminiSchema-1.html)
|
|
345
345
|
* - `llama`: [`ILlamaSchema`](https://samchon.github.io/openapi/api/types/ILlamaSchema-1.html)
|
|
346
|
-
* -
|
|
346
|
+
* - Middle layer schemas
|
|
347
347
|
* - `3.0`: [`ILlmSchemaV3`](https://samchon.github.io/openapi/api/types/ILlmSchemaV3-1.html)
|
|
348
348
|
* - `3.1`: [`ILlmSchemaV3_1`](https://samchon.github.io/openapi/api/types/ILlmSchemaV3_1-1.html)
|
|
349
349
|
*
|
|
@@ -364,7 +364,7 @@ export declare function parameters<Parameters extends Record<string, any>, Model
|
|
|
364
364
|
* [LLM function calling](@reference https://platform.openai.com/docs/guides/function-calling),
|
|
365
365
|
* from a TypeScript type.
|
|
366
366
|
*
|
|
367
|
-
* The returned {@link ILlmSchema} type
|
|
367
|
+
* The returned {@link ILlmSchema} type will be specified by the `Model` argument,
|
|
368
368
|
* and here is the list of available `Model` types with their corresponding LLM schema.
|
|
369
369
|
* Reading the following list, and determine the `Model` type considering the
|
|
370
370
|
* characteristics of the target LLM provider.
|
|
@@ -375,7 +375,7 @@ export declare function parameters<Parameters extends Record<string, any>, Model
|
|
|
375
375
|
* - `deepseek`: [`IDeepSeekSchema`](https://samchon.github.io/openapi/api/types/IClaudeSchema-1.html)
|
|
376
376
|
* - `gemini`: [`IGeminiSchema`](https://samchon.github.io/openapi/api/types/IGeminiSchema-1.html)
|
|
377
377
|
* - `llama`: [`ILlamaSchema`](https://samchon.github.io/openapi/api/types/ILlamaSchema-1.html)
|
|
378
|
-
* -
|
|
378
|
+
* - Middle layer schemas
|
|
379
379
|
* - `3.0`: [`ILlmSchemaV3`](https://samchon.github.io/openapi/api/types/ILlmSchemaV3-1.html)
|
|
380
380
|
* - `3.1`: [`ILlmSchemaV3_1`](https://samchon.github.io/openapi/api/types/ILlmSchemaV3_1-1.html)
|
|
381
381
|
*
|
|
@@ -413,7 +413,7 @@ export declare function schema(): never;
|
|
|
413
413
|
* [LLM function calling](@reference https://platform.openai.com/docs/guides/function-calling),
|
|
414
414
|
* from a TypeScript type.
|
|
415
415
|
*
|
|
416
|
-
* The returned {@link ILlmSchema} type
|
|
416
|
+
* The returned {@link ILlmSchema} type will be specified by the `Model` argument,
|
|
417
417
|
* and here is the list of available `Model` types with their corresponding LLM schema:
|
|
418
418
|
*
|
|
419
419
|
* - LLM provider schemas
|
|
@@ -422,7 +422,7 @@ export declare function schema(): never;
|
|
|
422
422
|
* - `deepseek`: [`IDeepSeekSchema`](https://samchon.github.io/openapi/api/types/IClaudeSchema-1.html)
|
|
423
423
|
* - `gemini`: [`IGeminiSchema`](https://samchon.github.io/openapi/api/types/IGeminiSchema-1.html)
|
|
424
424
|
* - `llama`: [`ILlamaSchema`](https://samchon.github.io/openapi/api/types/ILlamaSchema-1.html)
|
|
425
|
-
* -
|
|
425
|
+
* - Middle layer schemas
|
|
426
426
|
* - `3.0`: [`ILlmSchemaV3`](https://samchon.github.io/openapi/api/types/ILlmSchemaV3-1.html)
|
|
427
427
|
* - `3.1`: [`ILlmSchemaV3_1`](https://samchon.github.io/openapi/api/types/ILlmSchemaV3_1-1.html)
|
|
428
428
|
*
|