Skip to content

Commit

Permalink
fix: typing
Browse files Browse the repository at this point in the history
  • Loading branch information
thucpn committed Nov 25, 2024
1 parent 8947f8b commit 64a2016
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ export class InterpreterTool implements BaseTool<InterpreterParameter> {
for (const filePath of input.sandboxFiles) {
const fileName = path.basename(filePath);
const localFilePath = path.join(this.uploadedFilesDir, fileName);
const content = fs.readFileSync(localFilePath) as ArrayBuffer;
const content = fs.readFileSync(
localFilePath,
) as unknown as ArrayBuffer;
await this.codeInterpreter?.files.write(filePath, content);
}
} catch (error) {
Expand Down
4 changes: 3 additions & 1 deletion templates/types/streaming/nextjs/app/api/sandbox/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ export async function POST(req: Request) {
artifact.files.forEach(async (sandboxFilePath) => {
const fileName = path.basename(sandboxFilePath);
const localFilePath = path.join("output", "uploaded", fileName);
const fileContent = (await fs.readFile(localFilePath)) as ArrayBuffer;
const fileContent = (await fs.readFile(
localFilePath,
)) as unknown as ArrayBuffer;

await sbx.files.write(sandboxFilePath, fileContent);
console.log(`Copied file to ${sandboxFilePath} in ${sbx.sandboxID}`);
Expand Down

0 comments on commit 64a2016

Please sign in to comment.