HTTP controller.

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

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

Type Parameters

  • Model extends ILlmSchema.Model

Hierarchy

  • IBase<"http", IHttpLlmApplication<Model>>
    • 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<Model>;
        arguments: object;
        connection: IHttpConnection;
        function: IHttpLlmFunction<Model>;
    },
) => Promise<IHttpResponse>

Executor of the API function.

Type declaration

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

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

        Properties of the API function call

        • application: IHttpLlmApplication<Model>

          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<Model>

          Function schema.

      Returns Promise<IHttpResponse>

      HTTP response of the API function call

name: string

Name of the controller.

protocol: "http"

Protocol discrminator.