HTTP controller.

You can make it by createHttpLlmApplication function with the Swagger or OpenAPI document.

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

Hierarchy

  • IBase<"http", IHttpLlmApplication<"chatgpt">>
    • IHttp

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<"chatgpt">;
        arguments: object;
        connection: IHttpConnection;
        function: IHttpLlmFunction<"chatgpt">;
    },
) => Promise<IHttpResponse>

Executor of the API function.

Type declaration

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

      • props: {
            application: IHttpLlmApplication<"chatgpt">;
            arguments: object;
            connection: IHttpConnection;
            function: IHttpLlmFunction<"chatgpt">;
        }

        Properties of the API function call

        • application: IHttpLlmApplication<"chatgpt">

          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<"chatgpt">

          Function schema.

      Returns Promise<IHttpResponse>

      HTTP response of the API function call

name: string

Name of the controller.

protocol: "http"

Protocol discrminator.