Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typia.llm.application<App>() for asynchronous methods. #1286

Merged
merged 1 commit into from
Sep 19, 2024

Conversation

samchon
Copy link
Owner

@samchon samchon commented Sep 19, 2024

When asynchrounouse member method comes, typia.llm.application<App>() had composed the ILlmFunction.output as any type.

This PR fixes the problem. As such reason, you should upgrade to 6.10.1 @ryoppippi.

TypeScript Source File

import typia from "typia";

interface Something<T> {
  add(x: number, y: number): Promise<number>;
  plus(x: T, y: T): T;
  asyncPlus(x: T, y: T): Promise<T>;
}

typia.llm.application<Something<number>>();

JavaScript Compiled File

({
  functions: [
    {
      name: "add",
      parameters: [
        {
          type: "number",
        },
        {
          type: "number",
        },
      ],
      output: {},
    },
    {
      name: "plus",
      parameters: [
        {
          type: "number",
        },
        {
          type: "number",
        },
      ],
      output: {
        type: "number",
      },
    },
    {
      name: "asyncPlus",
      parameters: [
        {
          type: "number",
        },
        {
          type: "number",
        },
      ],
      output: {},
    },
  ],
  options: {
    separate: null,
  },
});

When asynchrounouse member method comes, `typia.llm.application<App>()` had composed the `ILlmFunction.output` as `any` type.

This PR fixes the problem.
@samchon samchon added bug Something isn't working enhancement New feature or request labels Sep 19, 2024
@samchon samchon self-assigned this Sep 19, 2024
Copy link

pkg-pr-new bot commented Sep 19, 2024

Open in Stackblitz

npm i https://pkg.pr.new/typia@1286

commit: 98ceffb

Copy link
Owner Author

@samchon samchon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Completed

@samchon samchon merged commit edc67e4 into master Sep 19, 2024
11 checks passed
@samchon samchon deleted the feature/llm branch September 19, 2024 05:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant