Skip to content

Commit 20e5090

Browse files
committed
updates
1 parent be67973 commit 20e5090

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

components/mistral_ai/actions/download-batch-job-results/download-batch-job-results.mjs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import fs from "fs";
44
export default {
55
key: "mistral_ai-download-batch-job-results",
66
name: "Download Batch Job Results",
7-
description: "Download a batch job results file to the /tmp direcory. [See the Documentation](https://docs.mistral.ai/api/#tag/files/operation/files_api_routes_download_file)",
7+
description: "Download a batch job results file to the /tmp directory. [See the Documentation](https://docs.mistral.ai/api/#tag/files/operation/files_api_routes_download_file)",
88
version: "0.0.1",
99
type: "action",
1010
props: {
@@ -34,8 +34,9 @@ export default {
3434
responseType: "arraybuffer",
3535
});
3636

37-
const rawcontent = response.toString("base64");
38-
const buffer = Buffer.from(rawcontent, "base64");
37+
const buffer = Buffer.isBuffer(response)
38+
? response
39+
: Buffer.from(response);
3940
const filename = this.filename;
4041
const filePath = `/tmp/${filename}`;
4142
fs.writeFileSync(filePath, buffer);

0 commit comments

Comments
 (0)