| | |
| | | import { computed, ref, watch } from 'vue'; |
| | | import { computed, ref } from 'vue'; |
| | | import type { ChatRoomItem } from '../layout/component/sidebar/components/types'; |
| | | import { Local } from '../utils/storage'; |
| | | |
| | | export type RoomConfig = { |
| | | /** 是否直接调用大模型(通义千问)回答 */ |
| | | isAnswerByLLM: boolean; |
| | | /** @description 从首页进去获取的第一个回复,回调函数 */ |
| | | firstResCb: any; |
| | | }; |
| | | |
| | | export type RoomConfigKey = keyof RoomConfig; |
| | |
| | | } |
| | | }; |
| | | |
| | | export const getRoomConfig = <T extends RoomConfigKey>(roomId: string, key: T) => { |
| | | if (!roomConfig.value) { |
| | | return null; |
| | | } |
| | | if (!roomConfig.value[roomId]) { |
| | | return null; |
| | | } else { |
| | | return roomConfig.value[roomId][key]; |
| | | } |
| | | }; |
| | | |
| | | export const chatRoomList = ref<ChatRoomItem[]>([]); |
| | | |
| | | export const activeRoomId = ref(null); |
| | |
| | | export const activeSampleId = ref(null); |
| | | export const activeSectionAId = ref(null); |
| | | export const activeLLMId = ref(null); |
| | | |
| | | |
| | | |
| | | /** |
| | | * 全局使用的 ref |
| | | */ |
| | | export const sectionAList = ref([]); |