Skip to content

Commit

Permalink
Set name assistant (#2529)
Browse files Browse the repository at this point in the history
  • Loading branch information
GenkaOk authored Apr 1, 2024
1 parent 803cf25 commit dd8be07
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion web/screens/Chat/SimpleTextMessage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,14 @@ import {
editMessageAtom,
getCurrentChatMessagesAtom,
} from '@/helpers/atoms/ChatMessage.atom'
import { activeThreadAtom } from '@/helpers/atoms/Thread.atom'

const SimpleTextMessage: React.FC<ThreadMessage> = (props) => {
let text = ''
const isUser = props.role === ChatCompletionRole.User
const isSystem = props.role === ChatCompletionRole.System
const editMessage = useAtomValue(editMessageAtom)
const activeThread = useAtomValue(activeThreadAtom)

if (props.content && props.content.length > 0) {
text = props.content[0]?.text?.value ?? ''
Expand Down Expand Up @@ -178,7 +180,9 @@ const SimpleTextMessage: React.FC<ThreadMessage> = (props) => {
isUser && 'text-gray-500'
)}
>
{props.role}
{isUser
? props.role
: activeThread?.assistants[0].assistant_name ?? props.role}
</div>
<p className="text-xs font-medium text-gray-400">
{displayDate(props.created)}
Expand Down

0 comments on commit dd8be07

Please sign in to comment.