🗺️ fix: Embedded file handling to use Proper Filename (#9372)

This commit is contained in:
Danny Avila 2025-08-29 12:23:18 -04:00 committed by GitHub
parent e2a6937ca6
commit 20b29bbfa6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -646,8 +646,8 @@ const processAgentFileUpload = async ({ req, res, metadata }) => {
req, req,
file, file,
file_id, file_id,
entity_id,
basePath, basePath,
entity_id,
}); });
// SECOND: Upload to Vector DB // SECOND: Upload to Vector DB
@ -670,17 +670,18 @@ const processAgentFileUpload = async ({ req, res, metadata }) => {
req, req,
file, file,
file_id, file_id,
entity_id,
basePath, basePath,
entity_id,
}); });
} }
const { bytes, filename, filepath: _filepath, height, width } = storageResult; let { bytes, filename, filepath: _filepath, height, width } = storageResult;
// For RAG files, use embedding result; for others, use storage result // For RAG files, use embedding result; for others, use storage result
const embedded = let embedded = storageResult.embedded;
tool_resource === EToolResources.file_search if (tool_resource === EToolResources.file_search) {
? embeddingResult?.embedded embedded = embeddingResult?.embedded;
: storageResult.embedded; filename = embeddingResult?.filename || filename;
}
let filepath = _filepath; let filepath = _filepath;