Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions client/src/components/Chat/Landing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand Down
11 changes: 8 additions & 3 deletions client/src/hooks/Input/useTextarea.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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();
Expand All @@ -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)) &&
Expand Down Expand Up @@ -97,7 +101,7 @@ export default function useTextarea({
}

const sender =
isAssistant || isAgent
isAssistant || isAgent || currentSpecLabel
? getEntityName({ name: entityName, isAgent, localize })
: getSender(conversation as TEndpointOption);

Expand Down Expand Up @@ -138,6 +142,7 @@ export default function useTextarea({
conversation,
latestMessage,
isNotAppendable,
currentSpecLabel,
]);

const handleKeyDown = useCallback(
Expand Down