// PART 03
Office files and PDFs
The assistant in Chat — and on the other channels — can create office files by calling verbs from the command catalog. A verb is a named action with named parameters; the server maps it to a registered API route, performs the action and returns a result that includes a deep link to the relevant app. You never need the verb names: describe what you want in ordinary language. The names below help when reading a reply or diagnosing why a file did not open.
A spreadsheet from a request
| Verb | What it does |
|---|---|
sheet.create |
Creates a workbook from rows and opens it in Sheets |
sheet.cells.set |
Writes values or formulas into a range, with optional styling |
sheet.cell.set / sheet.range.set / sheet.formula.set |
Write one value, a block or a formula |
sheet.chart.create |
Adds a bar, line or pie chart from a range |
sheet.import |
Turns a CSV/XLSX/ODS file from Drive into an openable spreadsheet |
Formatting is applied in the same call as the values: styles maps an A1 reference to font weight, colour and alignment; formats maps a reference to a number-format code; conditional carries rules such as “negative values in red”. Write a balance row as a formula so later edits recalculate. For an existing workbook the assistant can also sort (sheet.sort), filter (sheet.filter.apply), validate (sheet.data_validation.set), conditionally format (sheet.conditional_format.apply) and pivot (sheet.pivot.create).
A document or a deck
| Verb | What it does |
|---|---|
docs.create |
Creates a document from a title and a Markdown body |
docs.new |
Starts from a template — blank, letter, meeting or report; the letter starter carries the usual placeholders |
docs.get / docs.save / docs.update |
Read and write content |
docs.toc.generate / docs.outline |
Structure |
docs.comment.add / docs.ai / docs.export |
Comments, AI edits, downloadable export |
docs.open_from_drive |
Opens a Drive object — needs the object key and its bucket |
slides.create / slides.slide.add |
Build a deck and insert slides with title, content or blank layouts |
The “open” buttons in the reply
Every office verb declares a deep link such as app://sheet?file_id=…. When the command runs, the server fills the placeholders from the real result and the chat renderer turns the link into a button that opens the app with that record loaded. Safeguards:
- Only apps present in the published catalog, with their declared record keys, become buttons; an invented link stays plain text.
- Links inside code blocks are not converted.
- The target app need not be closed: the shell dispatches to the existing window.
Exporting from the conversation
| Verb | Formats |
|---|---|
docs.export |
PDF, DOCX, ODT, Markdown, HTML, text |
sheet.export |
XLSX, CSV, PDF |
slides.export |
Presentation export through the Slides API |
Sheet’s PDF export is a real PDF 1.4 file — one page set per worksheet with a repeated header row. The Preview app renders the last generated file or document when you just want to look at the result.
A typical exchange
- “Create a cash-flow spreadsheet with January to March, a total row and a bar chart.” — the assistant creates the workbook, writes the total as
=SUM(...), styles the header, formats the values and adds the chart; the reply carries Open Sheet. - “Add April and update the chart.” — a range write on the same file id, then a regenerated chart.
- “Export it as PDF.” —
sheet.exportreturns the file.