Integrate Chat and Copilot into chat-sdk, and add SQL parse display (#166)

This commit is contained in:
williamhliu
2023-10-02 18:05:12 +08:00
committed by GitHub
parent 741ed4191b
commit 71cb20eb4f
68 changed files with 1353 additions and 882 deletions

View File

@@ -0,0 +1,51 @@
import axios from '../service/axiosInstance';
import { isMobile } from '../utils/utils';
import { AgentType, ModelType } from './type';
const prefix = isMobile ? '/openapi' : '/api';
export function saveConversation(chatName: string, agentId: number) {
return axios.post<any>(
`${prefix}/chat/manage/save?chatName=${chatName}&agentId=${agentId}`
);
}
export function updateConversationName(chatName: string, chatId: number = 0) {
return axios.post<any>(
`${prefix}/chat/manage/updateChatName?chatName=${chatName}&chatId=${chatId}`,
);
}
export function deleteConversation(chatId: number) {
return axios.post<any>(`${prefix}/chat/manage/delete?chatId=${chatId}`);
}
export function getAllConversations(agentId?: number) {
return axios.get<any>(`${prefix}/chat/manage/getAll`, { params: { agentId } });
}
export function getModelList() {
return axios.get<ModelType[]>(`${prefix}/chat/conf/modelList/view`);
}
export function updateQAFeedback(questionId: number, score: number) {
return axios.post<any>(
`${prefix}/chat/manage/updateQAFeedback?id=${questionId}&score=${score}&feedback=`,
);
}
export function queryMetricSuggestion(modelId: number) {
return axios.get<any>(`${prefix}/chat/recommend/metric/${modelId}`);
}
export function querySuggestion(modelId: number) {
return axios.get<any>(`${prefix}/chat/recommend/${modelId}`);
}
export function queryRecommendQuestions() {
return axios.get<any>(`${prefix}/chat/recommend/question`);
}
export function queryAgentList() {
return axios.get<AgentType[]>(`${prefix}/chat/agent/getAgentList`);
}