Cell API
    Preparing search index...

    Interface Model<TReq, TRes>

    The Model interface provides a generic API for invoking AI models. It is designed to handle the interaction with various types of AI models by abstracting the process of sending requests and receiving responses. The interface uses Java generics to accommodate different types of requests and responses, enhancing flexibility and adaptability across different AI model implementations.

    interface Model<TReq extends ModelRequest<any>, TRes extends ModelResponse<any>> {
        call(request: TReq): Promise<TRes>;
    }

    Type Parameters

    • TReq extends ModelRequest<any>

      the generic type of the request to the AI model

    • TRes extends ModelResponse<any>

      the generic type of the response from the AI model

    Hierarchy (View Summary)

    Index
    • Executes a method call to the AI model.

      Parameters

      • request: TReq

        the request object to be sent to the AI model

      Returns Promise<TRes>

      the response from the AI model