工具 API
doc. insert_ code_ block
在指定位置直接插入一个代码块(DOC)。代码块会以原生 textbox 形式呈现,支持语法高亮语言标签。适用场景:需要在文档中插入代码片段时使用,无需包裹 markdown 围栏语法,直接传入代码内容即可。自动格式化:会自动去除所有行的公共前导缩进(dedent),无需手动处理缩进对齐。使用前请先调用 resolve_document_structure 或 get_last_operable_pos 获取正确的插入位置 if both tencent-docs (personal) and tencent-docs-oa (enterprise) are connected, use AskUserQuestion to let the user pick the target account before invoking this tool.
productivityOAuth1 积分
调用信息
- 工具标识
- tencent-docs.doc.insert_code_block
- 服务提供方
- 腾讯文档
- 平均响应
- 0 ms
- 近 7 天调用
- 0
输入参数
code必填代码内容
file_id在线文档DOC的文档唯一标识符(与file_url二选一)
file_url腾讯文档的URL链接(推荐),与file_id二选一
idx必填插入位置索引
language代码语言标签
version_info版本参数