mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-22 11:20:15 +01:00
fix: agent icons/labels for messages
This commit is contained in:
parent
2150c4815d
commit
9a9f993f32
4 changed files with 57 additions and 7 deletions
|
|
@ -2,6 +2,7 @@ const crypto = require('crypto');
|
|||
const fetch = require('node-fetch');
|
||||
const {
|
||||
supportsBalanceCheck,
|
||||
isAgentsEndpoint,
|
||||
ErrorTypes,
|
||||
Constants,
|
||||
CacheKeys,
|
||||
|
|
@ -66,6 +67,17 @@ class BaseClient {
|
|||
throw new Error('Subclasses attempted to call summarizeMessages without implementing it');
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {string}
|
||||
*/
|
||||
getResponseModel() {
|
||||
if (this.options.agent.id && isAgentsEndpoint(this.options.endpoint)) {
|
||||
return this.options.agent.id;
|
||||
}
|
||||
|
||||
return this.modelOptions.model;
|
||||
}
|
||||
|
||||
/**
|
||||
* Abstract method to get the token count for a message. Subclasses must implement this method.
|
||||
* @param {TMessage} responseMessage
|
||||
|
|
@ -558,7 +570,7 @@ class BaseClient {
|
|||
parentMessageId: userMessage.messageId,
|
||||
isCreatedByUser: false,
|
||||
isEdited,
|
||||
model: this.modelOptions.model,
|
||||
model: this.getResponseModel(),
|
||||
sender: this.sender,
|
||||
promptTokens,
|
||||
iconURL: this.options.iconURL,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue