Google Docs
Baca dokumen (dengan tab), buat dokumen, sisipkan teks, ganti teks untuk template, batch update mentah harus diizinkan (OAuth atau service account)
Beta v0.1.0 Node.js 6 aksi
Tentang
Plugin Graphrt untuk Google Docs API v1. Baca dokumen (termasuk tab), buat dokumen, sisipkan teks, ganti teks di seluruh dokumen (mengisi template) dan kirim batch update mentah. Untuk mencari dokumen berdasarkan nama, menyalin, membagikan atau mengekspornya, pakai google-drive.
Yang bisa dilakukan
- get_document: structure and text, include_tabs_content returns every tab, suggestions_view_mode chooses how suggestions appear
- create_document: a new empty document with a title
- insert_text: at a UTF-16 index (1 = start of the body), or appended at the end
- replace_all_text: every occurrence with replace_with, optionally case-sensitive and limited to tabs, reports occurrencesChanged. Deleting the matches needs an explicit delete_matches: true (a missing or empty replace_with is refused, never treated as "delete")
- batch_update: any batchUpdate requests (styles, tables, images, deletions)
- api_request: any other endpoint (GET only for agents)
Aksi
Setiap aksi adalah langkah yang bisa ditambahkan ke workflow. Agent juga bisa memakai sebagian besar aksi sebagai tool.
- Get document
google-docs.get_document - Create document
google-docs.create_document - Insert text
google-docs.insert_text - Replace text
google-docs.replace_all_text - Batch update
google-docs.batch_update - Google Docs API request
google-docs.api_request
Pengaturan
Graphrt menyalakan plugin dengan environment yang bersih. Hanya nilai ini yang sampai ke plugin, dan secret tidak masuk log.
-
GOOGLE_REFRESH_TOKENOAuth refresh trio -
GOOGLE_SERVICE_ACCOUNT_JSONPath to a service account key file (scope documents), share each document with the service account's email -
GOOGLE_ACCESS_TOKENA ready access token (used only when neither of the above is set) -
GOOGLE_DOCS_TOOL_ALLOW_BATCH_UPDATE1 lets agent tools call batch_update and delete text with replace_all_text delete_matches -
GOOGLE_CLIENT_ID -
GOOGLE_CLIENT_SECRET -
GOOGLE_DOCS_TOOL_TOKEN_SOURCE
Cara memakainya
Di Graphrt Desktop
- Buka Plugins dan cari Google Docs.
- Klik Install lalu setujui.
- Ikuti langkah setup di halaman plugin, lalu tempel pengaturan yang dibutuhkan.
- Jelaskan pekerjaan yang membutuhkannya, dan builder menambahkan langkahnya.
Dengan CLI
terminal
$ graphrt plugin install google-docs workflow.yaml
# Fill a template copy (copy it first with google-drive.copy_file)
- id: fill
type: google-docs.replace_all_text
document_id: "{{#copy.data.id#}}"
find: "{{customer_name}}"
replace_with: "{{#start.customer#}}"
- id: note
type: google-docs.insert_text
document_id: "{{#copy.data.id#}}"
text: "\nGenerated by graphrt."