Praman — AI-First SAP UI5 Test Automation Platform - v1.0.1
    Preparing search index...

    Type Alias AiResponse<T>

    AiResponse:
        | { data: T; metadata: AiResponseMetadata; status: "success" }
        | {
            data: undefined;
            error: AiResponseError;
            metadata: AiResponseMetadata;
            status: "error";
        }
        | {
            data: Partial<T>;
            error?: AiResponseError;
            metadata: AiResponseMetadata;
            status: "partial";
        }

    Discriminated union AI response envelope on status.

    Type Parameters

    • T

    Narrow on status to get type-safe access to data and error:

    • 'success'data is T, no error
    • 'error'data is undefined, error is populated
    • 'partial'data is Partial<T>, optional error

    Provide type-safe AI result handling without casting.

    function handle<T>(response: AiResponse<T>): T | undefined {
    if (response.status === 'success') {
    return response.data; // T
    }
    return undefined;
    }