Tool
Types
Tool.Confirmation
type Confirmation<T> = (input: T) => Promise<
| undefined
| {
/**
* Defines the visual style of the Confirmation.
*
* @remarks
* Use {@link Action.Style.Regular} to display a regular action.
* Use {@link Action.Style.Destructive} when your action performs something irreversible like deleting data.
*
* @defaultValue {@link Action.Style.Regular}
*/
style?: Action.Style;
/**
* Some name/value pairs that represents the side-effects of the tool.
*
* @remarks
* Use it to provide more context about the tool to the user. For example, list the files that will be deleted.
*
* A name/value pair with an optional value won't be displayed if the value is `undefined`.
*/
info?: {
name: string;
value?: string;
}[];
/**
* A string that represents the side-effects of the tool.
*
* @remarks
* Often times this is a question that the user needs to answer. For Example, "Are you sure you want to delete the file?"
*/
message?: string;
/**
* An image that visually represents the side-effects of the tool.
*
* @remarks
* Use an image that is relevant to the side-effects of the tool. For example, a screenshot of the files that will be deleted.
*/
image?: Image.URL | FileIcon;
}
>;Example
Last updated

