可信代码库-AI大模型批量对话接口对话及对话功能开发
This commit is contained in:
@@ -145,13 +145,11 @@ import WarningList from './components/WarningList.vue';
|
||||
import OssDetail from './components/OssDetail.vue';
|
||||
import Other from './components/Other.vue';
|
||||
import AIList from './components/AIList.vue';
|
||||
import { getChat } from '@/api/jyh';
|
||||
import axios from 'axios';
|
||||
import { useDiscussGetUserInfo } from '@/api/discussion/hook';
|
||||
|
||||
// 获取当前用户信息 & 是否登录
|
||||
const { isLogin = false, userInfo = {}} = useDiscussGetUserInfo();
|
||||
debugger
|
||||
|
||||
const inputValue = ref('');
|
||||
const startChat = ref(false);
|
||||
@@ -214,6 +212,7 @@ const onSubmit = (e, answer = undefined) => {
|
||||
getAIAnswer(e,1);
|
||||
};
|
||||
|
||||
const VITE_AI_API_HOST = (import.meta as any).env.VITE_AI_API_HOST;
|
||||
const getAIAnswer = async (content) => {
|
||||
messages.value.push({
|
||||
from: 'ai-model',
|
||||
@@ -224,8 +223,7 @@ const getAIAnswer = async (content) => {
|
||||
loading: true,
|
||||
});
|
||||
|
||||
const {data} = await axios.get('http://222.20.126.208:8089/api/v0/chat_use_sql?question='+content);
|
||||
debugger
|
||||
const {data} = await axios.get(VITE_AI_API_HOST + '/api/v0/chat_use_sql?question='+content);
|
||||
const {text,type} = data;
|
||||
|
||||
if(type==='text') {
|
||||
|
||||
Reference in New Issue
Block a user