diff --git a/packages/tools/src/tools/img-gen.ts b/packages/tools/src/tools/img-gen.ts index 5606610b64d5dfc6eccc9d23bd9c92dd33e91a40..b46de53d338fde6d85017acc3db91459745fd3e7 100644 --- a/packages/tools/src/tools/img-gen.ts +++ b/packages/tools/src/tools/img-gen.ts @@ -1,5 +1,4 @@ import { tool } from "@llamaindex/core/tools"; -import { randomUUID } from "@llamaindex/env"; import { FormData } from "formdata-node"; import got from "got"; import path from "path"; @@ -37,7 +36,7 @@ export const imageGenerator = (params: ImgGeneratorToolParams) => { try { const buffer = await promptToImgBuffer(prompt, apiKey, outputFormat); - const filename = `${randomUUID()}.${outputFormat}`; + const filename = `${crypto.randomUUID()}.${outputFormat}`; const filePath = path.join(outputDir, filename); await saveDocument(filePath, buffer); const imageUrl = getFileUrl(filePath, { fileServerURLPrefix }); diff --git a/packages/tools/src/tools/interpreter.ts b/packages/tools/src/tools/interpreter.ts index 316690b8b25d6581d923de5c2905c26ba1feb824..364cdf6f425dc65c9acab0126717b37b28c88f85 100644 --- a/packages/tools/src/tools/interpreter.ts +++ b/packages/tools/src/tools/interpreter.ts @@ -1,6 +1,5 @@ import { type Logs, Result, Sandbox } from "@e2b/code-interpreter"; import { tool } from "@llamaindex/core/tools"; -import { randomUUID } from "@llamaindex/env"; import fs from "fs"; import path from "node:path"; import { z } from "zod"; @@ -154,7 +153,7 @@ async function getExtraResult( } async function saveToDisk(outputDir: string, base64Data: string, ext: string) { - const filename = `${randomUUID()}.${ext}`; + const filename = `${crypto.randomUUID()}.${ext}`; const buffer = Buffer.from(base64Data, "base64"); const filePath = path.join(outputDir, filename); await saveDocument(filePath, buffer);