diff --git a/client/src/components/Chat/Landing.tsx b/client/src/components/Chat/Landing.tsx index 15e53abaf075..ada8e6ba2542 100644 --- a/client/src/components/Chat/Landing.tsx +++ b/client/src/components/Chat/Landing.tsx @@ -67,8 +67,13 @@ export default function Landing({ centerFormOnLanding }: { centerFormOnLanding: assistant_id: conversation?.assistant_id, }); - const name = entity?.name ?? ''; - const description = (entity?.description || conversation?.greeting) ?? ''; + const specName = startupConfig?.modelSpecs?.list?.find( + (spec) => spec.name === conversation?.spec, + ); + + const name = entity?.name ?? specName?.label ?? ''; + const description = + (entity?.description || conversation?.greeting || specName?.description) ?? ''; const getGreeting = useCallback(() => { if (typeof startupConfig?.interface?.customWelcome === 'string') { diff --git a/client/src/hooks/Input/useTextarea.ts b/client/src/hooks/Input/useTextarea.ts index 7d32cbbe02d7..dbc01fe4d738 100644 --- a/client/src/hooks/Input/useTextarea.ts +++ b/client/src/hooks/Input/useTextarea.ts @@ -14,7 +14,7 @@ import { useAssistantsMapContext } from '~/Providers/AssistantsMapContext'; import { useAgentsMapContext } from '~/Providers/AgentsMapContext'; import useGetSender from '~/hooks/Conversations/useGetSender'; import useFileHandling from '~/hooks/Files/useFileHandling'; -import { useInteractionHealthCheck } from '~/data-provider'; +import { useGetStartupConfig, useInteractionHealthCheck } from '~/data-provider'; import { useChatContext } from '~/Providers/ChatContext'; import { globalAudioId } from '~/common'; import { useLocalize } from '~/hooks'; @@ -41,6 +41,7 @@ export default function useTextarea({ const assistantMap = useAssistantsMapContext(); const checkHealth = useInteractionHealthCheck(); const enterToSend = useRecoilValue(store.enterToSend); + const { data: startupConfig } = useGetStartupConfig(); const { index, conversation, isSubmitting, filesLoading, latestMessage, setFilesLoading } = useChatContext(); @@ -54,7 +55,10 @@ export default function useTextarea({ agent_id: conversation?.agent_id, assistant_id: conversation?.assistant_id, }); - const entityName = entity?.name ?? ''; + const currentSpecLabel = startupConfig?.modelSpecs?.list?.find( + (spec) => spec.name === conversation?.spec, + )?.label; + const entityName = currentSpecLabel ?? entity?.name ?? ''; const isNotAppendable = (((latestMessage?.unfinished ?? false) && !isSubmitting) || (latestMessage?.error ?? false)) && @@ -97,7 +101,7 @@ export default function useTextarea({ } const sender = - isAssistant || isAgent + isAssistant || isAgent || currentSpecLabel ? getEntityName({ name: entityName, isAgent, localize }) : getSender(conversation as TEndpointOption); @@ -138,6 +142,7 @@ export default function useTextarea({ conversation, latestMessage, isNotAppendable, + currentSpecLabel, ]); const handleKeyDown = useCallback(