typia 7.0.0-dev.20241115 → 7.0.0-dev.20241123

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 (28) hide show
  1. package/README.md +3 -3
  2. package/lib/executable/TypiaSetupWizard.js +1 -1
  3. package/lib/executable/TypiaSetupWizard.js.map +1 -1
  4. package/lib/index.mjs.map +1 -1
  5. package/lib/internal/_llmApplicationFinalize.d.ts +1 -1
  6. package/lib/internal/_llmApplicationFinalize.js +14 -6
  7. package/lib/internal/_llmApplicationFinalize.js.map +1 -1
  8. package/lib/llm.d.ts +4 -3
  9. package/lib/programmers/internal/json_schema_native.js +1 -0
  10. package/lib/programmers/internal/json_schema_native.js.map +1 -1
  11. package/lib/programmers/internal/json_schema_object.js +1 -1
  12. package/lib/programmers/internal/json_schema_object.js.map +1 -1
  13. package/lib/programmers/llm/LlmApplicationProgrammer.js +149 -104
  14. package/lib/programmers/llm/LlmApplicationProgrammer.js.map +1 -1
  15. package/lib/programmers/llm/LlmSchemaProgrammer.d.ts +7 -2
  16. package/lib/programmers/llm/LlmSchemaProgrammer.js +42 -12
  17. package/lib/programmers/llm/LlmSchemaProgrammer.js.map +1 -1
  18. package/lib/transformers/features/llm/LlmSchemaTransformer.js +13 -2
  19. package/lib/transformers/features/llm/LlmSchemaTransformer.js.map +1 -1
  20. package/package.json +37 -36
  21. package/src/executable/TypiaSetupWizard.ts +1 -1
  22. package/src/internal/_llmApplicationFinalize.ts +25 -6
  23. package/src/llm.ts +6 -6
  24. package/src/programmers/internal/json_schema_native.ts +1 -0
  25. package/src/programmers/internal/json_schema_object.ts +1 -1
  26. package/src/programmers/llm/LlmApplicationProgrammer.ts +175 -155
  27. package/src/programmers/llm/LlmSchemaProgrammer.ts +88 -17
  28. package/src/transformers/features/llm/LlmSchemaTransformer.ts +40 -6
@@ -1,13 +1,18 @@
1
- import { ILlmApplication } from "@samchon/openapi";
1
+ import { IChatGptSchema, ILlmApplication, OpenApi } from "@samchon/openapi";
2
+ import { ChatGptConverter } from "@samchon/openapi/lib/converters/ChatGptConverter";
3
+ import { GeminiConverter } from "@samchon/openapi/lib/converters/GeminiConverter";
4
+ import { LlmConverterV3 } from "@samchon/openapi/lib/converters/LlmConverterV3";
5
+ import { LlmConverterV3_1 } from "@samchon/openapi/lib/converters/LlmConverterV3_1";
2
6
  import { ILlmFunction } from "@samchon/openapi/lib/structures/ILlmFunction";
3
7
 
4
8
  import { MetadataFactory } from "../../factories/MetadataFactory";
5
9
 
6
- import { IJsDocTagInfo } from "../../schemas/metadata/IJsDocTagInfo";
7
10
  import { Metadata } from "../../schemas/metadata/Metadata";
8
11
  import { MetadataFunction } from "../../schemas/metadata/MetadataFunction";
9
12
  import { MetadataObjectType } from "../../schemas/metadata/MetadataObjectType";
10
13
 
14
+ import { IJsonApplication } from "../../module";
15
+ import { JsonApplicationProgrammer } from "../json/JsonApplicationProgrammer";
11
16
  import { LlmSchemaProgrammer } from "./LlmSchemaProgrammer";
12
17
 
13
18
  export namespace LlmApplicationProgrammer {
@@ -101,175 +106,190 @@ export namespace LlmApplicationProgrammer {
101
106
  if (errors.length)
102
107
  throw new Error("Failed to write LLM application: " + errors.join("\n"));
103
108
 
104
- const object: MetadataObjectType = props.metadata.objects[0]!.type;
109
+ const application: IJsonApplication<"3.1"> =
110
+ JsonApplicationProgrammer.write({
111
+ version: "3.1",
112
+ metadata: props.metadata,
113
+ });
105
114
  return {
106
115
  model: props.model,
107
- functions: object.properties
108
- .filter(
109
- (p) =>
110
- p.value.functions.length === 1 &&
111
- p.value.size() === 1 &&
112
- p.key.isSoleLiteral(),
113
- )
114
- .filter(
115
- (p) => p.jsDocTags.find((tag) => tag.name === "hidden") === undefined,
116
- )
117
- .map((p) =>
118
- writeFunction({
119
- model: props.model,
120
- name: p.key.getSoleLiteral()!,
121
- function: p.value.functions[0]!,
122
- description: p.description,
123
- jsDocTags: p.jsDocTags,
124
- }),
125
- ),
126
- options: {
127
- separate: null,
128
- recursive: props.model === "chatgpt" ? undefined : (3 as any),
129
- },
130
- };
131
- };
132
-
133
- const writeFunction = <Model extends ILlmApplication.Model>(props: {
134
- model: Model;
135
- name: string;
136
- function: MetadataFunction;
137
- description: string | null;
138
- jsDocTags: IJsDocTagInfo[];
139
- }): ILlmFunction<ILlmApplication.ModelSchema[Model]> => {
140
- const deprecated: boolean = props.jsDocTags.some(
141
- (tag) => tag.name === "deprecated",
142
- );
143
- const tags: string[] = props.jsDocTags
144
- .map((tag) =>
145
- tag.name === "tag"
146
- ? (tag.text?.filter((elem) => elem.kind === "text") ?? [])
147
- : [],
148
- )
149
- .flat()
150
- .map((elem) => elem.text)
151
- .map((str) => str.trim().split(" ")[0] ?? "")
152
- .filter((str) => !!str.length);
153
- return {
154
- name: props.name,
155
- parameters: props.function.parameters.map((p) => {
156
- const jsDocTagDescription: string | null = writeDescriptionFromJsDocTag(
157
- {
158
- jsDocTags: p.jsDocTags,
159
- name: "param",
160
- parameter: p.name,
161
- },
162
- );
163
- return writeSchema({
116
+ functions: application.functions.map((func) =>
117
+ writeFunction({
164
118
  model: props.model,
165
- metadata: p.type,
166
- description: jsDocTagDescription ?? p.description,
167
- jsDocTags: jsDocTagDescription ? [] : p.jsDocTags,
168
- });
169
- }),
170
- output:
171
- props.function.output.size() || props.function.output.nullable
172
- ? writeSchema({
173
- model: props.model,
174
- metadata: props.function.output,
175
- description:
176
- writeDescriptionFromJsDocTag({
177
- jsDocTags: props.jsDocTags,
178
- name: "return",
179
- }) ??
180
- writeDescriptionFromJsDocTag({
181
- jsDocTags: props.jsDocTags,
182
- name: "returns",
183
- }),
184
- jsDocTags: [],
185
- })
186
- : undefined,
187
- description: props.description ?? undefined,
188
- deprecated: deprecated || undefined,
189
- tags: tags.length ? tags : undefined,
119
+ components: application.components,
120
+ function: func,
121
+ }),
122
+ ),
123
+ options: (props.model === "chatgpt"
124
+ ? ({
125
+ separate: null,
126
+ reference: false,
127
+ constraint: false,
128
+ } satisfies ILlmApplication.IOptions<"chatgpt">)
129
+ : ({
130
+ separate: null,
131
+ recursive: props.model === "chatgpt" ? undefined : (3 as any),
132
+ } satisfies ILlmApplication.ICommonOptions<
133
+ Exclude<Model, "chatgpt">
134
+ >)) as ILlmApplication.IOptions<Model>,
190
135
  };
191
136
  };
192
137
 
193
- const writeSchema = <Model extends ILlmApplication.Model>(props: {
138
+ const writeFunction = <Model extends ILlmApplication.Model>(props: {
194
139
  model: Model;
195
- metadata: Metadata;
196
- description: string | null;
197
- jsDocTags: IJsDocTagInfo[];
198
- }): ILlmApplication.ModelSchema[Model] => {
199
- const schema: ILlmApplication.ModelSchema[Model] =
200
- LlmSchemaProgrammer.write(props);
201
- const explicit: Pick<
202
- ILlmApplication.ModelSchema[Model],
203
- "title" | "description"
204
- > = writeDescription({
140
+ components: OpenApi.IComponents;
141
+ function: IJsonApplication.IFunction<OpenApi.IJsonSchema>;
142
+ }): ILlmFunction<ILlmApplication.ModelParameters[Model]> => {
143
+ const parameters: ILlmApplication.ModelParameters[Model] =
144
+ writeParameters(props);
145
+ const output: ILlmApplication.ModelSchema[Model] | null = writeOutput({
205
146
  model: props.model,
206
- description: props.description,
207
- jsDocTags: props.jsDocTags,
147
+ parameters,
148
+ components: props.components,
149
+ schema: props.function.output?.schema ?? null,
208
150
  });
151
+ if (
152
+ output &&
153
+ output.description === undefined &&
154
+ !!props.function.output?.description?.length
155
+ )
156
+ output.description = props.function.output.description;
209
157
  return {
210
- ...schema,
211
- ...(!!explicit.title?.length || !!explicit.description?.length
212
- ? explicit
213
- : {}),
158
+ name: props.function.name,
159
+ parameters,
160
+ output: (output ?? undefined) as
161
+ | ILlmApplication.ModelParameters[Model]["properties"][string]
162
+ | undefined,
163
+ description: (() => {
164
+ if (
165
+ !props.function.summary?.length ||
166
+ !props.function.description?.length
167
+ )
168
+ return props.function.summary || props.function.description;
169
+ const summary: string = props.function.summary.endsWith(".")
170
+ ? props.function.summary.slice(0, -1)
171
+ : props.function.summary;
172
+ return props.function.description.startsWith(summary)
173
+ ? props.function.description
174
+ : summary + ".\n\n" + props.function.description;
175
+ })(),
176
+ deprecated: props.function.deprecated,
177
+ tags: props.function.tags,
178
+ strict: true,
214
179
  };
215
180
  };
216
181
 
217
- const writeDescription = <Model extends ILlmApplication.Model>(props: {
182
+ const writeParameters = <Model extends ILlmApplication.Model>(props: {
218
183
  model: Model;
219
- description: string | null;
220
- jsDocTags: IJsDocTagInfo[];
221
- }): Pick<ILlmApplication.ModelSchema[Model], "title" | "description"> => {
222
- const title: string | undefined = (() => {
223
- const [explicit] = getJsDocTexts({
224
- jsDocTags: props.jsDocTags,
225
- name: "title",
226
- });
227
- if (explicit?.length) return explicit;
228
- else if (!props.description?.length) return undefined;
229
-
230
- const index: number = props.description.indexOf("\n");
231
- const top: string = (
232
- index === -1 ? props.description : props.description.substring(0, index)
233
- ).trim();
234
- return top.endsWith(".") ? top.substring(0, top.length - 1) : undefined;
184
+ components: OpenApi.IComponents;
185
+ function: IJsonApplication.IFunction<OpenApi.IJsonSchema>;
186
+ }): ILlmApplication.ModelParameters[Model] => {
187
+ const schema: OpenApi.IJsonSchema.IObject = {
188
+ type: "object",
189
+ properties: Object.fromEntries(
190
+ props.function.parameters.map((p) => [
191
+ p.name,
192
+ {
193
+ ...p.schema,
194
+ title: p.title ?? p.schema.title,
195
+ description: p.description ?? p.schema.description,
196
+ },
197
+ ]),
198
+ ),
199
+ required: props.function.parameters
200
+ .filter((p) => p.required)
201
+ .map((p) => p.name),
202
+ additionalProperties: false,
203
+ };
204
+ const parameters: ILlmApplication.ModelParameters[Model] | null = (() => {
205
+ if (props.model === "chatgpt")
206
+ return ChatGptConverter.parameters({
207
+ options: DEFAULT_CHATGPT_OPTION,
208
+ components: props.components,
209
+ schema,
210
+ });
211
+ else if (props.model === "gemini")
212
+ return GeminiConverter.parameters({
213
+ recursive: DEFAULT_V3_OPTIONS.recursive,
214
+ components: props.components,
215
+ schema,
216
+ }) as ILlmApplication.ModelParameters[Model] | null;
217
+ else if (props.model === "3.0")
218
+ return LlmConverterV3.parameters({
219
+ recursive: DEFAULT_V3_OPTIONS.recursive,
220
+ components: props.components,
221
+ schema,
222
+ }) as ILlmApplication.ModelParameters[Model] | null;
223
+ else if (props.model === "3.1")
224
+ return LlmConverterV3_1.parameters({
225
+ recursive: DEFAULT_V3_OPTIONS.recursive,
226
+ components: props.components,
227
+ schema,
228
+ }) as ILlmApplication.ModelParameters[Model] | null;
229
+ else return null;
235
230
  })();
236
- return {
237
- title: title,
238
- description: props.description?.length ? props.description : undefined,
239
- } as any;
231
+ if (parameters === null)
232
+ throw new Error("Failed to write LLM application parameters.");
233
+ return parameters;
240
234
  };
241
235
 
242
- const writeDescriptionFromJsDocTag = (props: {
243
- jsDocTags: IJsDocTagInfo[];
244
- name: string;
245
- parameter?: string;
246
- }): string | null => {
247
- const parametric: (elem: IJsDocTagInfo) => boolean = props.parameter
248
- ? (tag) =>
249
- tag.text!.find(
250
- (elem) =>
251
- elem.kind === "parameterName" && elem.text === props.parameter,
252
- ) !== undefined
253
- : () => true;
254
- const tag: IJsDocTagInfo | undefined = props.jsDocTags.find(
255
- (tag) => tag.name === props.name && tag.text && parametric(tag),
256
- );
257
- return tag && tag.text
258
- ? (tag.text.find((elem) => elem.kind === "text")?.text ?? null)
259
- : null;
236
+ const writeOutput = <Model extends ILlmApplication.Model>(props: {
237
+ model: Model;
238
+ parameters: ILlmApplication.ModelParameters[Model];
239
+ components: OpenApi.IComponents;
240
+ schema: OpenApi.IJsonSchema | null;
241
+ }): ILlmApplication.ModelSchema[Model] | null => {
242
+ if (props.schema === null) return null;
243
+ const output: ILlmApplication.ModelSchema[Model] | null = (() => {
244
+ if (props.model === "chatgpt") {
245
+ const $defs =
246
+ (props.parameters as IChatGptSchema.IParameters).$defs ?? {};
247
+ const output: IChatGptSchema | null = ChatGptConverter.schema({
248
+ options: DEFAULT_CHATGPT_OPTION,
249
+ components: props.components,
250
+ $defs,
251
+ schema: props.schema,
252
+ });
253
+ if (
254
+ output !== null &&
255
+ (props.parameters as IChatGptSchema.IParameters).$defs ===
256
+ undefined &&
257
+ Object.keys($defs).length !== 0
258
+ )
259
+ (props.parameters as IChatGptSchema.IParameters).$defs = $defs;
260
+ return output;
261
+ } else if (props.model === "gemini")
262
+ return GeminiConverter.schema({
263
+ recursive: DEFAULT_V3_OPTIONS.recursive,
264
+ components: props.components,
265
+ schema: props.schema,
266
+ }) as ILlmApplication.ModelSchema[Model] | null;
267
+ else if (props.model === "3.0")
268
+ return LlmConverterV3.schema({
269
+ recursive: DEFAULT_V3_OPTIONS.recursive,
270
+ components: props.components,
271
+ schema: props.schema,
272
+ }) as ILlmApplication.ModelSchema[Model] | null;
273
+ else if (props.model === "3.1")
274
+ return LlmConverterV3_1.schema({
275
+ recursive: DEFAULT_V3_OPTIONS.recursive,
276
+ components: props.components,
277
+ schema: props.schema,
278
+ }) as ILlmApplication.ModelSchema[Model] | null;
279
+ else return null;
280
+ })();
281
+ if (output === null)
282
+ throw new Error("Failed to write LLM application output.");
283
+ return output;
260
284
  };
261
-
262
- const getJsDocTexts = (props: {
263
- jsDocTags: IJsDocTagInfo[];
264
- name: string;
265
- }): string[] =>
266
- props.jsDocTags
267
- .filter(
268
- (tag) =>
269
- tag.name === props.name &&
270
- tag.text &&
271
- tag.text.find((elem) => elem.kind === "text" && elem.text.length) !==
272
- undefined,
273
- )
274
- .map((tag) => tag.text!.find((elem) => elem.kind === "text")!.text);
275
285
  }
286
+
287
+ const DEFAULT_CHATGPT_OPTION: ILlmApplication.IChatGptOptions = {
288
+ separate: null,
289
+ reference: false,
290
+ constraint: false,
291
+ };
292
+ const DEFAULT_V3_OPTIONS = {
293
+ separate: null,
294
+ recursive: 3,
295
+ } satisfies ILlmApplication.ICommonOptions<"3.0">;
@@ -1,5 +1,13 @@
1
- import { ILlmApplication } from "@samchon/openapi";
2
- import { HttpLlmConverter } from "@samchon/openapi/lib/converters/HttpLlmConverter";
1
+ import {
2
+ IChatGptSchema,
3
+ IHttpLlmApplication,
4
+ ILlmApplication,
5
+ OpenApi,
6
+ } from "@samchon/openapi";
7
+ import { ChatGptConverter } from "@samchon/openapi/lib/converters/ChatGptConverter";
8
+ import { GeminiConverter } from "@samchon/openapi/lib/converters/GeminiConverter";
9
+ import { LlmConverterV3 } from "@samchon/openapi/lib/converters/LlmConverterV3";
10
+ import { LlmConverterV3_1 } from "@samchon/openapi/lib/converters/LlmConverterV3_1";
3
11
 
4
12
  import { IJsonSchemaCollection } from "../../schemas/json/IJsonSchemaCollection";
5
13
  import { Metadata } from "../../schemas/metadata/Metadata";
@@ -13,25 +21,42 @@ import { json_schema_string } from "../internal/json_schema_string";
13
21
  import { JsonSchemasProgrammer } from "../json/JsonSchemasProgrammer";
14
22
 
15
23
  export namespace LlmSchemaProgrammer {
24
+ export interface IOutput<Model extends ILlmApplication.Model> {
25
+ model: Model;
26
+ schema: ILlmApplication.ModelSchema[Model];
27
+ $defs: Record<string, IChatGptSchema>;
28
+ }
16
29
  export const write = <Model extends ILlmApplication.Model>(props: {
17
30
  model: Model;
18
31
  metadata: Metadata;
19
- }): ILlmApplication.ModelSchema[Model] => {
32
+ }): IOutput<Model> => {
20
33
  const collection: IJsonSchemaCollection<"3.1"> =
21
34
  JsonSchemasProgrammer.write({
22
35
  version: "3.1",
23
36
  metadatas: [props.metadata],
24
37
  });
25
- const schema: ILlmApplication.ModelSchema[Model] | null =
26
- HttpLlmConverter.schema({
27
- model: props.model,
28
- components: collection.components,
29
- schema: collection.schemas[0]!,
38
+
39
+ const $defs: Record<string, IChatGptSchema> = {};
40
+ const schema: ILlmApplication.ModelSchema[Model] | null = CASTERS[
41
+ props.model
42
+ ]({
43
+ options: {
30
44
  recursive: 3,
31
- });
45
+ reference: false,
46
+ constraint: false,
47
+ } satisfies Omit<ILlmApplication.IChatGptOptions, "separate"> &
48
+ Omit<ILlmApplication.ICommonOptions<any>, "separate"> as any,
49
+ components: collection.components,
50
+ schema: collection.schemas[0]!,
51
+ $defs,
52
+ }) as ILlmApplication.ModelSchema[Model] | null;
32
53
  if (schema === null)
33
54
  throw new Error("Failed to convert JSON schema to LLM schema.");
34
- return schema;
55
+ return {
56
+ model: props.model,
57
+ $defs,
58
+ schema,
59
+ };
35
60
  };
36
61
 
37
62
  export const validate =
@@ -43,6 +68,14 @@ export namespace LlmSchemaProgrammer {
43
68
  metadata.constants.some((c) => c.type === "bigint")
44
69
  )
45
70
  output.push("LLM schema does not support bigint type.");
71
+ if (
72
+ metadata.objects.some((o) =>
73
+ o.type.properties.some(
74
+ (p) => p.key.isSoleLiteral() === false && p.value.size() !== 0,
75
+ ),
76
+ )
77
+ )
78
+ output.push("LLM schema does not support dynamic property in object.");
46
79
  if (
47
80
  metadata.tuples.some((t) =>
48
81
  t.type.elements.some((e) => e.isRequired() === false),
@@ -64,13 +97,6 @@ export namespace LlmSchemaProgrammer {
64
97
  output.push(`LLM schema does not support ${native.name} type.`);
65
98
  if (model === "gemini" && size(metadata) > 1)
66
99
  output.push("Gemini model does not support the union type.");
67
- // if (
68
- // metadata.aliases.some((a) => a.type.recursive) ||
69
- // metadata.arrays.some((a) => a.type.recursive) ||
70
- // metadata.objects.some((o) => o.type.recursive) ||
71
- // metadata.tuples.some((t) => t.type.recursive)
72
- // )
73
- // output.push("LLM schema does not support recursive type.");
74
100
  return output;
75
101
  };
76
102
  }
@@ -112,3 +138,48 @@ const size = (metadata: Metadata): number =>
112
138
  }).length,
113
139
  )
114
140
  .reduce((a, b) => a + b, 0);
141
+
142
+ const CASTERS = {
143
+ "3.0": (props: {
144
+ components: OpenApi.IComponents;
145
+ schema: OpenApi.IJsonSchema;
146
+ options: IHttpLlmApplication.IOptions<"3.0">;
147
+ }) =>
148
+ LlmConverterV3.schema({
149
+ components: props.components,
150
+ schema: props.schema,
151
+ recursive: props.options.recursive,
152
+ }),
153
+ "3.1": (props: {
154
+ components: OpenApi.IComponents;
155
+ schema: OpenApi.IJsonSchema;
156
+ options: IHttpLlmApplication.IOptions<"3.1">;
157
+ }) =>
158
+ LlmConverterV3_1.schema({
159
+ components: props.components,
160
+ schema: props.schema,
161
+ recursive: props.options.recursive,
162
+ }),
163
+ chatgpt: (props: {
164
+ components: OpenApi.IComponents;
165
+ schema: OpenApi.IJsonSchema;
166
+ $defs: Record<string, IChatGptSchema>;
167
+ options: Omit<IHttpLlmApplication.IChatGptOptions, "separate">;
168
+ }) =>
169
+ ChatGptConverter.schema({
170
+ components: props.components,
171
+ schema: props.schema,
172
+ $defs: props.$defs,
173
+ options: props.options,
174
+ }),
175
+ gemini: (props: {
176
+ components: OpenApi.IComponents;
177
+ schema: OpenApi.IJsonSchema;
178
+ options: IHttpLlmApplication.IOptions<"gemini">;
179
+ }) =>
180
+ GeminiConverter.schema({
181
+ components: props.components,
182
+ schema: props.schema,
183
+ recursive: props.options.recursive,
184
+ }),
185
+ };
@@ -1,6 +1,7 @@
1
1
  import { ILlmApplication } from "@samchon/openapi";
2
2
  import ts from "typescript";
3
3
 
4
+ import { IdentifierFactory } from "../../../factories/IdentifierFactory";
4
5
  import { LiteralFactory } from "../../../factories/LiteralFactory";
5
6
  import { MetadataCollection } from "../../../factories/MetadataCollection";
6
7
  import { MetadataFactory } from "../../../factories/MetadataFactory";
@@ -66,12 +67,45 @@ export namespace LlmSchemaTransformer {
66
67
  });
67
68
 
68
69
  // GENERATE LLM SCHEMA
69
- const schema: ILlmApplication.ModelSchema[ILlmApplication.Model] =
70
- LlmSchemaProgrammer.write({
71
- model,
72
- metadata: result.data,
73
- });
74
- return LiteralFactory.write(schema);
70
+ const out: LlmSchemaProgrammer.IOutput<any> = LlmSchemaProgrammer.write({
71
+ model,
72
+ metadata: result.data,
73
+ });
74
+ if (Object.keys(out.$defs).length === 0)
75
+ return LiteralFactory.write(out.schema);
76
+ return ts.factory.createCallExpression(
77
+ ts.factory.createArrowFunction(
78
+ undefined,
79
+ undefined,
80
+ [
81
+ IdentifierFactory.parameter(
82
+ "$defs",
83
+ ts.factory.createTypeReferenceNode("Record<string, unknown>"),
84
+ undefined,
85
+ ),
86
+ ],
87
+ undefined,
88
+ undefined,
89
+ ts.factory.createBlock(
90
+ [
91
+ ts.factory.createExpressionStatement(
92
+ ts.factory.createCallExpression(
93
+ ts.factory.createIdentifier("Object.assign"),
94
+ undefined,
95
+ [
96
+ ts.factory.createIdentifier("$defs"),
97
+ LiteralFactory.write(out.$defs),
98
+ ],
99
+ ),
100
+ ),
101
+ ts.factory.createReturnStatement(LiteralFactory.write(out.schema)),
102
+ ],
103
+ true,
104
+ ),
105
+ ),
106
+ undefined,
107
+ [props.expression.arguments[0]!],
108
+ );
75
109
  };
76
110
 
77
111
  const get_parameter =