typia 10.0.2 → 11.0.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.
Files changed (86) hide show
  1. package/README.md +14 -10
  2. package/lib/factories/internal/metadata/emplace_metadata_object.js +11 -1
  3. package/lib/factories/internal/metadata/emplace_metadata_object.js.map +1 -1
  4. package/lib/factories/internal/metadata/emplace_metadata_object.mjs +11 -0
  5. package/lib/index.mjs +2 -2
  6. package/lib/internal/_createStandardSchema.d.mts +1 -1
  7. package/lib/internal/_createStandardSchema.d.ts +1 -1
  8. package/lib/internal/_createStandardSchema.js.map +1 -1
  9. package/lib/internal/_llmApplicationFinalize.d.mts +2 -2
  10. package/lib/internal/_llmApplicationFinalize.d.ts +2 -2
  11. package/lib/internal/_llmApplicationFinalize.js +9 -10
  12. package/lib/internal/_llmApplicationFinalize.js.map +1 -1
  13. package/lib/internal/_llmApplicationFinalize.mjs +12 -13
  14. package/lib/llm.d.mts +20 -199
  15. package/lib/llm.d.ts +20 -199
  16. package/lib/llm.js.map +1 -1
  17. package/lib/misc.d.mts +3 -3
  18. package/lib/misc.d.ts +3 -3
  19. package/lib/misc.js.map +1 -1
  20. package/lib/module.d.mts +2 -2
  21. package/lib/module.d.ts +2 -2
  22. package/lib/programmers/internal/json_schema_object.js +1 -0
  23. package/lib/programmers/internal/json_schema_object.js.map +1 -1
  24. package/lib/programmers/internal/json_schema_object.mjs +1 -0
  25. package/lib/programmers/llm/LlmApplicationProgrammer.d.mts +8 -8
  26. package/lib/programmers/llm/LlmApplicationProgrammer.d.ts +8 -8
  27. package/lib/programmers/llm/LlmApplicationProgrammer.js +58 -64
  28. package/lib/programmers/llm/LlmApplicationProgrammer.js.map +1 -1
  29. package/lib/programmers/llm/LlmApplicationProgrammer.mjs +63 -68
  30. package/lib/programmers/llm/{LlmModelPredicator.d.mts → LlmMetadataFactory.d.mts} +2 -8
  31. package/lib/programmers/llm/{LlmModelPredicator.d.ts → LlmMetadataFactory.d.ts} +2 -8
  32. package/lib/programmers/llm/{LlmModelPredicator.js → LlmMetadataFactory.js} +6 -37
  33. package/lib/programmers/llm/LlmMetadataFactory.js.map +1 -0
  34. package/lib/programmers/llm/{LlmModelPredicator.mjs → LlmMetadataFactory.mjs} +6 -34
  35. package/lib/programmers/llm/LlmMetadataFactory.mjs.map +1 -0
  36. package/lib/programmers/llm/LlmParametersProgrammer.d.mts +8 -8
  37. package/lib/programmers/llm/LlmParametersProgrammer.d.ts +8 -8
  38. package/lib/programmers/llm/LlmParametersProgrammer.js +10 -10
  39. package/lib/programmers/llm/LlmParametersProgrammer.js.map +1 -1
  40. package/lib/programmers/llm/LlmParametersProgrammer.mjs +10 -13
  41. package/lib/programmers/llm/LlmSchemaProgrammer.d.mts +10 -12
  42. package/lib/programmers/llm/LlmSchemaProgrammer.d.ts +10 -12
  43. package/lib/programmers/llm/LlmSchemaProgrammer.js +21 -33
  44. package/lib/programmers/llm/LlmSchemaProgrammer.js.map +1 -1
  45. package/lib/programmers/llm/LlmSchemaProgrammer.mjs +21 -37
  46. package/lib/schemas/metadata/IMetadataProperty.d.mts +1 -0
  47. package/lib/schemas/metadata/IMetadataProperty.d.ts +1 -0
  48. package/lib/schemas/metadata/MetadataProperty.d.mts +1 -0
  49. package/lib/schemas/metadata/MetadataProperty.d.ts +1 -0
  50. package/lib/schemas/metadata/MetadataProperty.js +3 -0
  51. package/lib/schemas/metadata/MetadataProperty.js.map +1 -1
  52. package/lib/schemas/metadata/MetadataProperty.mjs +4 -0
  53. package/lib/transformers/features/llm/LlmApplicationTransformer.d.mts +0 -2
  54. package/lib/transformers/features/llm/LlmApplicationTransformer.d.ts +0 -2
  55. package/lib/transformers/features/llm/LlmApplicationTransformer.js +9 -20
  56. package/lib/transformers/features/llm/LlmApplicationTransformer.js.map +1 -1
  57. package/lib/transformers/features/llm/LlmApplicationTransformer.mjs +9 -20
  58. package/lib/transformers/features/llm/LlmControllerTransformer.js +1 -8
  59. package/lib/transformers/features/llm/LlmControllerTransformer.js.map +1 -1
  60. package/lib/transformers/features/llm/LlmControllerTransformer.mjs +1 -8
  61. package/lib/transformers/features/llm/LlmParametersTransformer.js +6 -15
  62. package/lib/transformers/features/llm/LlmParametersTransformer.js.map +1 -1
  63. package/lib/transformers/features/llm/LlmParametersTransformer.mjs +6 -15
  64. package/lib/transformers/features/llm/LlmSchemaTransformer.js +11 -26
  65. package/lib/transformers/features/llm/LlmSchemaTransformer.js.map +1 -1
  66. package/lib/transformers/features/llm/LlmSchemaTransformer.mjs +11 -26
  67. package/package.json +4 -3
  68. package/src/factories/internal/metadata/emplace_metadata_object.ts +16 -0
  69. package/src/internal/_createStandardSchema.ts +2 -2
  70. package/src/internal/_llmApplicationFinalize.ts +18 -25
  71. package/src/llm.ts +28 -221
  72. package/src/misc.ts +9 -9
  73. package/src/module.ts +2 -2
  74. package/src/programmers/internal/json_schema_object.ts +1 -0
  75. package/src/programmers/llm/LlmApplicationProgrammer.ts +139 -151
  76. package/src/programmers/llm/{LlmModelPredicator.ts → LlmMetadataFactory.ts} +4 -42
  77. package/src/programmers/llm/LlmParametersProgrammer.ts +34 -41
  78. package/src/programmers/llm/LlmSchemaProgrammer.ts +59 -98
  79. package/src/schemas/metadata/IMetadataProperty.ts +1 -0
  80. package/src/schemas/metadata/MetadataProperty.ts +4 -0
  81. package/src/transformers/features/llm/LlmApplicationTransformer.ts +14 -29
  82. package/src/transformers/features/llm/LlmControllerTransformer.ts +1 -12
  83. package/src/transformers/features/llm/LlmParametersTransformer.ts +10 -21
  84. package/src/transformers/features/llm/LlmSchemaTransformer.ts +29 -65
  85. package/lib/programmers/llm/LlmModelPredicator.js.map +0 -1
  86. package/lib/programmers/llm/LlmModelPredicator.mjs.map +0 -1
