mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-09-22 06:00:56 +02:00
🔗 fix: File Citation Processing to Use Tool Artifacts
This commit is contained in:
parent
81b32e400a
commit
fc8fd489d6
8 changed files with 524 additions and 538 deletions
|
@ -49,7 +49,6 @@ const BaseClient = require('~/app/clients/BaseClient');
|
|||
const { getRoleByName } = require('~/models/Role');
|
||||
const { loadAgent } = require('~/models/Agent');
|
||||
const { getMCPManager } = require('~/config');
|
||||
const { processAgentResponse } = require('~/app/clients/agents/processAgentResponse');
|
||||
|
||||
const omitTitleOptions = new Set([
|
||||
'stream',
|
||||
|
@ -1036,27 +1035,6 @@ class AgentClient extends BaseClient {
|
|||
this.artifactPromises.push(...attachments);
|
||||
}
|
||||
|
||||
// Process agent response to capture file references and create attachments
|
||||
|
||||
const processedResponse = await processAgentResponse(
|
||||
{
|
||||
messageId: this.responseMessageId,
|
||||
attachments: this.artifactPromises,
|
||||
},
|
||||
this.user ?? this.options.req.user?.id,
|
||||
this.conversationId,
|
||||
this.contentParts,
|
||||
this.options.req.user,
|
||||
);
|
||||
|
||||
// Update artifact promises with any new attachments from agent response
|
||||
if (processedResponse.attachments && processedResponse.attachments.length > 0) {
|
||||
// Add new attachments to existing artifactPromises
|
||||
processedResponse.attachments.forEach((attachment) => {
|
||||
this.artifactPromises.push(Promise.resolve(attachment));
|
||||
});
|
||||
}
|
||||
|
||||
await this.recordCollectedUsage({ context: 'message' });
|
||||
} catch (err) {
|
||||
logger.error(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue