Compare commits
4 Commits
v2-assista
...
update-tit
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b4a3efbc4d | ||
|
|
79840763e7 | ||
|
|
1a452121fa | ||
|
|
af8bcb08d6 |
@@ -21,6 +21,10 @@ function Login() {
|
||||
}
|
||||
}, [isAuthenticated, navigate]);
|
||||
|
||||
useEffect(() => {
|
||||
document.title = startupConfig?.appTitle || 'LibreChat';
|
||||
}, [startupConfig?.appTitle]);
|
||||
|
||||
if (!startupConfig) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -13,6 +13,10 @@ const Registration: React.FC = () => {
|
||||
const { data: startupConfig } = useGetStartupConfig();
|
||||
const localize = useLocalize();
|
||||
|
||||
useEffect(() => {
|
||||
document.title = startupConfig?.appTitle || 'LibreChat';
|
||||
}, [startupConfig?.appTitle]);
|
||||
|
||||
const {
|
||||
register,
|
||||
watch,
|
||||
|
||||
@@ -37,7 +37,7 @@ export default function Conversation({ conversation, retainView, toggleNav, isLa
|
||||
const [isPopoverActive, setIsPopoverActive] = useState(false);
|
||||
|
||||
const clickHandler = async (event: React.MouseEvent<HTMLAnchorElement>) => {
|
||||
if (event.button === 0 && event.ctrlKey) {
|
||||
if (event.button === 0 && (event.ctrlKey || event.metaKey)) {
|
||||
toggleNav();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useState, useMemo, useEffect } from 'react';
|
||||
import TextareaAutosize from 'react-textarea-autosize';
|
||||
import type { TPreset } from 'librechat-data-provider';
|
||||
import type { Assistant, TPreset } from 'librechat-data-provider';
|
||||
import type { TModelSelectProps, Option } from '~/common';
|
||||
import { Label, HoverCard, SelectDropDown, HoverCardTrigger } from '~/components/ui';
|
||||
import { cn, defaultTextProps, removeFocusOutlines, mapAssistants } from '~/utils';
|
||||
@@ -20,15 +20,19 @@ export default function Settings({ conversation, setOption, models, readonly }:
|
||||
const { model, endpoint, assistant_id, endpointType, promptPrefix, instructions } =
|
||||
conversation ?? {};
|
||||
|
||||
const currentList = useMemo(
|
||||
() => Object.values(assistantListMap?.[endpoint ?? ''] ?? {}) as Assistant[],
|
||||
[assistantListMap, endpoint],
|
||||
);
|
||||
|
||||
const assistants = useMemo(() => {
|
||||
return [
|
||||
defaultOption,
|
||||
...(assistantListMap[endpoint ?? ''] ?? []).map(({ id, name }) => ({
|
||||
label: name,
|
||||
value: id,
|
||||
})),
|
||||
].filter(Boolean);
|
||||
}, [assistantListMap, endpoint, defaultOption]);
|
||||
const currentAssistants = (currentList ?? []).map(({ id, name }) => ({
|
||||
label: name,
|
||||
value: id,
|
||||
}));
|
||||
|
||||
return [defaultOption, ...currentAssistants].filter(Boolean);
|
||||
}, [currentList, defaultOption]);
|
||||
|
||||
const [onPromptPrefixChange, promptPrefixValue] = useDebouncedInput({
|
||||
setOption,
|
||||
@@ -96,6 +100,9 @@ export default function Settings({ conversation, setOption, models, readonly }:
|
||||
value: assistant.id ?? '',
|
||||
});
|
||||
setOption('assistant_id')(assistant.id);
|
||||
if (assistant.model) {
|
||||
setModel(assistant.model);
|
||||
}
|
||||
};
|
||||
|
||||
const optionEndpoint = endpointType ?? endpoint;
|
||||
@@ -141,7 +148,7 @@ export default function Settings({ conversation, setOption, models, readonly }:
|
||||
<TextareaAutosize
|
||||
id="promptPrefix"
|
||||
disabled={readonly}
|
||||
value={promptPrefixValue as string | undefined}
|
||||
value={(promptPrefixValue as string | null | undefined) ?? ''}
|
||||
onChange={onPromptPrefixChange}
|
||||
placeholder={localize('com_endpoint_prompt_prefix_assistants_placeholder')}
|
||||
className={cn(
|
||||
@@ -158,7 +165,7 @@ export default function Settings({ conversation, setOption, models, readonly }:
|
||||
<TextareaAutosize
|
||||
id="instructions"
|
||||
disabled={readonly}
|
||||
value={instructionsValue as string | undefined}
|
||||
value={(instructionsValue as string | null | undefined) ?? ''}
|
||||
onChange={onInstructionsChange}
|
||||
placeholder={localize('com_endpoint_instructions_assistants_placeholder')}
|
||||
className={cn(
|
||||
|
||||
@@ -71,7 +71,7 @@ export default function NewChat({
|
||||
const { conversation } = store.useCreateConversationAtom(index);
|
||||
|
||||
const clickHandler = (event: React.MouseEvent<HTMLAnchorElement>) => {
|
||||
if (event.button === 0 && !event.ctrlKey) {
|
||||
if (event.button === 0 && !(event.ctrlKey || event.metaKey)) {
|
||||
event.preventDefault();
|
||||
newConvo();
|
||||
navigate('/c/new');
|
||||
|
||||
Reference in New Issue
Block a user