package/src/llm.ts CHANGED
@@ -36,11 +36,11 @@ import { NoTransformConfigurationError } from "./transformers/NoTransformConfigu
36
36
  * model: "gpt-4o-mini",
37
37
  * },
38
38
  * controllers: [
39
- * typia.llm.controller<ReactNativeFileSystem, "chatgpt">(
39
+ * typia.llm.controller<ReactNativeFileSystem>(
40
40
  * "filesystem",
41
41
  * new ReactNativeFileSystem(),
42
42
  * ),
43
- * typia.llm.controller<ReactNativeGallery, "chatgpt">(
43
+ * typia.llm.controller<ReactNativeGallery>(
44
44
  * "gallery",
45
45
  * new ReactNativeGallery(),
46
46
  * ),
@@ -51,44 +51,20 @@ import { NoTransformConfigurationError } from "./transformers/NoTransformConfigu
51
51
  * );
52
52
  * ```
53
53
  *
54
- * Here is the list of available `Model` types with their corresponding LLM
55
- * schema. Reading the following list, and determine the `Model` type
56
- * considering the characteristics of the target LLM provider.
57
- *
58
- * - LLM provider schemas
59
- *
60
- * - `chatgpt`:
61
- * [`IChatGptSchema`](https://samchon.github.io/openapi/api/types/IChatGptSchema-1.html)
62
- * - `claude`:
63
- * [`IClaudeSchema`](https://samchon.github.io/openapi/api/types/IClaudeSchema-1.html)
64
- * - `deepseek`:
65
- * [`IDeepSeekSchema`](https://samchon.github.io/openapi/api/types/IClaudeSchema-1.html)
66
- * - `gemini`:
67
- * [`IGeminiSchema`](https://samchon.github.io/openapi/api/types/IGeminiSchema-1.html)
68
- * - `llama`:
69
- * [`ILlamaSchema`](https://samchon.github.io/openapi/api/types/ILlamaSchema-1.html)
70
- * - Middle layer schemas
71
- *
72
- * - `3.0`: [`ILlmSchemaV3`](https://samchon.github.io/openapi/api/types/ILlmSchemaV3-1.html)
73
- * - `3.1`: [`ILlmSchemaV3_1`](https://samchon.github.io/openapi/api/types/ILlmSchemaV3_1-1.html)
74
- *
75
54
  * @author Jeongho Nam - https://github.com/samchon
76
55
  * @template Class Target class or interface type collecting the functions to
77
56
  * call
78
- * @template Model LLM schema model
79
57
  * @template Config Configuration of LLM schema composition
80
58
  * @param name Identifier name of the controller
81
59
  * @param execute Executor instance
82
- * @param options Options for the LLM application construction
60
+ * @param config Options for the LLM application construction
83
61
  * @returns Controller of LLM function calling
84
62
  * @reference https://wrtnlabs.io/agentica/docs/core/controller/typescript/
85
63
  */
86
64
  export function controller(
87
65
  name: string,
88
66
  execute: object,
89
- options?: Partial<
90
- Pick<ILlmApplication.IOptions<any, any>, "separate" | "validate">
91
- >,
67
+ config?: Partial<Pick<ILlmApplication.IConfig<any>, "separate" | "validate">>,
92
68
  ): never;
93
69
 
94
70
  /**
@@ -123,11 +99,11 @@ export function controller(
123
99
  * model: "gpt-4o-mini",
124
100
  * },
125
101
  * controllers: [
126
- * typia.llm.controller<ReactNativeFileSystem, "chatgpt">(
102
+ * typia.llm.controller<ReactNativeFileSystem>(
127
103
  * "filesystem",
128
104
  * new ReactNativeFileSystem(),
129
105
  * ),
130
- * typia.llm.controller<ReactNativeGallery, "chatgpt">(
106
+ * typia.llm.controller<ReactNativeGallery>(
131
107
  * "gallery",
132
108
  * new ReactNativeGallery(),
133
109
  * ),
@@ -138,43 +114,20 @@ export function controller(
138
114
  * );
139
115
  * ```
140
116
  *
141
- * Here is the list of available `Model` types with their corresponding LLM
142
- * schema. Reading the following list, and determine the `Model` type
143
- * considering the characteristics of the target LLM provider.
144
- *
145
- * - LLM provider schemas
146
- *
147
- * - `chatgpt`:
148
- * [`IChatGptSchema`](https://samchon.github.io/openapi/api/types/IChatGptSchema-1.html)
149
- * - `claude`:
150
- * [`IClaudeSchema`](https://samchon.github.io/openapi/api/types/IClaudeSchema-1.html)
151
- * - `deepseek`:
152
- * [`IDeepSeekSchema`](https://samchon.github.io/openapi/api/types/IClaudeSchema-1.html)
153
- * - `gemini`:
154
- * [`IGeminiSchema`](https://samchon.github.io/openapi/api/types/IGeminiSchema-1.html)
155
- * - `llama`:
156
- * [`ILlamaSchema`](https://samchon.github.io/openapi/api/types/ILlamaSchema-1.html)
157
- * - Middle layer schemas
158
- *
159
- * - `3.0`: [`ILlmSchemaV3`](https://samchon.github.io/openapi/api/types/ILlmSchemaV3-1.html)
160
- * - `3.1`: [`ILlmSchemaV3_1`](https://samchon.github.io/openapi/api/types/ILlmSchemaV3_1-1.html)
161
- *
162
117
  * @author Jeongho Nam - https://github.com/samchon
163
118
  * @template Class Target class or interface type collecting the functions to
164
119
  * call
165
- * @template Model LLM schema model
166
120
  * @template Config Configuration of LLM schema composition
167
121
  * @param name Identifier name of the controller
168
122
  * @param execute Executor instance
169
- * @param options Options for the LLM application construction
123
+ * @param config Options for the LLM application construction
170
124
  * @returns Controller of LLM function calling
171
125
  * @reference https://wrtnlabs.io/agentica/docs/core/controller/typescript/
172
126
  */
173
127
  export function controller<
174
128
  Class extends Record<string, any>,
175
- Model extends ILlmSchema.Model,
176
129
  Config extends Partial<
177
- ILlmSchema.ModelConfig[Model] & {
130
+ ILlmSchema.IConfig & {
178
131
  /**
179
132
  * Whether to disallow superfluous properties or not.
180
133
  *
@@ -190,10 +143,10 @@ export function controller<
190
143
  >(
191
144
  name: string,
192
145
  execute: Class,
193
- options?: Partial<
194
- Pick<ILlmApplication.IOptions<Model, Class>, "separate" | "validate">
146
+ config?: Partial<
147
+ Pick<ILlmApplication.IConfig<Class>, "separate" | "validate">
195
148
  >,
196
- ): ILlmController<Model>;
149
+ ): ILlmController<Class>;
197
150
 
198
151
  /** @internal */
199
152
  export function controller(..._args: any[]): never {
@@ -219,7 +172,7 @@ export function controller(..._args: any[]): never {
219
172
  * must be composed by human, not by LLM. File uploading feature or some
220
173
  * sensitive information like security keys (password) are the examples. In that
221
174
  * case, you can separate the function parameters to both LLM and human sides by
222
- * configuring the {@link ILlmApplication.IOptions.separate} property. The
175
+ * configuring the {@link ILlmApplication.IConfig.separate} property. The
223
176
  * separated parameters are assigned to the {@link ILlmFunction.separated}
224
177
  * property.
225
178
  *
@@ -229,46 +182,22 @@ export function controller(..._args: any[]): never {
229
182
  * return value to the LLM by system prompt. The LLM will continue the next
230
183
  * conversation based on the return value.
231
184
  *
232
- * Additionally, if you've configured {@link ILlmApplication.IOptions.separate},
185
+ * Additionally, if you've configured {@link ILlmApplication.IConfig.separate},
233
186
  * so that the parameters are separated to human and LLM sides, you can merge
234
187
  * these human and LLM sides' parameters into one through
235
188
  * {@link HttpLlm.mergeParameters} before the actual LLM function call
236
189
  * execution.
237
190
  *
238
- * Here is the list of available `Model` types with their corresponding LLM
239
- * schema. Reading the following list, and determine the `Model` type
240
- * considering the characteristics of the target LLM provider.
241
- *
242
- * - LLM provider schemas
243
- *
244
- * - `chatgpt`:
245
- * [`IChatGptSchema`](https://github.com/samchon/openapi/blob/master/src/structures/IChatGptSchema.ts)
246
- * - `claude`:
247
- * [`IClaudeSchema`](https://samchon.github.io/openapi/api/types/IClaudeSchema-1.html)
248
- * - `deepseek`:
249
- * [`IDeepSeekSchema`](https://samchon.github.io/openapi/api/types/IClaudeSchema-1.html)
250
- * - `gemini`:
251
- * [`IGeminiSchema`](https://samchon.github.io/openapi/api/types/IGeminiSchema-1.html)
252
- * - `llama`:
253
- * [`ILlamaSchema`](https://samchon.github.io/openapi/api/types/ILlamaSchema-1.html)
254
- * - Middle layer schemas
255
- *
256
- * - `3.0`: [`ILlmSchemaV3`](https://samchon.github.io/openapi/api/types/ILlmSchemaV3-1.html)
257
- * - `3.1`: [`ILlmSchemaV3_1`](https://samchon.github.io/openapi/api/types/ILlmSchemaV3_1-1.html)
258
- *
259
191
  * @author Jeongho Nam - https://github.com/samchon
260
192
  * @template Class Target class or interface type collecting the functions to
261
193
  * call
262
- * @template Model LLM schema model
263
194
  * @template Config Configuration of LLM schema composition
264
- * @param options Options for the LLM application construction
195
+ * @param config Options for the LLM application construction
265
196
  * @returns Application of LLM function calling schemas
266
197
  * @reference https://platform.openai.com/docs/guides/function-calling
267
198
  */
268
199
  export function application(
269
- options?: Partial<
270
- Pick<ILlmApplication.IOptions<any, any>, "separate" | "validate">
271
- >,
200
+ config?: Partial<Pick<ILlmApplication.IConfig<any>, "separate" | "validate">>,
272
201
  ): never;
273
202
 
274
203
  /**
@@ -288,7 +217,7 @@ export function application(
288
217
  * must be composed by human, not by LLM. File uploading feature or some
289
218
  * sensitive information like security keys (password) are the examples. In that
290
219
  * case, you can separate the function parameters to both LLM and human sides by
291
- * configuring the {@link ILlmApplication.IOptions.separate} property. The
220
+ * configuring the {@link ILlmApplication.IConfig.separate} property. The
292
221
  * separated parameters are assigned to the {@link ILlmFunction.separated}
293
222
  * property.
294
223
  *
@@ -298,47 +227,24 @@ export function application(
298
227
  * return value to the LLM by system prompt. The LLM will continue the next
299
228
  * conversation based on the return value.
300
229
  *
301
- * Additionally, if you've configured {@link ILlmApplication.IOptions.separate},
230
+ * Additionally, if you've configured {@link ILlmApplication.IConfig.separate},
302
231
  * so that the parameters are separated to human and LLM sides, you can merge
303
232
  * these human and LLM sides' parameters into one through
304
233
  * {@link HttpLlm.mergeParameters} before the actual LLM function call
305
234
  * execution.
306
235
  *
307
- * Here is the list of available `Model` types with their corresponding LLM
308
- * schema. Reading the following list, and determine the `Model` type
309
- * considering the characteristics of the target LLM provider.
310
- *
311
- * - LLM provider schemas
312
- *
313
- * - `chatgpt`:
314
- * [`IChatGptSchema`](https://github.com/samchon/openapi/blob/master/src/structures/IChatGptSchema.ts)
315
- * - `claude`:
316
- * [`IClaudeSchema`](https://samchon.github.io/openapi/api/types/IClaudeSchema-1.html)
317
- * - `deepseek`:
318
- * [`IDeepSeekSchema`](https://samchon.github.io/openapi/api/types/IClaudeSchema-1.html)
319
- * - `gemini`:
320
- * [`IGeminiSchema`](https://samchon.github.io/openapi/api/types/IGeminiSchema-1.html)
321
- * - `llama`:
322
- * [`ILlamaSchema`](https://samchon.github.io/openapi/api/types/ILlamaSchema-1.html)
323
- * - Middle layer schemas
324
- *
325
- * - `3.0`: [`ILlmSchemaV3`](https://samchon.github.io/openapi/api/types/ILlmSchemaV3-1.html)
326
- * - `3.1`: [`ILlmSchemaV3_1`](https://samchon.github.io/openapi/api/types/ILlmSchemaV3_1-1.html)
327
- *
328
236
  * @author Jeongho Nam - https://github.com/samchon
329
237
  * @template Class Target class or interface type collecting the functions to
330
238
  * call
331
- * @template Model LLM schema model
332
239
  * @template Config Configuration of LLM schema composition
333
- * @param options Options for the LLM application construction
240
+ * @param config Options for the LLM application construction
334
241
  * @returns Application of LLM function calling schemas
335
242
  * @reference https://platform.openai.com/docs/guides/function-calling
336
243
  */
337
244
  export function application<
338
245
  Class extends Record<string, any>,
339
- Model extends ILlmSchema.Model,
340
246
  Config extends Partial<
341
- {
247
+ ILlmSchema.IConfig & {
342
248
  /**
343
249
  * Whether to disallow superfluous properties or not.
344
250
  *
@@ -349,13 +255,13 @@ export function application<
349
255
  * @default false
350
256
  */
351
257
  equals: boolean;
352
- } & ILlmSchema.ModelConfig[Model]
258
+ }
353
259
  > = {},
354
260
  >(
355
- options?: Partial<
356
- Pick<ILlmApplication.IOptions<Model, Class>, "separate" | "validate">
261
+ config?: Partial<
262
+ Pick<ILlmApplication.IConfig<Class>, "separate" | "validate">
357
263
  >,
358
- ): ILlmApplication<Model, Class>;
264
+ ): ILlmApplication<Class>;
359
265
 
360
266
  /** @internal */
361
267
  export function application(): never {
@@ -385,29 +291,7 @@ export function application(): never {
385
291
  * output, not only a plain text, by filling the parameters from the
386
292
  * conversation (maybe chatting text) with user (human).
387
293
  *
388
- * Here is the list of available `Model` types with their corresponding LLM
389
- * schema. Reading the following list, and determine the `Model` type
390
- * considering the characteristics of the target LLM provider.
391
- *
392
- * - LLM provider schemas
393
- *
394
- * - `chatgpt`:
395
- * [`IChatGptSchema`](https://github.com/samchon/openapi/blob/master/src/structures/IChatGptSchema.ts)
396
- * - `claude`:
397
- * [`IClaudeSchema`](https://samchon.github.io/openapi/api/types/IClaudeSchema-1.html)
398
- * - `deepseek`:
399
- * [`IDeepSeekSchema`](https://samchon.github.io/openapi/api/types/IClaudeSchema-1.html)
400
- * - `gemini`:
401
- * [`IGeminiSchema`](https://samchon.github.io/openapi/api/types/IGeminiSchema-1.html)
402
- * - `llama`:
403
- * [`ILlamaSchema`](https://samchon.github.io/openapi/api/types/ILlamaSchema-1.html)
404
- * - Middle layer schemas
405
- *
406
- * - `3.0`: [`ILlmSchemaV3`](https://samchon.github.io/openapi/api/types/ILlmSchemaV3-1.html)
407
- * - `3.1`: [`ILlmSchemaV3_1`](https://samchon.github.io/openapi/api/types/ILlmSchemaV3_1-1.html)
408
- *
409
294
  * @template Parameters Target parameters type
410
- * @template Model LLM schema model
411
295
  * @template Config Configuration of LLM schema composition
412
296
  * @returns LLM parameters schema
413
297
  * @reference https://platform.openai.com/docs/guides/function-calling
@@ -436,29 +320,7 @@ export function parameters(): never;
436
320
  * output, not only a plain text, by filling the parameters from the
437
321
  * conversation (maybe chatting text) with user (human).
438
322
  *
439
- * Here is the list of available `Model` types with their corresponding LLM
440
- * schema. Reading the following list, and determine the `Model` type
441
- * considering the characteristics of the target LLM provider.
442
- *
443
- * - LLM provider schemas
444
- *
445
- * - `chatgpt`:
446
- * [`IChatGptSchema`](https://github.com/samchon/openapi/blob/master/src/structures/IChatGptSchema.ts)
447
- * - `claude`:
448
- * [`IClaudeSchema`](https://samchon.github.io/openapi/api/types/IClaudeSchema-1.html)
449
- * - `deepseek`:
450
- * [`IDeepSeekSchema`](https://samchon.github.io/openapi/api/types/IClaudeSchema-1.html)
451
- * - `gemini`:
452
- * [`IGeminiSchema`](https://samchon.github.io/openapi/api/types/IGeminiSchema-1.html)
453
- * - `llama`:
454
- * [`ILlamaSchema`](https://samchon.github.io/openapi/api/types/ILlamaSchema-1.html)
455
- * - Middle layer schemas
456
- *
457
- * - `3.0`: [`ILlmSchemaV3`](https://samchon.github.io/openapi/api/types/ILlmSchemaV3-1.html)
458
- * - `3.1`: [`ILlmSchemaV3_1`](https://samchon.github.io/openapi/api/types/ILlmSchemaV3_1-1.html)
459
- *
460
323
  * @template Parameters Target parameters type
461
- * @template Model LLM schema model
462
324
  * @template Config Configuration of LLM schema composition
463
325
  * @returns LLM parameters schema
464
326
  * @reference https://platform.openai.com/docs/guides/function-calling
@@ -466,9 +328,8 @@ export function parameters(): never;
466
328
  */
467
329
  export function parameters<
468
330
  Parameters extends Record<string, any>,
469
- Model extends ILlmSchema.Model,
470
- Config extends Partial<ILlmSchema.ModelConfig[Model]> = {},
471
- >(): ILlmSchema.ModelParameters[Model];
331
+ Config extends Partial<ILlmSchema.IConfig> = {},
332
+ >(): ILlmSchema.IParameters;
472
333
 
473
334
  /** @internal */
474
335
  export function parameters(): never {
@@ -485,28 +346,6 @@ export function parameters(): never {
485
346
  * https://platform.openai.com/docs/guides/function-calling), from a TypeScript
486
347
  * type.
487
348
  *
488
- * The returned {@link ILlmSchema} type will be specified by the `Model`
489
- * argument, and here is the list of available `Model` types with their
490
- * corresponding LLM schema. Reading the following list, and determine the
491
- * `Model` type considering the characteristics of the target LLM provider.
492
- *
493
- * - LLM provider schemas
494
- *
495
- * - `chatgpt`:
496
- * [`IChatGptSchema`](https://github.com/samchon/openapi/blob/master/src/structures/IChatGptSchema.ts)
497
- * - `claude`:
498
- * [`IClaudeSchema`](https://samchon.github.io/openapi/api/types/IClaudeSchema-1.html)
499
- * - `deepseek`:
500
- * [`IDeepSeekSchema`](https://samchon.github.io/openapi/api/types/IClaudeSchema-1.html)
501
- * - `gemini`:
502
- * [`IGeminiSchema`](https://samchon.github.io/openapi/api/types/IGeminiSchema-1.html)
503
- * - `llama`:
504
- * [`ILlamaSchema`](https://samchon.github.io/openapi/api/types/ILlamaSchema-1.html)
505
- * - Middle layer schemas
506
- *
507
- * - `3.0`: [`ILlmSchemaV3`](https://samchon.github.io/openapi/api/types/ILlmSchemaV3-1.html)
508
- * - `3.1`: [`ILlmSchemaV3_1`](https://samchon.github.io/openapi/api/types/ILlmSchemaV3_1-1.html)
509
- *
510
349
  * If you actually want to perform the LLM function calling with TypeScript
511
350
  * functions, you can do it with the {@link application} function. Otherwise you
512
351
  * hope to perform the structured output, {@link parameters} function is better.
@@ -530,7 +369,6 @@ export function parameters(): never {
530
369
  *
531
370
  * @author Jeongho Nam - https://github.com/samchon
532
371
  * @template T Target type
533
- * @template Model LLM schema model
534
372
  * @template Config Configuration of LLM schema composition
535
373
  * @returns LLM schema
536
374
  * @reference https://platform.openai.com/docs/guides/function-calling
@@ -546,27 +384,6 @@ export function schema(): never;
546
384
  * https://platform.openai.com/docs/guides/function-calling), from a TypeScript
547
385
  * type.
548
386
  *
549
- * The returned {@link ILlmSchema} type will be specified by the `Model`
550
- * argument, and here is the list of available `Model` types with their
551
- * corresponding LLM schema:
552
- *
553
- * - LLM provider schemas
554
- *
555
- * - `chatgpt`:
556
- * [`IChatGptSchema`](https://github.com/samchon/openapi/blob/master/src/structures/IChatGptSchema.ts)
557
- * - `claude`:
558
- * [`IClaudeSchema`](https://samchon.github.io/openapi/api/types/IClaudeSchema-1.html)
559
- * - `deepseek`:
560
- * [`IDeepSeekSchema`](https://samchon.github.io/openapi/api/types/IClaudeSchema-1.html)
561
- * - `gemini`:
562
- * [`IGeminiSchema`](https://samchon.github.io/openapi/api/types/IGeminiSchema-1.html)
563
- * - `llama`:
564
- * [`ILlamaSchema`](https://samchon.github.io/openapi/api/types/ILlamaSchema-1.html)
565
- * - Middle layer schemas
566
- *
567
- * - `3.0`: [`ILlmSchemaV3`](https://samchon.github.io/openapi/api/types/ILlmSchemaV3-1.html)
568
- * - `3.1`: [`ILlmSchemaV3_1`](https://samchon.github.io/openapi/api/types/ILlmSchemaV3_1-1.html)
569
- *
570
387
  * If you actually want to perform the LLM function calling with TypeScript
571
388
  * functions, you can do it with the {@link application} function. Otherwise you
572
389
  * hope to perform the structured output, {@link parameters} function is better.
@@ -590,24 +407,14 @@ export function schema(): never;
590
407
  *
591
408
  * @author Jeongho Nam - https://github.com/samchon
592
409
  * @template T Target type
593
- * @template Model LLM schema model
594
410
  * @template Config Configuration of LLM schema composition
595
411
  * @returns LLM schema
596
412
  * @reference https://platform.openai.com/docs/guides/function-calling
597
413
  * @reference https://platform.openai.com/docs/guides/structured-outputs
598
414
  */
599
- export function schema<
600
- T,
601
- Model extends ILlmSchema.Model,
602
- Config extends Partial<ILlmSchema.ModelConfig[Model]> = {},
603
- >(
604
- ...$defs: Extract<
605
- ILlmSchema.ModelSchema[Model],
606
- { $ref: string }
607
- > extends never
608
- ? []
609
- : [Record<string, ILlmSchema.ModelSchema[Model]>]
610
- ): ILlmSchema.ModelSchema[Model];
415
+ export function schema<T, Config extends Partial<ILlmSchema.IConfig> = {}>(
416
+ $defs: Record<string, ILlmSchema>,
417
+ ): ILlmSchema;
611
418
 
612
419
  /** @internal */
613
420
  export function schema(): never {
package/src/misc.ts CHANGED
@@ -507,7 +507,7 @@ export function createPrune(): never;
507
507
  export function createPrune<T extends object>(): (input: T) => void;
508
508
 
509
509
  /** @internal */
510
- export function createPrune<T extends object>(): (input: T) => void {
510
+ export function createPrune(): never {
511
511
  NoTransformConfigurationError("misc.createPrune");
512
512
  }
513
513
 
@@ -534,10 +534,10 @@ export function createAssertPrune(
534
534
  */
535
535
  export function createAssertPrune<T extends object>(
536
536
  errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
537
- ): (input: T) => T;
537
+ ): (input: unknown) => T;
538
538
 
539
539
  /** @internal */
540
- export function createAssertPrune<T extends object>(): (input: T) => T {
540
+ export function createAssertPrune(): never {
541
541
  NoTransformConfigurationError("misc.createAssertPrune");
542
542
  }
543
543
 
@@ -558,10 +558,12 @@ export function createIsPrune(): never;
558
558
  * @template T Type of the input value
559
559
  * @returns A reusable `isPrune` function
560
560
  */
561
- export function createIsPrune<T extends object>(): (input: T) => input is T;
561
+ export function createIsPrune<T extends object>(): (
562
+ input: unknown,
563
+ ) => input is T;
562
564
 
563
565
  /** @internal */
564
- export function createIsPrune<T extends object>(): (input: T) => input is T {
566
+ export function createIsPrune(): never {
565
567
  NoTransformConfigurationError("misc.createIsPrune");
566
568
  }
567
569
 
@@ -583,12 +585,10 @@ export function createValidatePrune(): never;
583
585
  * @returns A reusable `validatePrune` function
584
586
  */
585
587
  export function createValidatePrune<T extends object>(): (
586
- input: T,
588
+ input: unknown,
587
589
  ) => IValidation<T>;
588
590
 
589
591
  /** @internal */
590
- export function createValidatePrune<T extends object>(): (
591
- input: T,
592
- ) => IValidation<T> {
592
+ export function createValidatePrune(): never {
593
593
  NoTransformConfigurationError("misc.createValidatePrune");
594
594
  }
package/src/module.ts CHANGED
@@ -708,7 +708,7 @@ export function createValidate(): never;
708
708
  * @returns A reusable `validate` function
709
709
  */
710
710
  export function createValidate<T>(): ((input: unknown) => IValidation<T>) &
711
- StandardSchemaV1<unknown, T>;
711
+ StandardSchemaV1<T, T>;
712
712
 
713
713
  /** @internal */
714
714
  export function createValidate(): ((input: unknown) => IValidation) &
@@ -852,7 +852,7 @@ export function createValidateEquals(): never;
852
852
  export function createValidateEquals<T>(): ((
853
853
  input: unknown,
854
854
  ) => IValidation<T>) &
855
- StandardSchemaV1<unknown, T>;
855
+ StandardSchemaV1<T, T>;
856
856
 
857
857
  /** @internal */
858
858
  export function createValidateEquals(): ((input: unknown) => IValidation) &
@@ -76,6 +76,7 @@ const create_object_schema = (props: {
76
76
  undefined,
77
77
  title: json_schema_title(property),
78
78
  description: json_schema_description(property),
79
+ readOnly: property.mutability === "readonly" ? true : undefined,
79
80
  },
80
81
  metadata: property.value,
81
82
  });