mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-09-21 21:50:49 +02: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,
|
||||
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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue