mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-03-05 07:40:19 +01:00
feat: add modelHistory to conversations
modelHistory keeps track of all the models and their respective endpoints that are used in a conversation, so we can quickly fetch the right values to populate our cost table whenever we load a conversation rather than having to recompute the list every time
This commit is contained in:
parent
4d9e17efe1
commit
cb8e76e27e
3 changed files with 12 additions and 0 deletions
|
|
@ -631,6 +631,7 @@ export const tConversationSchema = z.object({
|
||||||
modelLabel: z.string().nullable().optional(),
|
modelLabel: z.string().nullable().optional(),
|
||||||
userLabel: z.string().optional(),
|
userLabel: z.string().optional(),
|
||||||
model: z.string().nullable().optional(),
|
model: z.string().nullable().optional(),
|
||||||
|
modelHistory: z.array(z.object({ model: z.string(), endpoint: z.string() })).optional(),
|
||||||
promptPrefix: z.string().nullable().optional(),
|
promptPrefix: z.string().nullable().optional(),
|
||||||
temperature: z.number().nullable().optional(),
|
temperature: z.number().nullable().optional(),
|
||||||
topP: z.number().optional(),
|
topP: z.number().optional(),
|
||||||
|
|
|
||||||
|
|
@ -155,4 +155,14 @@ export const conversationPreset = {
|
||||||
verbosity: {
|
verbosity: {
|
||||||
type: String,
|
type: String,
|
||||||
},
|
},
|
||||||
|
/** Track all unique models used in this conversation with their endpoints */
|
||||||
|
modelHistory: {
|
||||||
|
type: [
|
||||||
|
{
|
||||||
|
model: { type: String, required: true },
|
||||||
|
endpoint: { type: String, required: true },
|
||||||
|
},
|
||||||
|
],
|
||||||
|
default: [],
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ export interface IConversation extends Document {
|
||||||
endpoint?: string;
|
endpoint?: string;
|
||||||
endpointType?: string;
|
endpointType?: string;
|
||||||
model?: string;
|
model?: string;
|
||||||
|
modelHistory?: Array<{ model: string; endpoint: string }>;
|
||||||
region?: string;
|
region?: string;
|
||||||
chatGptLabel?: string;
|
chatGptLabel?: string;
|
||||||
examples?: unknown[];
|
examples?: unknown[];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue