diff --git a/benchmark/package.json b/benchmark/package.json index 23594100b5..1b148c327b 100644 --- a/benchmark/package.json +++ b/benchmark/package.json @@ -72,6 +72,6 @@ "suppress-warnings": "^1.0.2", "tstl": "^3.0.0", "uuid": "^9.0.1", - "typia": "../typia-6.10.3-dev.20240925.tgz" + "typia": "../typia-6.10.4-dev.20240925.tgz" } } \ No newline at end of file diff --git a/debug/package.json b/debug/package.json index aaf17c533e..5d532ea5bf 100644 --- a/debug/package.json +++ b/debug/package.json @@ -16,9 +16,8 @@ "typescript": "^5.4.2" }, "dependencies": { - "@samchon/openapi": "^1.0.5", "tstl": "^3.0.0", - "typia": "../typia-6.10.2.tgz", + "typia": "../typia-6.10.4-dev.20240925.tgz", "uuid": "^10.0.0" } } \ No newline at end of file diff --git a/debug/src/llm.ts b/debug/src/llm.ts index 9598516ee8..c11ae0280d 100644 --- a/debug/src/llm.ts +++ b/debug/src/llm.ts @@ -6,7 +6,14 @@ interface ICalculator { * @deprecated */ plus(x: number, y: number): number; + + /** + * @tag arithmetic + * @tag mathmatics + * @tag something for nothing + */ + minus(x: number, y: number): number; } const app: ILlmApplication = typia.llm.application(); -console.log(app.functions[0]?.deprecated); +console.log(app.functions[1]?.tags); diff --git a/errors/package.json b/errors/package.json index 3436ba51db..988d0631b2 100644 --- a/errors/package.json +++ b/errors/package.json @@ -32,6 +32,6 @@ "typescript": "^5.3.2" }, "dependencies": { - "typia": "../typia-6.10.3-dev.20240925.tgz" + "typia": "../typia-6.10.4-dev.20240925.tgz" } } \ No newline at end of file diff --git a/package.json b/package.json index 775bbec56a..c4af2b6589 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "typia", - "version": "6.10.3", + "version": "6.10.4", "description": "Superfast runtime validators with only one line", "main": "lib/index.js", "typings": "lib/index.d.ts", @@ -67,7 +67,7 @@ }, "homepage": "https://typia.io", "dependencies": { - "@samchon/openapi": "^1.0.5", + "@samchon/openapi": "^1.0.6", "commander": "^10.0.0", "comment-json": "^4.2.3", "inquirer": "^8.2.5", diff --git a/packages/typescript-json/package.json b/packages/typescript-json/package.json index 4949efa1c9..5d367ede84 100644 --- a/packages/typescript-json/package.json +++ b/packages/typescript-json/package.json @@ -1,6 +1,6 @@ { "name": "typescript-json", - "version": "6.10.3-dev.20240925", + "version": "6.10.4-dev.20240925", "description": "Superfast runtime validators with only one line", "main": "lib/index.js", "typings": "lib/index.d.ts", @@ -63,7 +63,7 @@ }, "homepage": "https://typia.io", "dependencies": { - "typia": "6.10.3-dev.20240925" + "typia": "6.10.4-dev.20240925" }, "peerDependencies": { "typescript": ">=4.8.0 <5.7.0" diff --git a/src/programmers/llm/LlmApplicationProgrammer.ts b/src/programmers/llm/LlmApplicationProgrammer.ts index fcddb31479..6e5801892b 100644 --- a/src/programmers/llm/LlmApplicationProgrammer.ts +++ b/src/programmers/llm/LlmApplicationProgrammer.ts @@ -104,41 +104,57 @@ export namespace LlmApplicationProgrammer { function: MetadataFunction; description: string | null; jsDocTags: IJsDocTagInfo[]; - }): ILlmFunction => ({ - name: props.name, - parameters: props.function.parameters.map((p) => { - const jsDocTagDescription = writeDescriptionFromJsDocTag({ - jsDocTags: p.jsDocTags, - tag: "param", - parameter: p.name, - }); - return writeSchema({ - metadata: p.type, - description: jsDocTagDescription ?? p.description, - jsDocTags: jsDocTagDescription ? [] : p.jsDocTags, - }); - }), - output: - props.function.output.size() || props.function.output.nullable - ? writeSchema({ - metadata: props.function.output, - description: - writeDescriptionFromJsDocTag({ - jsDocTags: props.jsDocTags, - tag: "return", - }) ?? - writeDescriptionFromJsDocTag({ - jsDocTags: props.jsDocTags, - tag: "returns", - }), - jsDocTags: [], - }) - : undefined, - description: props.description ?? undefined, - deprecated: props.jsDocTags.some((tag) => tag.name === "deprecated") - ? true - : undefined, - }); + }): ILlmFunction => { + const deprecated: boolean = props.jsDocTags.some( + (tag) => tag.name === "deprecated", + ); + const tags: string[] = props.jsDocTags + .map((tag) => + tag.name === "tag" + ? (tag.text?.filter((elem) => elem.kind === "text") ?? []) + : [], + ) + .flat() + .map((elem) => elem.text) + .map((str) => str.trim().split(" ")[0] ?? "") + .filter((str) => !!str.length); + return { + name: props.name, + parameters: props.function.parameters.map((p) => { + const jsDocTagDescription: string | null = writeDescriptionFromJsDocTag( + { + jsDocTags: p.jsDocTags, + tag: "param", + parameter: p.name, + }, + ); + return writeSchema({ + metadata: p.type, + description: jsDocTagDescription ?? p.description, + jsDocTags: jsDocTagDescription ? [] : p.jsDocTags, + }); + }), + output: + props.function.output.size() || props.function.output.nullable + ? writeSchema({ + metadata: props.function.output, + description: + writeDescriptionFromJsDocTag({ + jsDocTags: props.jsDocTags, + tag: "return", + }) ?? + writeDescriptionFromJsDocTag({ + jsDocTags: props.jsDocTags, + tag: "returns", + }), + jsDocTags: [], + }) + : undefined, + description: props.description ?? undefined, + deprecated: deprecated || undefined, + tags: tags.length ? tags : undefined, + }; + }; const writeSchema = (props: { metadata: Metadata; diff --git a/test-esm/package.json b/test-esm/package.json index d5f6b6d512..aed685e238 100644 --- a/test-esm/package.json +++ b/test-esm/package.json @@ -36,6 +36,6 @@ "typescript": "^5.4.5" }, "dependencies": { - "typia": "../typia-6.10.3-dev.20240925.tgz" + "typia": "../typia-6.10.4-dev.20240925.tgz" } } \ No newline at end of file diff --git a/test/package.json b/test/package.json index 5ea6929b01..554ba147dc 100644 --- a/test/package.json +++ b/test/package.json @@ -52,6 +52,6 @@ "suppress-warnings": "^1.0.2", "tstl": "^3.0.0", "uuid": "^9.0.1", - "typia": "../typia-6.10.3-dev.20240925.tgz" + "typia": "../typia-6.10.4-dev.20240925.tgz" } } \ No newline at end of file diff --git a/test/src/features/llm.application/test_llm_application.ts b/test/src/features/llm.application/test_llm_application.ts index 3ec15f0050..fabc105634 100644 --- a/test/src/features/llm.application/test_llm_application.ts +++ b/test/src/features/llm.application/test_llm_application.ts @@ -14,6 +14,7 @@ export const test_llm_application = (): void => { type: "string", }, description: "Get ID.", + deprecated: true, }, { name: "getValue", @@ -35,6 +36,7 @@ export const test_llm_application = (): void => { }, description: "Get value.\n\nGet value with plus operation of member value, x and y.", + tags: ["mathmatics", "arithmetic"], }, { name: "getPerformance", @@ -53,6 +55,7 @@ export const test_llm_application = (): void => { description: "The performance interface.", }, description: "Get performance.", + tags: ["monitor"], }, { name: "synchronize", @@ -81,6 +84,8 @@ class SomeClass { /** * Get ID. + * + * @deprecated */ getId = (): string => { return this.id; @@ -98,6 +103,8 @@ class SomeClass { * @returns Sum of them. * * `this.value + x + y` + * @tag mathmatics + * @tag arithmetic */ getValue(x: number, y: number): number { return this.value + x + y; @@ -105,6 +112,8 @@ class SomeClass { /** * Get performance. + * + * @tag monitor tool */ async getPerformance(): Promise { return { level: 3 };