added small change to add LLM name to the chats.

This commit is contained in:
Patrick Wiltrout 2024-11-07 13:31:01 -05:00
parent 1e99fe8d69
commit 8117815346
4 changed files with 26 additions and 1 deletions

View file

@ -16,6 +16,8 @@ export type Message = {
chatId: string;
createdAt: Date;
content: string;
llmName: string;
llmProvider: string;
role: 'user' | 'assistant';
suggestions?: string[];
sources?: Document[];
@ -353,6 +355,8 @@ const ChatWindow = ({ id }: { id?: string }) => {
messageId: messageId,
chatId: chatId!,
content: message,
llmName: localStorage.getItem('chatModel') || 'NOT_SET',
llmProvider: localStorage.getItem('chatModelProvider') || 'NOT_SET',
},
focusMode: focusMode,
optimizationMode: optimizationMode,
@ -368,6 +372,8 @@ const ChatWindow = ({ id }: { id?: string }) => {
chatId: chatId!,
role: 'user',
createdAt: new Date(),
llmName: localStorage.getItem('chatModel') || 'NOT_SET',
llmProvider: localStorage.getItem('chatModelProvider') || 'NOT_SET',
},
]);
@ -392,6 +398,8 @@ const ChatWindow = ({ id }: { id?: string }) => {
role: 'assistant',
sources: sources,
createdAt: new Date(),
llmName: localStorage.getItem('chatModel') || 'NOT_SET',
llmProvider: localStorage.getItem('chatModelProvider') || 'NOT_SET',
},
]);
added = true;
@ -410,6 +418,8 @@ const ChatWindow = ({ id }: { id?: string }) => {
role: 'assistant',
sources: sources,
createdAt: new Date(),
llmName: localStorage.getItem('chatModel') || 'NOT_SET',
llmProvider: localStorage.getItem('chatModelProvider') || 'NOT_SET',
},
]);
added = true;

View file

@ -77,10 +77,15 @@ const MessageBox = ({
{message.role === 'assistant' && (
<div className="flex flex-col space-y-9 lg:space-y-0 lg:flex-row lg:justify-between lg:space-x-9">
<div
ref={dividerRef}
className="flex flex-col space-y-6 w-full lg:w-9/12"
>
<div className="flex flex-col space-y-2">
<h3 className="text-black dark:text-white font-medium text-xl">{message.llmName}</h3>
</div>
{message.sources && message.sources.length > 0 && (
<div className="flex flex-col space-y-2">
<div className="flex flex-row items-center space-x-2">