• Create an HTTP controller with type validation.

    Create an IAgenticaController.IHttp instance which represents the HTTP controller from the given Swagger/OpenAPI document and the target LLM model with connection information.

    By the way, even though this validateHttpController function supports every version of Swagger/OpenAPI specification, there can be a type error in the given document. In that case, the function will return IValidation.IFailure instance with detailed type error tracing information.

    Type Parameters

    • Model extends Model

    Parameters

    • props: {
          connection: IHttpConnection;
          document: unknown;
          execute?: (
              props: {
                  application: IHttpLlmApplication<Model>;
                  arguments: object;
                  connection: IHttpConnection;
                  function: IHttpLlmFunction<Model>;
              },
          ) => Promise<IHttpResponse>;
          model: Model;
          name: string;
          options?: Partial<IOptions<Model>>;
      }

      Properties to create the HTTP controller instance

      • connection: IHttpConnection

        Connection to the server.

        Connection to the API server including the URL and headers.

      • document: unknown

        Swagger/OpenAPI document.

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

        Executor of the API function.

      • model: Model

        Target LLM model.

      • name: string

        Name of the controller.

      • Optionaloptions?: Partial<IOptions<Model>>

        Options for the LLM function calling schema composition.

    Returns IValidation<IHttp<Model>>

    Validation result of the HTTP controller composition

    Samchon