| | |
| | | import { GetLLMList, SetLLM } from '/@/api/ai/chat'; |
| | | import PlayBar from '/@/components/chat/components/playBar/PlayBar.vue'; |
| | | import router from '/@/router'; |
| | | import { activeChatRoom } from '/@/stores/chatRoom'; |
| | | import { activeChatRoom, activeLLMId, activeSectionAId } from '/@/stores/chatRoom'; |
| | | import emitter from '/@/utils/mitt'; |
| | | import { ElMessage } from 'element-plus'; |
| | | const emits = defineEmits(['sendClick']); |
| | | const inputValue = ref(''); |
| | | |
| | | const sendClick = () => { |
| | | if (!inputValue.value) return; |
| | | if (!activeSectionAId.value) { |
| | | ElMessage.warning('请选择应用场景'); |
| | | return; |
| | | } |
| | | activeChatRoom.value.title = inputValue.value; |
| | | router.push({ |
| | | name: 'AskAnswer', |
| | |
| | | activeRole: 0, |
| | | }); |
| | | |
| | | const activeLLMId = ref(); |
| | | const llmList = ref([]); |
| | | const iconList = ['/static/images/wave/Glm.jpg', '/static/images/wave/Glm.jpg', '/static/images/wave/Glm.jpg']; |
| | | const getLLMList = async () => { |
| | |
| | | }; |
| | | |
| | | const setLLm = async (llmId: string) => { |
| | | |
| | | const res = await SetLLM({ |
| | | llm: llmId, |
| | | }); |
| | | // const res = await SetLLM({ |
| | | // llm: llmId, |
| | | // }); |
| | | activeLLMId.value = llmId; |
| | | |
| | | return true; |
| | |
| | | |
| | | onMounted(() => { |
| | | getLLMList(); |
| | | emitter.on('updateChatInput', (value) => { |
| | | inputValue.value = value; |
| | | }); |
| | | }); |
| | | </script> |
| | | <style scoped lang="scss"> |