We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eba7fde commit 477d2eaCopy full SHA for 477d2ea
app/api/sandbox/route.ts
@@ -81,7 +81,16 @@ export async function POST(req: Request) {
81
await sbx.files.write(file.file_path, file.file_content)
82
}))
83
} else {
84
+ } else if (fragment.code !== null && fragment.code !== undefined) {
85
await sbx.files.write(fragment.file_path, fragment.code)
86
+ } else {
87
+ return new Response(
88
+ JSON.stringify({
89
+ error: 'Missing code data',
90
+ type: 'validation_error'
91
+ }),
92
+ { status: 400, headers: { 'Content-Type': 'application/json' } }
93
+ )
94
}
95
96
if (fragment.template === 'code-interpreter-v1') {
0 commit comments