Documentation
    Preparing search index...

    Interface IHttpLlmController

    Controller of HTTP LLM function calling.

    IHttpLlmController is a controller for registering OpenAPI operations as LLM function calling tools. It contains IHttpLlmApplication with function calling schemas, identifier, and connection to the API server.

    You can create this controller with HttpLlm.controller function, and register it to MCP server with registerMcpControllers:

    import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
    import { registerMcpControllers } from "@typia/mcp";
    import { HttpLlm } from "@typia/utils";

    const server = new McpServer({ name: "my-server", version: "1.0.0" });
    registerMcpControllers({
    server,
    controllers: [
    HttpLlm.controller({
    name: "shopping",
    document: await fetch(
    "https://shopping-be.wrtn.io/editor/swagger.json",
    ).then((r) => r.json()),
    connection: {
    host: "https://shopping-be.wrtn.io",
    headers: {
    Authorization: "Bearer ********",
    },
    },
    }),
    ],
    });

    For TypeScript class-based controller, use ILlmController instead.

    Jeongho Nam - https://github.com/samchon

    interface IHttpLlmController {
        application: IHttpLlmApplication;
        connection: IHttpConnection;
        execute?: (
            props: {
                application: IHttpLlmApplication;
                arguments: object;
                connection: IHttpConnection;
                function: IHttpLlmFunction;
            },
        ) => Promise<IHttpResponse>;
        name: string;
        protocol: "http";
    }
    Index

    Properties

    application: IHttpLlmApplication

    Application schema of function calling.

    connection: IHttpConnection

    Connection to the server.

    Connection to the API server including the URL and headers.

    execute?: (
        props: {
            application: IHttpLlmApplication;
            arguments: object;
            connection: IHttpConnection;
            function: IHttpLlmFunction;
        },
    ) => Promise<IHttpResponse>

    Executor of the API function.

    Default executor is HttpLlm.execute function, and you can override it with your own function.

    Type Declaration

      • (
            props: {
                application: IHttpLlmApplication;
                arguments: object;
                connection: IHttpConnection;
                function: IHttpLlmFunction;
            },
        ): Promise<IHttpResponse>
      • Parameters

        • props: {
              application: IHttpLlmApplication;
              arguments: object;
              connection: IHttpConnection;
              function: IHttpLlmFunction;
          }

          Properties of the API function call

          • application: IHttpLlmApplication

            Application schema.

          • arguments: object

            Arguments of the function calling.

            It is an object of key-value pairs of the API function's parameters. The property keys are composed by below rules:

            • Parameter names
            • Query parameter as an object type if exists
            • Body parameter if exists
          • connection: IHttpConnection

            Connection to the server.

          • function: IHttpLlmFunction

            Function schema.

        Returns Promise<IHttpResponse>

        HTTP response of the API function call

    name: string

    Identifier name of the controller.

    protocol: "http"

    Protocol discriminator.