mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-18 01:10:14 +01:00
🗺️ fix: Embedded file handling to use Proper Filename (#9372)
This commit is contained in:
parent
e2a6937ca6
commit
20b29bbfa6
1 changed files with 8 additions and 7 deletions
|
|
@ -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;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue