| | |
| | | <script setup lang="ts"> |
| | | import { ElMessage } from 'element-plus'; |
| | | import { onMounted, ref } from 'vue'; |
| | | import { GetLLMList } from '/@/api/ai/chat'; |
| | | import { GetLLMList, setHistoryGroupTitle } from '/@/api/ai/chat'; |
| | | import PlayBar from '/@/components/chat/components/playBar/PlayBar.vue'; |
| | | import router from '/@/router'; |
| | | import { activeChatRoom, activeLLMId, activeSectionAId } from '/@/stores/chatRoom'; |
| | | import emitter from '/@/utils/mitt'; |
| | | import { handleNormalAuth } from '/@/utils/request'; |
| | | const emits = defineEmits(['sendClick']); |
| | | const inputValue = ref(''); |
| | | const inputValue = ref('你是谁?'); |
| | | |
| | | const sendClick = () => { |
| | | const sendClick = async () => { |
| | | if (!inputValue.value) return; |
| | | if (!activeSectionAId.value) { |
| | | ElMessage.warning('请选择应用场景'); |
| | | return; |
| | | } |
| | | if (!handleNormalAuth()) { |
| | | return; |
| | | } |
| | | |
| | | const res = await setHistoryGroupTitle({ |
| | | history_group_id: activeChatRoom.value.id, |
| | | title: inputValue.value, |
| | | }); |
| | | if (!res.json_ok) { |
| | | return ElMessage.error('修改聊天室名称失败'); |
| | | } |
| | | |
| | | activeChatRoom.value.title = inputValue.value; |
| | | activeChatRoom.value.isInitial = false; |
| | | router.push({ |