mirror of
https://github.com/lobehub/lobehub.git
synced 2026-03-27 13:29:15 +07:00
🐛 fix: add the Agent Meta info back into agent advance model (#12302)
fix: add the Agent Meta info back into agent advance model
This commit is contained in:
@@ -4,7 +4,7 @@ import { Avatar, Block, Flexbox, Icon, Text } from '@lobehub/ui';
|
||||
import { type ItemType } from 'antd/es/menu/interface';
|
||||
import { useTheme } from 'antd-style';
|
||||
import isEqual from 'fast-deep-equal';
|
||||
import { BrainIcon, MessageSquareHeartIcon, MessagesSquareIcon } from 'lucide-react';
|
||||
import { BrainIcon, MessageSquareHeartIcon, MessagesSquareIcon, UserIcon } from 'lucide-react';
|
||||
import { memo, useMemo, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
@@ -24,7 +24,7 @@ const Content = memo(() => {
|
||||
]);
|
||||
const config = useAgentStore(agentSelectors.currentAgentConfig, isEqual);
|
||||
const meta = useAgentStore(agentSelectors.currentAgentMeta, isEqual);
|
||||
const [tab, setTab] = useState(isInbox ? ChatSettingsTabs.Modal : ChatSettingsTabs.Opening);
|
||||
const [tab, setTab] = useState(isInbox ? ChatSettingsTabs.Modal : ChatSettingsTabs.Meta);
|
||||
|
||||
const updateAgentConfig = async (config: any) => {
|
||||
if (!agentId) return;
|
||||
@@ -39,6 +39,13 @@ const Content = memo(() => {
|
||||
const menuItems: ItemType[] = useMemo(
|
||||
() =>
|
||||
[
|
||||
!isInbox
|
||||
? {
|
||||
icon: <Icon icon={UserIcon} />,
|
||||
key: ChatSettingsTabs.Meta,
|
||||
label: t('agentTab.meta'),
|
||||
}
|
||||
: null,
|
||||
!isInbox
|
||||
? {
|
||||
icon: <Icon icon={MessageSquareHeartIcon} />,
|
||||
|
||||
@@ -6,6 +6,7 @@ import { agentSelectors } from '@/store/agent/selectors';
|
||||
import { ChatSettingsTabs } from '@/store/global/initialState';
|
||||
|
||||
import AgentChat from './AgentChat';
|
||||
import AgentMeta from './AgentMeta';
|
||||
import AgentModal from './AgentModal';
|
||||
import AgentOpening from './AgentOpening';
|
||||
|
||||
@@ -21,6 +22,7 @@ const AgentSettingsContent = memo<AgentSettingsContentProps>(({ tab, loadingSkel
|
||||
|
||||
return (
|
||||
<>
|
||||
{tab === ChatSettingsTabs.Meta && <AgentMeta />}
|
||||
{tab === ChatSettingsTabs.Opening && <AgentOpening />}
|
||||
{tab === ChatSettingsTabs.Chat && <AgentChat />}
|
||||
{tab === ChatSettingsTabs.Modal && <AgentModal />}
|
||||
|
||||
Reference in New Issue
Block a user