Interface IOutlineSchema<Data, Param>

Interface representing the schema for configuring an outline operation. Defines the structure and behavior of an outline, including data generation and validation.

interface IOutlineSchema<
    Data extends IOutlineData = IOutlineData,
    Param extends IOutlineParam = IOutlineParam,
> {
    callbacks?: IOutlineCallbacks;
    docDescription?: string;
    getStructuredOutput(args: IOutlineArgs<Param>): Promise<Data>;
    maxAttempts?: number;
    outlineName: string;
    validations?: (
        IOutlineValidation<Data, Param>
        | IOutlineValidationFn<Data, Param>
    )[];
}

Type Parameters

  • Data extends IOutlineData = IOutlineData

    The type of the data param, defaults to IOutlineData.

  • Param extends IOutlineParam = IOutlineParam

    The type of the input param, defaults to IOutlineParam. IOutlineSchema

Properties

callbacks?: IOutlineCallbacks

Optional set of callbacks for outline lifecycle events. Allows customization of attempt, document, and validation handling.

docDescription?: string

Optional description for documentation purposes. Aids in understanding the purpose or behavior of the outline.

maxAttempts?: number

Optional maximum number of attempts for the outline operation. Limits the number of retries if validations fail.

outlineName: string

The unique name of the outline within the system. Identifies the specific outline configuration.

validations?: (
    IOutlineValidation<Data, Param>
    | IOutlineValidationFn<Data, Param>
)[]

Array of validation functions or configurations to apply to the outline data. Supports both direct validation functions and structured validation configurations.

Methods

  • Function to generate structured data for the outline operation. Processes input param and history to produce the desired data.

    Parameters

    • args: IOutlineArgs<Param>

      The arguments containing input param and history.

    Returns Promise<Data>

    A promise resolving to the structured data.