The AI Actions API client can be used to interact with any of the API endpoints that AI Actions supports.Below are a few examples of common uses for the client.
const actionList = await aiActionsClient.getActionList();actionList?.results.forEach((action) => { // Each action has an ID that can be used to execute it, and it includes information about how the user // has set it up, such as the description and the app it's associated with. console.log(action.id, action.description); // "01EXAMPLE_ID Gmail: Find Email"});
const result = await aiActionsClient.executeAction( { ai_action_id: "YOUR_ACTION_ID", }, { instructions: "Create a row with the following data....", params: { spreadsheet: { mode: "guess", // AI Actions will figure out the proper ID to use based on the hint, // that way you don't need to worry about knowing IDs! value: "My Spreadsheet", }, }, preview_only: false, });console.log(result?.resolved_params, result?.full_results);