DELETE /v1/files/${*fileId*} is giving 500 error with code ERR_BAD_RESPONSE
Can anybody have any idea why this happening?
Here is the code flow→
- file upload with purpose = ‘assistants’
2. LLM response generation
3.File deletion
try {
fileId = await this.llmService.uploadFile(fileBuffer)
const systemPrompt = RESUME_EXTRACTION_PROMPT
const parsedResumeData =
await this.llmService.queryUploadedFile<ParsedResumeData>(
fileId,
RESUME_EXTRACTION_SCHEMA,
systemPrompt
)
return parsedResumeData
} catch (error) {
throw new ValidationError(`Failed to parse resume`)
} finally {
if (fileId) {
try {
await this.llmService.deleteUploadedFile(fileId)
} catch (cleanupError) {
this.log.warn(
`Failed to clean up uploaded file ${fileId}:`,
cleanupError
)
}
}
}