mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-22 12:20:34 +00:00
Doc (#2910)
* feat: add app chat openapi (#2908) * add chat openapi * create question guide openapi * change auth method * add chat openapi doc * delete unused code * feat: chat openapi doc * rerank doc * add chat detail openapi & doc * update chat openapi doc --------- Co-authored-by: heheer <heheer@sealos.io> Co-authored-by: heheer <1239331448@qq.com>
This commit is contained in:
@@ -55,22 +55,22 @@ export const adaptStringValue = (value: any): ChatItemValueItemType[] => {
|
||||
export const addCustomFeedbacks = async ({
|
||||
appId,
|
||||
chatId,
|
||||
chatItemId,
|
||||
dataId,
|
||||
feedbacks
|
||||
}: {
|
||||
appId: string;
|
||||
chatId?: string;
|
||||
chatItemId?: string;
|
||||
dataId?: string;
|
||||
feedbacks: string[];
|
||||
}) => {
|
||||
if (!chatId || !chatItemId) return;
|
||||
if (!chatId || !dataId) return;
|
||||
|
||||
try {
|
||||
await MongoChatItem.findOneAndUpdate(
|
||||
{
|
||||
appId,
|
||||
chatId,
|
||||
dataId: chatItemId
|
||||
dataId
|
||||
},
|
||||
{
|
||||
$push: { customFeedbacks: { $each: feedbacks } }
|
||||
|
@@ -17,7 +17,7 @@ export const dispatchCustomFeedback = (props: Record<string, any>): Response =>
|
||||
const {
|
||||
runningAppInfo: { id: appId },
|
||||
chatId,
|
||||
responseChatItemId: chatItemId,
|
||||
responseChatItemId: dataId,
|
||||
stream,
|
||||
workflowStreamResponse,
|
||||
params: { system_textareaInput: feedbackText = '' }
|
||||
@@ -27,13 +27,13 @@ export const dispatchCustomFeedback = (props: Record<string, any>): Response =>
|
||||
addCustomFeedbacks({
|
||||
appId,
|
||||
chatId,
|
||||
chatItemId,
|
||||
dataId,
|
||||
feedbacks: [feedbackText]
|
||||
});
|
||||
}, 60000);
|
||||
|
||||
if (stream) {
|
||||
if (!chatId || !chatItemId) {
|
||||
if (!chatId || !dataId) {
|
||||
workflowStreamResponse?.({
|
||||
event: SseResponseEventEnum.fastAnswer,
|
||||
data: textAdaptGptResponse({
|
||||
|
Reference in New Issue
Block a user