typia 7.6.0 → 7.6.1
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/README.md +2 -1
- package/lib/IReadableURLSearchParams.d.ts +1 -1
- package/lib/TypeGuardError.mjs +26 -0
- package/lib/TypeGuardError.mjs.map +1 -0
- package/lib/factories/MetadataTypeTagFactory.js +1 -1
- package/lib/factories/MetadataTypeTagFactory.js.map +1 -1
- package/lib/factories/ProtobufFactory.js +4 -4
- package/lib/factories/ProtobufFactory.js.map +1 -1
- package/lib/factories/internal/metadata/iterate_metadata_intersection.js +1 -1
- package/lib/factories/internal/metadata/iterate_metadata_intersection.js.map +1 -1
- package/lib/functional.mjs +120 -0
- package/lib/functional.mjs.map +1 -0
- package/lib/http.d.ts +16 -16
- package/lib/http.mjs +165 -0
- package/lib/http.mjs.map +1 -0
- package/lib/index.mjs +27 -1142
- package/lib/index.mjs.map +1 -1
- package/lib/internal/_isUniqueItems.js +1 -1
- package/lib/json.d.ts +5 -5
- package/lib/json.mjs +105 -0
- package/lib/json.mjs.map +1 -0
- package/lib/llm.d.ts +8 -8
- package/lib/llm.mjs +33 -0
- package/lib/llm.mjs.map +1 -0
- package/lib/misc.d.ts +10 -10
- package/lib/misc.mjs +111 -0
- package/lib/misc.mjs.map +1 -0
- package/lib/module.d.ts +5 -5
- package/lib/module.mjs +139 -0
- package/lib/module.mjs.map +1 -0
- package/lib/notations.mjs +153 -0
- package/lib/notations.mjs.map +1 -0
- package/lib/programmers/FeatureProgrammer.d.ts +3 -3
- package/lib/programmers/TypiaProgrammer.js +1 -1
- package/lib/programmers/TypiaProgrammer.js.map +1 -1
- package/lib/programmers/helpers/UnionExplorer.js +1 -1
- package/lib/programmers/helpers/UnionExplorer.js.map +1 -1
- package/lib/programmers/helpers/UnionPredicator.d.ts +1 -1
- package/lib/programmers/helpers/UnionPredicator.js +1 -1
- package/lib/programmers/helpers/UnionPredicator.js.map +1 -1
- package/lib/programmers/json/JsonApplicationProgrammer.js +1 -1
- package/lib/programmers/llm/LlmApplicationProgrammer.js +2 -2
- package/lib/programmers/llm/LlmApplicationProgrammer.js.map +1 -1
- package/lib/programmers/llm/LlmParametersProgrammer.js +1 -1
- package/lib/programmers/llm/LlmParametersProgrammer.js.map +1 -1
- package/lib/programmers/protobuf/ProtobufEncodeProgrammer.js +1 -1
- package/lib/programmers/protobuf/ProtobufEncodeProgrammer.js.map +1 -1
- package/lib/protobuf.d.ts +9 -9
- package/lib/protobuf.mjs +111 -0
- package/lib/protobuf.mjs.map +1 -0
- package/lib/reflect.mjs +18 -0
- package/lib/reflect.mjs.map +1 -0
- package/lib/schemas/llm/ILlmApplicationOfValidate.d.ts +2 -2
- package/lib/schemas/llm/ILlmApplicationOfValidate.mjs +6 -0
- package/lib/schemas/llm/ILlmApplicationOfValidate.mjs.map +1 -0
- package/lib/schemas/llm/ILlmFunctionOfValidate.mjs +6 -0
- package/lib/schemas/llm/ILlmFunctionOfValidate.mjs.map +1 -0
- package/lib/tags/TagBase.d.ts +1 -1
- package/lib/tags/index.mjs +2 -0
- package/lib/tags/index.mjs.map +1 -0
- package/lib/transformers/ImportTransformer.js +3 -3
- package/lib/transformers/ImportTransformer.js.map +1 -1
- package/lib/transformers/features/json/JsonValidateParseTransformer.js +1 -1
- package/lib/transformers/features/json/JsonValidateParseTransformer.js.map +1 -1
- package/lib/transformers/features/json/JsonValidateStringifyTransformer.js +1 -1
- package/lib/transformers/features/json/JsonValidateStringifyTransformer.js.map +1 -1
- package/lib/transformers/features/misc/MiscValidateCloneTransformer.js +1 -1
- package/lib/transformers/features/misc/MiscValidateCloneTransformer.js.map +1 -1
- package/lib/transformers/features/misc/MiscValidatePruneTransformer.js +1 -1
- package/lib/transformers/features/misc/MiscValidatePruneTransformer.js.map +1 -1
- package/lib/transformers/features/reflect/ReflectNameTransformer.js +1 -1
- package/package.json +11 -9
- package/src/IReadableURLSearchParams.ts +1 -1
- package/src/factories/MetadataTypeTagFactory.ts +1 -1
- package/src/factories/ProtobufFactory.ts +4 -4
- package/src/factories/internal/metadata/iterate_metadata_intersection.ts +1 -1
- package/src/http.ts +16 -16
- package/src/internal/_isUniqueItems.ts +1 -1
- package/src/json.ts +6 -6
- package/src/llm.ts +8 -8
- package/src/misc.ts +11 -11
- package/src/module.ts +5 -5
- package/src/programmers/FeatureProgrammer.ts +3 -3
- package/src/programmers/TypiaProgrammer.ts +1 -1
- package/src/programmers/helpers/UnionExplorer.ts +1 -1
- package/src/programmers/helpers/UnionPredicator.ts +3 -3
- package/src/programmers/json/JsonApplicationProgrammer.ts +1 -1
- package/src/programmers/llm/LlmApplicationProgrammer.ts +2 -2
- package/src/programmers/llm/LlmParametersProgrammer.ts +1 -1
- package/src/programmers/protobuf/ProtobufEncodeProgrammer.ts +1 -1
- package/src/protobuf.ts +9 -9
- package/src/schemas/llm/ILlmApplicationOfValidate.ts +2 -2
- package/src/tags/TagBase.ts +1 -1
- package/src/transformers/ImportTransformer.ts +3 -3
- package/src/transformers/features/json/JsonValidateParseTransformer.ts +1 -1
- package/src/transformers/features/json/JsonValidateStringifyTransformer.ts +1 -1
- package/src/transformers/features/misc/MiscValidateCloneTransformer.ts +1 -1
- package/src/transformers/features/misc/MiscValidatePruneTransformer.ts +1 -1
- package/src/transformers/features/reflect/ReflectNameTransformer.ts +1 -1
package/src/llm.ts
CHANGED
|
@@ -24,7 +24,7 @@ import { ILlmApplicationOfValidate } from "./module";
|
|
|
24
24
|
*
|
|
25
25
|
* By the way, there can be some parameters (or their nested properties) which must be
|
|
26
26
|
* composed by human, not by LLM. File uploading feature or some sensitive information
|
|
27
|
-
* like
|
|
27
|
+
* like security keys (password) are the examples. In that case, you can separate the
|
|
28
28
|
* function parameters to both LLM and human sides by configuring the
|
|
29
29
|
* {@link ILlmApplicationOfValidate.IOptions.separate} property. The separated parameters
|
|
30
30
|
* are assigned to the {@link ILlmFunctionOfValidate.separated} property.
|
|
@@ -85,7 +85,7 @@ export function applicationOfValidate(
|
|
|
85
85
|
*
|
|
86
86
|
* By the way, there can be some parameters (or their nested properties) which must be
|
|
87
87
|
* composed by human, not by LLM. File uploading feature or some sensitive information
|
|
88
|
-
* like
|
|
88
|
+
* like security keys (password) are the examples. In that case, you can separate the
|
|
89
89
|
* function parameters to both LLM and human sides by configuring the
|
|
90
90
|
* {@link ILlmApplicationOfValidate.IOptions.separate} property. The separated parameters
|
|
91
91
|
* are assigned to the {@link ILlmFunctionOfValidate.separated} property.
|
|
@@ -155,7 +155,7 @@ export function applicationOfValidate(): never {
|
|
|
155
155
|
*
|
|
156
156
|
* By the way, there can be some parameters (or their nested properties) which must be
|
|
157
157
|
* composed by human, not by LLM. File uploading feature or some sensitive information
|
|
158
|
-
* like
|
|
158
|
+
* like security keys (password) are the examples. In that case, you can separate the
|
|
159
159
|
* function parameters to both LLM and human sides by configuring the
|
|
160
160
|
* {@link ILlmApplication.IOptions.separate} property. The separated parameters are
|
|
161
161
|
* assigned to the {@link ILlmFunction.separated} property.
|
|
@@ -210,7 +210,7 @@ export function application(
|
|
|
210
210
|
*
|
|
211
211
|
* By the way, there can be some parameters (or their nested properties) which must be
|
|
212
212
|
* composed by human, not by LLM. File uploading feature or some sensitive information
|
|
213
|
-
* like
|
|
213
|
+
* like security keys (password) are the examples. In that case, you can separate the
|
|
214
214
|
* function parameters to both LLM and human sides by configuring the
|
|
215
215
|
* {@link ILlmApplication.IOptions.separate} property. The separated parameters are
|
|
216
216
|
* assigned to the {@link ILlmFunction.separated} property.
|
|
@@ -385,8 +385,8 @@ export function parameters(): never {
|
|
|
385
385
|
*
|
|
386
386
|
* > **What LLM function calling is?
|
|
387
387
|
* >
|
|
388
|
-
* > LLM (Large Language Model) selects
|
|
389
|
-
* > but
|
|
388
|
+
* > LLM (Large Language Model) selects property function and fill the arguments,
|
|
389
|
+
* > but actual function call execution is not by LLM, but by you.
|
|
390
390
|
* >
|
|
391
391
|
* > In nowadays, most LLM (Large Language Model) like OpenAI are supporting
|
|
392
392
|
* > "function calling" feature. The "function calling" means that LLM automatically selects
|
|
@@ -432,8 +432,8 @@ export function schema(): never;
|
|
|
432
432
|
*
|
|
433
433
|
* > **What LLM function calling is?
|
|
434
434
|
* >
|
|
435
|
-
* > LLM (Large Language Model) selects
|
|
436
|
-
* > but
|
|
435
|
+
* > LLM (Large Language Model) selects property function and fill the arguments,
|
|
436
|
+
* > but actual function call execution is not by LLM, but by you.
|
|
437
437
|
* >
|
|
438
438
|
* > In nowadays, most LLM (Large Language Model) like OpenAI are supporting
|
|
439
439
|
* > "function calling" feature. The "function calling" means that LLM automatically selects
|
package/src/misc.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* ===========================================================
|
|
2
|
-
|
|
2
|
+
MISCELLANEOUS
|
|
3
3
|
- LITERALS
|
|
4
4
|
- CLONE
|
|
5
5
|
- PRUNE
|
|
@@ -365,7 +365,7 @@ export function isPrune(): never {
|
|
|
365
365
|
*
|
|
366
366
|
* In such reason, when `input` value is not matched with the type `T`, it returns
|
|
367
367
|
* {@link IValidation.IFailure} value with detailed error reasons. Otherwise, there's
|
|
368
|
-
* no problem on the `input` value, it returns {@link IValidation.
|
|
368
|
+
* no problem on the `input` value, it returns {@link IValidation.ISuccess} value after
|
|
369
369
|
* removing every superfluous properties, including nested objects.
|
|
370
370
|
*
|
|
371
371
|
* @template T Type of the input value
|
|
@@ -385,7 +385,7 @@ export function validatePrune<T>(input: T): IValidation<T>;
|
|
|
385
385
|
*
|
|
386
386
|
* In such reason, when `input` value is not matched with the type `T`, it returns
|
|
387
387
|
* {@link IValidation.IFailure} value with detailed error reasons. Otherwise, there's
|
|
388
|
-
* no problem on the `input` value, it returns {@link IValidation.
|
|
388
|
+
* no problem on the `input` value, it returns {@link IValidation.ISuccess} value after
|
|
389
389
|
* removing every superfluous properties, including nested objects.
|
|
390
390
|
*
|
|
391
391
|
* @template T Type of the input value
|
|
@@ -418,7 +418,7 @@ export function validatePrune<T>(): IValidation<T> {
|
|
|
418
418
|
export function createClone(): never;
|
|
419
419
|
|
|
420
420
|
/**
|
|
421
|
-
* Creates a
|
|
421
|
+
* Creates a reusable {@link clone} function.
|
|
422
422
|
*
|
|
423
423
|
* @template T Type of the input value
|
|
424
424
|
* @returns A reusable `clone` function
|
|
@@ -449,7 +449,7 @@ export function createAssertClone(
|
|
|
449
449
|
): never;
|
|
450
450
|
|
|
451
451
|
/**
|
|
452
|
-
* Creates a
|
|
452
|
+
* Creates a reusable {@link assertClone} function.
|
|
453
453
|
*
|
|
454
454
|
* @template T Type of the input value
|
|
455
455
|
* @param errorFactory Custom error factory. Default is `TypeGuardError`
|
|
@@ -480,7 +480,7 @@ export function createAssertClone(): never {
|
|
|
480
480
|
export function createIsClone(): never;
|
|
481
481
|
|
|
482
482
|
/**
|
|
483
|
-
* Creates a
|
|
483
|
+
* Creates a reusable {@link isClone} function.
|
|
484
484
|
*
|
|
485
485
|
* @template T Type of the input value
|
|
486
486
|
* @returns A reusable `clone` function
|
|
@@ -508,7 +508,7 @@ export function createIsClone(): never {
|
|
|
508
508
|
export function createValidateClone(): never;
|
|
509
509
|
|
|
510
510
|
/**
|
|
511
|
-
* Creates a
|
|
511
|
+
* Creates a reusable {@link validateClone} function.
|
|
512
512
|
*
|
|
513
513
|
* @template T Type of the input value
|
|
514
514
|
* @returns A reusable `clone` function
|
|
@@ -538,7 +538,7 @@ export function createValidateClone(): never {
|
|
|
538
538
|
export function createPrune(): never;
|
|
539
539
|
|
|
540
540
|
/**
|
|
541
|
-
* Creates a
|
|
541
|
+
* Creates a reusable {@link prune} function.
|
|
542
542
|
*
|
|
543
543
|
* @template T Type of the input value
|
|
544
544
|
* @returns A reusable `prune` function
|
|
@@ -569,7 +569,7 @@ export function createAssertPrune(
|
|
|
569
569
|
): never;
|
|
570
570
|
|
|
571
571
|
/**
|
|
572
|
-
* Creates a
|
|
572
|
+
* Creates a reusable {@link assertPrune} function.
|
|
573
573
|
*
|
|
574
574
|
* @template T Type of the input value
|
|
575
575
|
* @param errorFactory Custom error factory. Default is `TypeGuardError`
|
|
@@ -600,7 +600,7 @@ export function createAssertPrune<T extends object>(): (input: T) => T {
|
|
|
600
600
|
export function createIsPrune(): never;
|
|
601
601
|
|
|
602
602
|
/**
|
|
603
|
-
* Creates a
|
|
603
|
+
* Creates a reusable {@link isPrune} function.
|
|
604
604
|
*
|
|
605
605
|
* @template T Type of the input value
|
|
606
606
|
* @returns A reusable `isPrune` function
|
|
@@ -628,7 +628,7 @@ export function createIsPrune<T extends object>(): (input: T) => input is T {
|
|
|
628
628
|
export function createValidatePrune(): never;
|
|
629
629
|
|
|
630
630
|
/**
|
|
631
|
-
* Creates a
|
|
631
|
+
* Creates a reusable {@link validatePrune} function.
|
|
632
632
|
*
|
|
633
633
|
* @template T Type of the input value
|
|
634
634
|
* @returns A reusable `validatePrune` function
|
package/src/module.ts
CHANGED
|
@@ -630,7 +630,7 @@ export function createAssert<T>(): (input: unknown) => T {
|
|
|
630
630
|
* // MUST DECLARE THE VARIABLE TYPE
|
|
631
631
|
* const func: typia.AssertionGuard<number> = typia.createAssertGuard<number>();
|
|
632
632
|
*
|
|
633
|
-
* // IF NOT, COMPILATION ERROR BE
|
|
633
|
+
* // IF NOT, COMPILATION ERROR BE OCCURRED
|
|
634
634
|
* const func = typia.createAssertGuard<number>();
|
|
635
635
|
* ```
|
|
636
636
|
*
|
|
@@ -659,7 +659,7 @@ export function createAssertGuard(
|
|
|
659
659
|
* // MUST DECLARE THE VARIABLE TYPE
|
|
660
660
|
* const func: typia.AssertionGuard<number> = typia.createAssertGuard<number>();
|
|
661
661
|
*
|
|
662
|
-
* // IF NOT, COMPILATION ERROR BE
|
|
662
|
+
* // IF NOT, COMPILATION ERROR BE OCCURRED
|
|
663
663
|
* const func = typia.createAssertGuard<number>();
|
|
664
664
|
* ```
|
|
665
665
|
*
|
|
@@ -784,7 +784,7 @@ export function createAssertEquals<T>(): (input: unknown) => T {
|
|
|
784
784
|
* // MUST DECLARE THE VARIABLE TYPE
|
|
785
785
|
* const func: typia.AssertionGuard<number> = typia.createAssertGuardEquals<number>();
|
|
786
786
|
*
|
|
787
|
-
* // IF NOT, COMPILATION ERROR BE
|
|
787
|
+
* // IF NOT, COMPILATION ERROR BE OCCURRED
|
|
788
788
|
* const func = typia.createAssertGuardEquals<number>();
|
|
789
789
|
* ```
|
|
790
790
|
*
|
|
@@ -813,7 +813,7 @@ export function createAssertGuardEquals(
|
|
|
813
813
|
* // MUST DECLARE THE VARIABLE TYPE
|
|
814
814
|
* const func: typia.AssertionGuard<number> = typia.createAssertGuardEquals<number>();
|
|
815
815
|
*
|
|
816
|
-
* // IF NOT, COMPILATION ERROR BE
|
|
816
|
+
* // IF NOT, COMPILATION ERROR BE OCCURRED
|
|
817
817
|
* const func = typia.createAssertGuardEquals<number>();
|
|
818
818
|
* ```
|
|
819
819
|
*
|
|
@@ -908,7 +908,7 @@ export function createValidateEquals(): (input: unknown) => IValidation {
|
|
|
908
908
|
export function createRandom(generator?: Partial<IRandomGenerator>): never;
|
|
909
909
|
|
|
910
910
|
/**
|
|
911
|
-
* Creates a
|
|
911
|
+
* Creates a reusable {@link random} function.
|
|
912
912
|
*
|
|
913
913
|
* @template T Type of the input value
|
|
914
914
|
* @param generator Random data generator
|
|
@@ -150,7 +150,7 @@ export namespace FeatureProgrammer {
|
|
|
150
150
|
* Transformer of non-undefined type checking by discrimination.
|
|
151
151
|
*
|
|
152
152
|
* When specifying an union type of objects, `typia` tries to find
|
|
153
|
-
*
|
|
153
|
+
* discrimination way just by checking only one property type.
|
|
154
154
|
* If succeeded to find the discrimination way, `typia` will check the target
|
|
155
155
|
* property type and in the checking, non-undefined type checking would be
|
|
156
156
|
* done.
|
|
@@ -164,10 +164,10 @@ export namespace FeatureProgrammer {
|
|
|
164
164
|
required?: undefined | ((exp: ts.Expression) => ts.Expression);
|
|
165
165
|
|
|
166
166
|
/**
|
|
167
|
-
*
|
|
167
|
+
* Condition wrapper when unable to specify any object type.
|
|
168
168
|
*
|
|
169
169
|
* When failed to specify an object type through discrimination, full
|
|
170
|
-
* iteration type checking would be
|
|
170
|
+
* iteration type checking would be happened. In such circumstance, you
|
|
171
171
|
* can wrap the condition with additional function.
|
|
172
172
|
*
|
|
173
173
|
* @param props Properties of condition
|
|
@@ -10,7 +10,7 @@ export namespace UnionPredicator {
|
|
|
10
10
|
index: number;
|
|
11
11
|
object: MetadataObjectType;
|
|
12
12
|
property: MetadataProperty;
|
|
13
|
-
|
|
13
|
+
neighbor: boolean;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
export const object = (
|
|
@@ -55,7 +55,7 @@ export namespace UnionPredicator {
|
|
|
55
55
|
if (unique === true)
|
|
56
56
|
children.push({
|
|
57
57
|
property: prop,
|
|
58
|
-
|
|
58
|
+
neighbor: neighbors.length !== 0,
|
|
59
59
|
});
|
|
60
60
|
});
|
|
61
61
|
if (children.length === 0) return;
|
|
@@ -75,5 +75,5 @@ export namespace UnionPredicator {
|
|
|
75
75
|
|
|
76
76
|
interface ISpecializedProperty {
|
|
77
77
|
property: MetadataProperty;
|
|
78
|
-
|
|
78
|
+
neighbor: boolean;
|
|
79
79
|
}
|
|
@@ -24,7 +24,7 @@ export namespace JsonApplicationProgrammer {
|
|
|
24
24
|
metadata.nullable === false;
|
|
25
25
|
if (valid === false)
|
|
26
26
|
output.push(
|
|
27
|
-
"JSON application's generic
|
|
27
|
+
"JSON application's generic argument must be a class/interface type.",
|
|
28
28
|
);
|
|
29
29
|
|
|
30
30
|
const object: MetadataObjectType | undefined = metadata.objects[0]?.type;
|
|
@@ -49,7 +49,7 @@ export namespace LlmApplicationProgrammer {
|
|
|
49
49
|
metadata.nullable === false;
|
|
50
50
|
if (validity === false)
|
|
51
51
|
output.push(
|
|
52
|
-
"LLM application's generic
|
|
52
|
+
"LLM application's generic argument must be a class/interface type.",
|
|
53
53
|
);
|
|
54
54
|
|
|
55
55
|
const object: MetadataObjectType | undefined = metadata.objects[0]?.type;
|
|
@@ -116,7 +116,7 @@ export namespace LlmApplicationProgrammer {
|
|
|
116
116
|
output.push(`${prefix} name must not start with a number.`);
|
|
117
117
|
if (/^[a-zA-Z0-9_-]+$/.test(name) === false)
|
|
118
118
|
output.push(
|
|
119
|
-
`${prefix} name must be alphanumeric with underscore or
|
|
119
|
+
`${prefix} name must be alphanumeric with underscore or hyphen.`,
|
|
120
120
|
);
|
|
121
121
|
if (name.length > 64)
|
|
122
122
|
output.push(`${prefix} name must not exceed 64 characters.`);
|
|
@@ -71,7 +71,7 @@ export namespace LlmParametersProgrammer {
|
|
|
71
71
|
const output: string[] = [];
|
|
72
72
|
if (explore.top === true) {
|
|
73
73
|
if (metadata.objects.length === 0)
|
|
74
|
-
output.push("LLM parameters must be an
|
|
74
|
+
output.push("LLM parameters must be an object type.");
|
|
75
75
|
else if (metadata.objects.length !== 1 || metadata.size() > 1)
|
|
76
76
|
output.push("LLM parameters must be a single object type.");
|
|
77
77
|
else {
|
|
@@ -828,7 +828,7 @@ export namespace ProtobufEncodeProgrammer {
|
|
|
828
828
|
props.input,
|
|
829
829
|
key,
|
|
830
830
|
);
|
|
831
|
-
const pred: ts.Expression = spec.
|
|
831
|
+
const pred: ts.Expression = spec.neighbor
|
|
832
832
|
? IsProgrammer.decode({
|
|
833
833
|
context: props.context,
|
|
834
834
|
functor: props.functor,
|
package/src/protobuf.ts
CHANGED
|
@@ -73,7 +73,7 @@ export function message(): never {
|
|
|
73
73
|
*
|
|
74
74
|
* For reference, as Protocol Buffer handles binary data directly, there's no way
|
|
75
75
|
* when `input` binary data was not encoded from the `T` typed value. In that case,
|
|
76
|
-
* unexpected behavior or internal error would be
|
|
76
|
+
* unexpected behavior or internal error would be occurred. Therefore, I recommend you
|
|
77
77
|
* to encode binary data of Protocol Buffer from type safe encode functions like below.
|
|
78
78
|
* Use {@link encode} function only when you can ensure it.
|
|
79
79
|
*
|
|
@@ -103,7 +103,7 @@ export function decode(input: Uint8Array): never;
|
|
|
103
103
|
*
|
|
104
104
|
* For reference, as Protocol Buffer handles binary data directly, there's no way
|
|
105
105
|
* when `input` binary data was not encoded from the `T` typed value. In that case,
|
|
106
|
-
* unexpected behavior or internal error would be
|
|
106
|
+
* unexpected behavior or internal error would be occurred. Therefore, I recommend you
|
|
107
107
|
* to encode binary data of Protocol Buffer from type safe encode functions like below.
|
|
108
108
|
* Use {@link encode} function only when you can ensure it.
|
|
109
109
|
*
|
|
@@ -354,7 +354,7 @@ export function validateDecode(): never {
|
|
|
354
354
|
* For reference, this `typia.protobuf.encode()` does not validate the `input` value.
|
|
355
355
|
* It just believes that the `input` value is valid and converts it to a binary data
|
|
356
356
|
* directly. Therefore, if you can't ensure the `input` value type, it would better to
|
|
357
|
-
* call one of below functions
|
|
357
|
+
* call one of below functions instead.
|
|
358
358
|
*
|
|
359
359
|
* - {@link assertEncode}
|
|
360
360
|
* - {@link isEncode}
|
|
@@ -394,7 +394,7 @@ export function encode(): never {
|
|
|
394
394
|
* Protocol Buffer binary data would be returned.
|
|
395
395
|
*
|
|
396
396
|
* If you can trust `input` value, or want to perform other type of validation, use
|
|
397
|
-
* below functions
|
|
397
|
+
* below functions instead.
|
|
398
398
|
*
|
|
399
399
|
* - {@link encode}
|
|
400
400
|
* - {@link isEncode}
|
|
@@ -431,7 +431,7 @@ export function assertEncode<T>(
|
|
|
431
431
|
* Protocol Buffer binary data would be returned.
|
|
432
432
|
*
|
|
433
433
|
* If you can trust `input` value, or want to perform other type of validation, use
|
|
434
|
-
* below functions
|
|
434
|
+
* below functions instead.
|
|
435
435
|
*
|
|
436
436
|
* - {@link encode}
|
|
437
437
|
* - {@link isEncode}
|
|
@@ -475,7 +475,7 @@ export function assertEncode(): never {
|
|
|
475
475
|
* Buffer binary data would be returned.
|
|
476
476
|
*
|
|
477
477
|
* If you can trust `input` value, or want to perform other type of validation, use
|
|
478
|
-
* below functions
|
|
478
|
+
* below functions instead.
|
|
479
479
|
*
|
|
480
480
|
* - {@link encode}
|
|
481
481
|
* - {@link assertEncode}
|
|
@@ -508,7 +508,7 @@ export function isEncode<T>(input: T): Uint8Array | null;
|
|
|
508
508
|
* Buffer binary data would be returned.
|
|
509
509
|
*
|
|
510
510
|
* If you can trust `input` value, or want to perform other type of validation, use
|
|
511
|
-
* below functions
|
|
511
|
+
* below functions instead.
|
|
512
512
|
*
|
|
513
513
|
* - {@link encode}
|
|
514
514
|
* - {@link assertEncode}
|
|
@@ -549,7 +549,7 @@ export function isEncode(): never {
|
|
|
549
549
|
* `data` property of the output {@link IValidation.ISuccess} instance.
|
|
550
550
|
*
|
|
551
551
|
* If you can trust `input` value, or want to perform other type of validation, use
|
|
552
|
-
* below functions
|
|
552
|
+
* below functions instead.
|
|
553
553
|
*
|
|
554
554
|
* - {@link encode}
|
|
555
555
|
* - {@link assertEncode}
|
|
@@ -583,7 +583,7 @@ export function validateEncode<T>(input: T): IValidation<Uint8Array>;
|
|
|
583
583
|
* `data` property of the output {@link IValidation.ISuccess} instance.
|
|
584
584
|
*
|
|
585
585
|
* If you can trust `input` value, or want to perform other type of validation, use
|
|
586
|
-
* below functions
|
|
586
|
+
* below functions instead.
|
|
587
587
|
*
|
|
588
588
|
* - {@link encode}
|
|
589
589
|
* - {@link assertEncode}
|
|
@@ -23,7 +23,7 @@ import { ILlmFunctionOfValidate } from "./ILlmFunctionOfValidate";
|
|
|
23
23
|
*
|
|
24
24
|
* By the way, there can be some parameters (or their nested properties) which must be
|
|
25
25
|
* composed by Human, not by LLM. File uploading feature or some sensitive information
|
|
26
|
-
* like
|
|
26
|
+
* like secret keys (password) are the examples. In that case, you can separate the
|
|
27
27
|
* function parameters to both LLM and human sides by configuring the
|
|
28
28
|
* {@link ILlmApplication.IOptions.separate} property. The separated parameters are
|
|
29
29
|
* assigned to the {@link ILlmFunction.separated} property.
|
|
@@ -31,7 +31,7 @@ import { ILlmFunctionOfValidate } from "./ILlmFunctionOfValidate";
|
|
|
31
31
|
* For reference, when both LLM and Human filled parameter values to call, you can
|
|
32
32
|
* merge them by calling the {@link HttpLlm.mergeParameters} function. In other words,
|
|
33
33
|
* if you've configured the {@link ILlmApplication.IOptions.separate} property, you
|
|
34
|
-
* have to merge the separated parameters before the
|
|
34
|
+
* have to merge the separated parameters before the function call execution.
|
|
35
35
|
*
|
|
36
36
|
* @reference https://platform.openai.com/docs/guides/function-calling
|
|
37
37
|
* @author Jeongho Nam - https://github.com/samchon
|
package/src/tags/TagBase.ts
CHANGED
|
@@ -57,7 +57,7 @@ export namespace TagBase {
|
|
|
57
57
|
* `$input` would be transformed to the suitable when compilation.
|
|
58
58
|
*
|
|
59
59
|
* Also, If you've take a mistake on this script, compile error would be
|
|
60
|
-
*
|
|
60
|
+
* occurred. So, define it with confidence. Compiler will block all your
|
|
61
61
|
* mistakes.
|
|
62
62
|
*/
|
|
63
63
|
validate?: Validate;
|
|
@@ -75,7 +75,7 @@ export namespace ImportTransformer {
|
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
const get_directory_path = (file: string): string => {
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
return path.resolve(
|
|
78
|
+
const split: string[] = path.resolve(file).split(path.sep);
|
|
79
|
+
split.pop();
|
|
80
|
+
return path.resolve(split.join(path.sep));
|
|
81
81
|
};
|
|
@@ -7,7 +7,7 @@ export namespace JsonValidateParseTransformer {
|
|
|
7
7
|
export const transform = (props: ITransformProps) =>
|
|
8
8
|
GenericTransformer.scalar({
|
|
9
9
|
...props,
|
|
10
|
-
method: "json.
|
|
10
|
+
method: "json.validateParse",
|
|
11
11
|
write: JsonValidateParseProgrammer.write,
|
|
12
12
|
});
|
|
13
13
|
}
|
|
@@ -7,7 +7,7 @@ export namespace JsonValidateStringifyTransformer {
|
|
|
7
7
|
export const transform = (props: ITransformProps) =>
|
|
8
8
|
GenericTransformer.scalar({
|
|
9
9
|
...props,
|
|
10
|
-
method: "json.
|
|
10
|
+
method: "json.validateStringify",
|
|
11
11
|
write: JsonValidateStringifyProgrammer.write,
|
|
12
12
|
});
|
|
13
13
|
}
|
|
@@ -7,7 +7,7 @@ export namespace MiscValidateCloneTransformer {
|
|
|
7
7
|
export const transform = (props: ITransformProps) =>
|
|
8
8
|
GenericTransformer.scalar({
|
|
9
9
|
...props,
|
|
10
|
-
method: "misc.
|
|
10
|
+
method: "misc.validateClone",
|
|
11
11
|
write: MiscValidateCloneProgrammer.write,
|
|
12
12
|
});
|
|
13
13
|
}
|
|
@@ -7,7 +7,7 @@ export namespace MiscValidatePruneTransformer {
|
|
|
7
7
|
export const transform = (props: ITransformProps) =>
|
|
8
8
|
GenericTransformer.scalar({
|
|
9
9
|
...props,
|
|
10
|
-
method: "misc.
|
|
10
|
+
method: "misc.validatePrune",
|
|
11
11
|
write: MiscValidatePruneProgrammer.write,
|
|
12
12
|
});
|
|
13
13
|
}
|
|
@@ -26,7 +26,7 @@ export namespace ReflectNameTransformer {
|
|
|
26
26
|
const second: ts.Node | undefined = props.expression.typeArguments[1]!;
|
|
27
27
|
if (second === undefined) return false;
|
|
28
28
|
|
|
29
|
-
// GET
|
|
29
|
+
// GET BOOLEAN VALUE
|
|
30
30
|
const value: Metadata = getMetadata({
|
|
31
31
|
context: props.context,
|
|
32
32
|
node: second,
|