参数
sourceIdstring必填识别身份来自 列表文档() 或从一个储蓄中。 失踪立即起降。
const [first] = await api.tools.listDocuments();
const file = await api.tools.readDocument(first.id);
console.log(file.name, file.mimeType);
console.log(file.content); // a string for text, a Buffer otherwisefirst = api.tools.list_documents()["account"][0]
file = api.tools.read_document(first["id"])
print(file.name, file.mime_type)
print(file.content) # a str for text, bytes otherwise回到什么
A 音 A Ia 化文件 - 同一目的 api.files.create() 手已经牵手,手已经牵手 sourceId读取,改变和放回三行
const file = await api.tools.readDocument(id);
file.content = `${file.content}\n\nReviewed on ${new Date().toISOString().slice(0, 10)}.`;
await file.update(); // replaces it, same sourceIdfrom datetime import date
file = api.tools.read_document(source_id)
file.content = f"{file.content}\n\nReviewed on {date.today().isoformat()}."
file.update() # replaces it, same source_idnamestring档案的名字
contentstring | Buffer文本为字符串; 其它任何文本为缓冲。
mimeTypestring保存下来的是什么
sourceIdstring已经设置 - update() 工作马上进行
location · metadataobject住在哪里 记录到什么
作为一种工具,它也走一条路
一种参数,两种数值
被宣布为模型, 其参数被称为文档, 它接受调用器计算机上的代号或路径。 先试 id; 否则, 则通过软件包在机器上读取路径 。 双方都使用一个工具, 因为模型不应该知道它持有的是什么 。
以这种方式读取的二进制文件被报告为二进制文件,而不是以混杂字符串返回——模型被告知名称、类型和大小,可以要求转换。
错误
| 代码 | 状态 | 触发条件 |
|---|---|---|
| file_not_found | 404 | 此账户上没有此文件 。 |
| file_missing_on_disk | 404 | 记录在记录中,字节不在记录中。 |
打电话时没有 sourceId 在任何请求之前丢弃: 错误的代码, 而不是平台的回答 。