get_file_base64
Read a UTF-8 text file from the SiYuan knowledge base and return its content as a Base64-encoded string, masking sensitive data. Use it to access JSON files, like those in historical snapshots, without exposing raw content.
Instructions
读取指定文件内容并以 Base64 返回(只读)。
适用于需要以 Base64 形式返回的 UTF-8 文本文件(例如历史快照里的 JSON)。
注意事项: - 本实现会先按 UTF-8 解码后再打码并进行 Base64 编码。 - 若文件为纯二进制且无法 UTF-8 解码,将抛出异常(不支持二进制打码)。
Args: path: 文件路径,例如 '/history/.../blocks.msgpack'。
Returns: str: Base64 编码的文件内容(已打码)。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |