mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-15 22:46:49 +00:00
[feature](weaapp) add agent
This commit is contained in:
@@ -7,7 +7,7 @@ const axiosInstance: AxiosInstance = axios.create({
|
||||
// 设置基本URL,所有请求都会使用这个URL作为前缀
|
||||
baseURL: '',
|
||||
// 设置请求超时时间(毫秒)
|
||||
timeout: 60000,
|
||||
timeout: 120000,
|
||||
// 设置请求头
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
|
||||
@@ -25,11 +25,12 @@ export function chatQuery(queryText: string, chatId?: number, modelId?: number,
|
||||
});
|
||||
}
|
||||
|
||||
export function chatParse(queryText: string, chatId?: number, modelId?: number, filters?: any[]) {
|
||||
export function chatParse(queryText: string, chatId?: number, modelId?: number, agentId?: number, filters?: any[]) {
|
||||
return axios.post<Result<ParseDataType>>(`${prefix}/chat/query/parse`, {
|
||||
queryText,
|
||||
chatId: chatId || DEFAULT_CHAT_ID,
|
||||
modelId,
|
||||
agentId,
|
||||
queryFilters: filters ? {
|
||||
filters
|
||||
} : undefined,
|
||||
@@ -63,10 +64,6 @@ export function queryContext(queryText: string, chatId?: number) {
|
||||
});
|
||||
}
|
||||
|
||||
export function querySuggestionInfo(modelId: number) {
|
||||
return axios.get<Result<any>>(`${prefix}/chat/recommend/${modelId}`);
|
||||
}
|
||||
|
||||
export function getHistoryMsg(current: number, chatId: number = DEFAULT_CHAT_ID, pageSize: number = 10) {
|
||||
return axios.post<Result<HistoryType>>(`${prefix}/chat/manage/pageQueryInfo?chatId=${chatId}`, {
|
||||
current,
|
||||
@@ -74,22 +71,6 @@ export function getHistoryMsg(current: number, chatId: number = DEFAULT_CHAT_ID,
|
||||
});
|
||||
}
|
||||
|
||||
export function queryMetricInfo(data: any) {
|
||||
return axios.get(`/semantic/metric/getMetric/${data.classId}/${data.uniqueId}`);
|
||||
}
|
||||
|
||||
export function getRelatedDimensionFromStatInfo(data: any) {
|
||||
return axios.get(
|
||||
`/semantic/metric/getRelatedDimensionFromStatInfo/${data.classId}/${data.uniqueId}`,
|
||||
);
|
||||
}
|
||||
|
||||
export function getMetricQueryInfo(data: any) {
|
||||
return axios.get<any>(
|
||||
`/openapi/bd-bi/api/polaris/intelligentQuery/getMetricQueryInfo/${data.classId}/${data.metricName}`
|
||||
);
|
||||
}
|
||||
|
||||
export function saveConversation(chatName: string) {
|
||||
return axios.post<Result<any>>(`${prefix}/chat/manage/save?chatName=${chatName}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user