Custom AI function samples
The following examples will show you how to create custom AI functions and use them to expand the inline 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.
describeImage
This function analyzes the selected image and generates a title, caption, description, or alt text using an AI model. The generated text is inserted into the document.
extractActionItems
This function analyzes selected text, meeting notes, or a document section and extracts clear action items or to-dos, formatting them as a structured list. It can optionally remove the original text.
generateHashtags
This function generates relevant hashtags based on the selected text or the current word.
insertList
This function creates simple numbered or bulleted lists at the current cursor position or at the start/end of the document.
insertPage
This function inserts a new page into the document at a specified location.
insertTable
This function inserts a table at the current cursor position or at the start/end of the document. You can specify the number of rows and columns, and optionally add headers.
renameFormKeys
This function collects all form fields (keys/placeholders), renames the fields to UPPERSNAKECASE, and optionally updates placeholders.
rewriteText
This function rewrites or replaces text. If no text or paragraph number is specified, the current paragraph is used by default.
smartHeadlineGenerator
This function generates a clear and relevant headline from the currently selected text (paragraph, slide, or section). This headline is meant to accurately represent the content, not be overly catchy.
Spreadsheet editor
addChart
This function creates a chart of the specified type from the given range or the selected range.
calculateValues
This function performs basic mathematical operations (addition, subtraction, multiplication, division, median, average) on selected cells or a specified range and writes the result to a specified cell or below the last used cell in the column.
explainError
This function explains the error in the specified cell by adding a comment with the explanation.
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.
describeImage
This function analyzes the currently selected image and generates a title, caption, description, or alt text using an AI model. The generated text is then inserted into the slide.
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.