LensStudio:ChatTool.Result
ClassHolds the outcome of a ChatTool execution, with data on success or an error string on failure.
Index
Example
// 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);
Constructors
Constructor
new Result():
Result
Constructs a new Result object for returning operation outcomes from a ChatTool execute() method.
Returns
Result
Properties
data
data:
any
Holds the successful output payload returned by the tool operation.
error
error:
string
Error message string set when the tool operation fails; empty on success.