🗺️ 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,
file,
file_id,
entity_id,
basePath,
entity_id,
});
// SECOND: Upload to Vector DB
@ -670,17 +670,18 @@ const processAgentFileUpload = async ({ req, res, metadata }) => {
req,
file,
file_id,
entity_id,
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
const embedded =
tool_resource === EToolResources.file_search
? embeddingResult?.embedded
: storageResult.embedded;
let embedded = storageResult.embedded;
if (tool_resource === EToolResources.file_search) {
embedded = embeddingResult?.embedded;
filename = embeddingResult?.filename || filename;
}
let filepath = _filepath;