@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.
31 lines (27 loc) • 802 B
text/typescript
import { DEFAULT_AGENT_META } from '@/const/meta';
import { DEFAULT_AGENT_CONFIG } from '@/const/settings';
import { LobeAgentConfig } from '@/types/agent';
import { MetaData } from '@/types/meta';
export interface State {
autocompleteLoading: SessionLoadingState;
config: LobeAgentConfig;
id?: string;
loading?: boolean;
meta: MetaData;
onConfigChange?: (config: LobeAgentConfig) => void;
onMetaChange?: (meta: MetaData) => void;
}
export type SessionLoadingState = Record<Partial<keyof MetaData>, boolean>;
export const initialState: State = {
// loading 中间态
autocompleteLoading: {
avatar: false,
backgroundColor: false,
description: false,
tags: false,
title: false,
},
config: DEFAULT_AGENT_CONFIG,
loading: true,
meta: DEFAULT_AGENT_META,
};