feat: UI component rendering in agent dialog mode (#1083)

Co-authored-by: csunny <cfqsunny@163.com>
This commit is contained in:
Hzh_97
2024-01-18 11:08:02 +08:00
committed by GitHub
parent 674104eb7c
commit 0936856c3a
46 changed files with 1597 additions and 73 deletions

View File

@@ -15,7 +15,7 @@ import { getInitMessage } from '@/utils';
const ChatContainer = () => {
const searchParams = useSearchParams();
const { scene, chatId, model, setModel, history, setHistory } = useContext(ChatContext);
const { scene, chatId, model, agent, setModel, history, setHistory } = useContext(ChatContext);
const chat = useChat({});
const initMessage = (searchParams && searchParams.get('initMessage')) ?? '';
@@ -95,7 +95,7 @@ const ChatContainer = () => {
});
});
},
[history, chat, model],
[history, chat, chatId, model, agent, scene],
);
return (
@@ -122,7 +122,7 @@ const ChatContainer = () => {
)}
{/** chat panel */}
<div
className={classNames('flex flex-1 flex-col', {
className={classNames('flex flex-1 flex-col overflow-hidden', {
'px-0 xl:pl-4 h-2/5 w-full xl:w-auto xl:h-full border-t xl:border-t-0 xl:border-l dark:border-gray-800': scene === 'chat_dashboard',
'h-full lg:px-8': scene !== 'chat_dashboard',
})}