mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-31 19:38:41 +00:00
perf: ui
This commit is contained in:
@@ -10,7 +10,7 @@ import type { Props as UpdateHistoryProps } from '@/pages/api/chat/history/updat
|
||||
/**
|
||||
* 获取初始化聊天内容
|
||||
*/
|
||||
export const getInitChatSiteInfo = (data: { appId: string; historyId?: string }) =>
|
||||
export const getInitChatSiteInfo = (data: { appId: string; chatId?: string }) =>
|
||||
GET<InitChatResponse>(`/chat/init`, data);
|
||||
|
||||
/**
|
||||
@@ -27,14 +27,14 @@ export const delChatHistoryById = (id: string) => GET(`/chat/removeHistory?id=${
|
||||
/**
|
||||
* get history quotes
|
||||
*/
|
||||
export const getHistoryQuote = (params: { historyId: string; contentId: string }) =>
|
||||
export const getHistoryQuote = (params: { chatId: string; contentId: string }) =>
|
||||
GET<(QuoteItemType & { _id: string })[]>(`/chat/history/getHistoryQuote`, params);
|
||||
|
||||
/**
|
||||
* update history quote status
|
||||
*/
|
||||
export const updateHistoryQuote = (params: {
|
||||
historyId: string;
|
||||
chatId: string;
|
||||
contentId: string;
|
||||
quoteId: string;
|
||||
sourceText: string;
|
||||
@@ -43,7 +43,7 @@ export const updateHistoryQuote = (params: {
|
||||
/**
|
||||
* 删除一句对话
|
||||
*/
|
||||
export const delChatRecordByIndex = (data: { historyId: string; contentId: string }) =>
|
||||
export const delChatRecordByIndex = (data: { chatId: string; contentId: string }) =>
|
||||
DELETE(`/chat/delChatRecordByContentId`, data);
|
||||
|
||||
/**
|
||||
|
@@ -19,7 +19,7 @@ export const streamFetch = ({
|
||||
new Promise<{
|
||||
responseText: string;
|
||||
errMsg: string;
|
||||
newHistoryId: string | null;
|
||||
newChatId: string | null;
|
||||
[rawSearchKey]: QuoteItemType[];
|
||||
}>(async (resolve, reject) => {
|
||||
try {
|
||||
@@ -45,7 +45,7 @@ export const streamFetch = ({
|
||||
let responseText = '';
|
||||
let rawSearch: QuoteItemType[] = [];
|
||||
let errMsg = '';
|
||||
const newHistoryId = response.headers.get('newHistoryId');
|
||||
const newChatId = response.headers.get('newChatId');
|
||||
|
||||
const read = async () => {
|
||||
try {
|
||||
@@ -55,7 +55,7 @@ export const streamFetch = ({
|
||||
return resolve({
|
||||
responseText,
|
||||
errMsg,
|
||||
newHistoryId,
|
||||
newChatId,
|
||||
rawSearch
|
||||
});
|
||||
} else {
|
||||
@@ -95,7 +95,7 @@ export const streamFetch = ({
|
||||
return resolve({
|
||||
responseText,
|
||||
errMsg,
|
||||
newHistoryId,
|
||||
newChatId,
|
||||
rawSearch
|
||||
});
|
||||
}
|
||||
|
1
client/src/api/response/chat.d.ts
vendored
1
client/src/api/response/chat.d.ts
vendored
@@ -13,7 +13,6 @@ export interface InitChatResponse {
|
||||
intro: string;
|
||||
canUse: boolean;
|
||||
};
|
||||
customTitle?: string;
|
||||
title: string;
|
||||
variables: Record<string, any>;
|
||||
history: ChatItemType[];
|
||||
|
Reference in New Issue
Block a user