Preparing search index...

    Holds the outcome of a ChatTool execution, with data on success or an error string on failure.

        // ChatTool.Result is returned from ChatTool.execute().
    const { Result } = await import('LensStudio:ChatTool');

    // Success result: set data, leave error empty
    const success = new Result();
    success.data = { items: ['Sunset Pack', 'Golden Hour'] };
    success.error = '';
    console.log('Success data:', JSON.stringify(success.data));

    // Error result: set error string, leave data undefined
    const failure = new Result();
    failure.error = 'Tool execution timed out';
    console.log('Error:', failure.error);
    Index

    Constructors

    Properties

    Constructors

    • Constructs a new Result object for returning operation outcomes from a ChatTool execute() method.

      Returns Result

    Properties

    data: any

    Holds the successful output payload returned by the tool operation.

    error: string

    Error message string set when the tool operation fails; empty on success.