Cell API
    Preparing search index...

    Interface StreamingModel<TReq, TResChunk>

    The StreamingModel interface provides a generic API for invoking an AI models with streaming response. It abstracts the process of sending requests and receiving a streaming responses. The interface uses Java generics to accommodate different types of requests and responses, enhancing flexibility and adaptability across different AI model implementations.

    interface StreamingModel<
        TReq extends ModelRequest<any>,
        TResChunk extends ModelResponse<any>,
    > {
        stream(request: TReq): Promise<Observable<TResChunk>>;
    }

    Type Parameters

    • TReq extends ModelRequest<any>

      the generic type of the request to the AI model

    • TResChunk extends ModelResponse<any>

      the generic type of a single item in the streaming 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<Observable<TResChunk>>

      the streaming response from the AI model