Custom AI function samples
The following examples will show you how to create custom AI functions and use them to expand the AI agent's capabilities and allow adapting it to specific use cases.
Text document editor
changeParagraphStyle
This function modifies the visual style of the specified paragraph.
changeTextStyle
This function modifies the visual style of the selected text. If no text is selected, the current word is used by default.
checkSpelling
This function checks spelling or fixes other text errors in the current paragraph.
commentText
This function adds an explanation or comment to the text. If no text or paragraph number is specified, the current paragraph is used by default. Specify whether the explanation should be added as a comment or as a footnote. The AI will generate the content based on your prompt and insert it in the chosen format.
insertPage
This function inserts a new page into the document at a specified location.
rewriteText
This function rewrites or replaces text. If no text or paragraph number is specified, the current paragraph is used by default.
Spreadsheet editor
addChart
This function creates a chart of the specified type from the given range or the selected range.
explainFormula
This function explains a formula from the specified range or, if omitted, the active/selected range.
insertPivotTable
This function inserts a pivot table into the specified range or the currently selected range.
setAutoFilter
This function applies or modifies an AutoFilter on a given cell range or the active selection.
setSort
This function sorts a given range (or the active/selected range) by up to three columns, using either cell references, column indices, named ranges, or column headers. Supports ascending/descending order and optional header detection.
Presentation editor
addChartToSlide
This function adds a chart to the specified or the current slide. By default, the chart is 152x89 mm and centered.
addNewSlide
This function adds a new slide at the end of presentation using default layout from the current slide's master.
addShapeToSlide
This function adds a shape to the slide with optional text. By default, the shape is 139x42 mm, centered, with a blue fill and a dark border.
addTableToSlide
This function adds a table to the specified or the current slide. By default, the table is 194x97 mm and centered.
addTextToPlaceholder
This function adds any text content to the specified or the current slide. Use this function for all text insertion requests, including recipes, lists, instructions, notes, ideas, or other text content.
changeSlideBackground
This function changes the background of a specified slide. Supports solid colors and gradient fills.
deleteSlide
This function deletes the specified slide from the current presentation.
duplicateSlide
This function duplicates the specified slide in the current presentation.
Support
If you want to request a feature or report a bug regarding custom AI functions, use the issues section on GitHub.