UNPKG

@lobehub/chat

Version:

Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.

17 lines (11 loc) 559 B
import { useAgentStore } from '@/store/agent'; import { useSessionStore } from '@/store/session'; import { useUserStore } from '@/store/user'; import { authSelectors } from '@/store/user/selectors'; export const useInitAgentConfig = () => { const [useFetchAgentConfig] = useAgentStore((s) => [s.useFetchAgentConfig]); const isLogin = useUserStore(authSelectors.isLogin); const [sessionId] = useSessionStore((s) => [s.activeId]); const data = useFetchAgentConfig(isLogin, sessionId); return { ...data, isLoading: data.isLoading && isLogin }; };