-
Notifications
You must be signed in to change notification settings - Fork 5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: csv empty data * feat: user feedback and mark answer * version intro * perf: chat logs sort
- Loading branch information
Showing
32 changed files
with
886 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
### Fast GPT V4.2 | ||
### Fast GPT V4.2.2 | ||
|
||
1. 新增 - 应用日志初版,可观测到所有对话记录 | ||
2. 新增 - 好友邀请链接,[点击查看](/account?currentTab=promotion) | ||
3. 新增 - Iframe 嵌入页面图标可拖拽 | ||
4. 优化 - 知识库搜索提示词 | ||
5. 优化 - [使用文档](https://doc.fastgpt.run/docs/intro/) | ||
6. [点击查看高级编排介绍文档](https://doc.fastgpt.run/docs/workflow) | ||
1. **新增 - 用户反馈和管理员标注预期答案,以不断提高模型回复准确率。** 该功能为测试版,未来交互可能会有变化,欢迎大家提出宝贵意见。 | ||
2. 优化 - 知识库搜索提示词,更适配问答场景。 | ||
3. 新增 - 好友邀请链接,[点击查看](/account?currentTab=promotion) | ||
4. 优化 - [使用文档](https://doc.fastgpt.run/docs/intro/) | ||
5. [点击查看高级编排介绍文档](https://doc.fastgpt.run/docs/workflow) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export type AdminUpdateFeedbackParams = { | ||
chatItemId: string; | ||
kbId: string; | ||
dataId: string; | ||
content: string; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import React, { useRef } from 'react'; | ||
import { ModalBody, Textarea, ModalFooter, Button } from '@chakra-ui/react'; | ||
import MyModal from '../MyModal'; | ||
import { useRequest } from '@/hooks/useRequest'; | ||
import { useTranslation } from 'next-i18next'; | ||
import { userUpdateChatFeedback } from '@/api/chat'; | ||
|
||
const FeedbackModal = ({ | ||
chatItemId, | ||
onSuccess, | ||
onClose | ||
}: { | ||
chatItemId: string; | ||
onSuccess: (e: string) => void; | ||
onClose: () => void; | ||
}) => { | ||
const ref = useRef<HTMLTextAreaElement>(null); | ||
const { t } = useTranslation(); | ||
|
||
const { mutate, isLoading } = useRequest({ | ||
mutationFn: async () => { | ||
const val = ref.current?.value || 'N/A'; | ||
return userUpdateChatFeedback({ | ||
chatItemId, | ||
userFeedback: val | ||
}); | ||
}, | ||
onSuccess() { | ||
onSuccess(ref.current?.value || 'N/A'); | ||
}, | ||
successToast: t('chat.Feedback Success'), | ||
errorToast: t('chat.Feedback Failed') | ||
}); | ||
|
||
return ( | ||
<MyModal isOpen={true} onClose={onClose} title={t('chat.Feedback Modal')}> | ||
<ModalBody> | ||
<Textarea | ||
ref={ref} | ||
rows={10} | ||
placeholder={t('chat.Feedback Modal Tip') || 'chat.Feedback Modal Tip'} | ||
/> | ||
</ModalBody> | ||
<ModalFooter> | ||
<Button variant={'base'} mr={2} onClick={onClose}> | ||
{t('Cancel')} | ||
</Button> | ||
<Button isLoading={isLoading} onClick={mutate}> | ||
{t('chat.Feedback Submit')} | ||
</Button> | ||
</ModalFooter> | ||
</MyModal> | ||
); | ||
}; | ||
|
||
export default FeedbackModal; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import React from 'react'; | ||
import { ModalBody, ModalFooter, Button } from '@chakra-ui/react'; | ||
import MyModal from '../MyModal'; | ||
import { useRequest } from '@/hooks/useRequest'; | ||
import { useTranslation } from 'next-i18next'; | ||
import { userUpdateChatFeedback } from '@/api/chat'; | ||
|
||
const ReadFeedbackModal = ({ | ||
chatItemId, | ||
content, | ||
isMarked, | ||
onMark, | ||
onSuccess, | ||
onClose | ||
}: { | ||
chatItemId: string; | ||
content: string; | ||
isMarked: boolean; | ||
onMark: () => void; | ||
onSuccess: () => void; | ||
onClose: () => void; | ||
}) => { | ||
const { t } = useTranslation(); | ||
|
||
const { mutate, isLoading } = useRequest({ | ||
mutationFn: async () => { | ||
return userUpdateChatFeedback({ | ||
chatItemId, | ||
userFeedback: undefined | ||
}); | ||
}, | ||
onSuccess() { | ||
onSuccess(); | ||
}, | ||
errorToast: t('chat.Feedback Update Failed') | ||
}); | ||
|
||
return ( | ||
<MyModal isOpen={true} onClose={onClose} title={t('chat.Feedback Modal')}> | ||
<ModalBody>{content}</ModalBody> | ||
<ModalFooter> | ||
{!isMarked && ( | ||
<Button variant={'base'} mr={2} onClick={onMark}> | ||
{t('chat.Feedback Mark')} | ||
</Button> | ||
)} | ||
<Button isLoading={isLoading} onClick={mutate}> | ||
{t('chat.Feedback Close')} | ||
</Button> | ||
</ModalFooter> | ||
</MyModal> | ||
); | ||
}; | ||
|
||
export default React.memo(ReadFeedbackModal); |
Oops, something went wrong.