fix typo: responsing -> responding (#2718)

Co-authored-by: OSS-MAOLONGDONG\kaihong <maolongdong@kaihong.com>
This commit is contained in:
Lance Mao
2024-03-07 10:20:35 +08:00
committed by GitHub
parent 31070ffbca
commit 7052565380
19 changed files with 127 additions and 127 deletions

View File

@@ -49,7 +49,7 @@ export type IAnswerProps = {
onQueryChange: (query: string) => void
onFeedback?: FeedbackFunc
displayScene: DisplayScene
isResponsing?: boolean
isResponding?: boolean
answerIcon?: ReactNode
citation?: CitationItem[]
dataSets?: DataSet[]
@@ -74,7 +74,7 @@ const Answer: FC<IAnswerProps> = ({
isHideFeedbackEdit = false,
onFeedback,
displayScene = 'web',
isResponsing,
isResponding,
answerIcon,
citation,
isShowCitation,
@@ -229,7 +229,7 @@ const Answer: FC<IAnswerProps> = ({
<Thought
thought={item}
allToolIcons={allToolIcons || {}}
isFinished={!!item.observation || !isResponsing}
isFinished={!!item.observation || !isResponding}
/>
)}
@@ -248,7 +248,7 @@ const Answer: FC<IAnswerProps> = ({
{
answerIcon || (
<div className={`${s.answerIcon} w-10 h-10 shrink-0`}>
{isResponsing
{isResponding
&& <div className={s.typeingIcon}>
<LoadingAnim type='avatar' />
</div>
@@ -260,7 +260,7 @@ const Answer: FC<IAnswerProps> = ({
<div className={`${s.answerWrap} ${showEdit ? 'w-full' : ''}`}>
<div className={`${s.answer} relative text-sm text-gray-900`}>
<div className={'ml-2 py-3 px-4 bg-gray-100 rounded-tr-2xl rounded-b-2xl'}>
{(isResponsing && (isAgentMode ? (!content && (agent_thoughts || []).filter(item => !!item.thought || !!item.tool).length === 0) : !content))
{(isResponding && (isAgentMode ? (!content && (agent_thoughts || []).filter(item => !!item.thought || !!item.tool).length === 0) : !content))
? (
<div className='flex items-center justify-center w-6 h-5'>
<LoadingAnim type='text' />
@@ -314,7 +314,7 @@ const Answer: FC<IAnswerProps> = ({
</div>
)}
{
!!citation?.length && isShowCitation && !isResponsing && (
!!citation?.length && isShowCitation && !isResponding && (
<Citation data={citation} showHitInfo={isShowCitationHitInfo} />
)
}

View File

@@ -49,9 +49,9 @@ export type IChatProps = {
onSend?: (message: string, files: VisionFile[]) => void
displayScene?: DisplayScene
useCurrentUserAvatar?: boolean
isResponsing?: boolean
canStopResponsing?: boolean
abortResponsing?: () => void
isResponding?: boolean
canStopResponding?: boolean
abortResponding?: () => void
controlClearQuery?: number
controlFocus?: number
isShowSuggestion?: boolean
@@ -82,9 +82,9 @@ const Chat: FC<IChatProps> = ({
onSend = () => { },
displayScene,
useCurrentUserAvatar,
isResponsing,
canStopResponsing,
abortResponsing,
isResponding,
canStopResponding,
abortResponding,
controlClearQuery,
controlFocus,
isShowSuggestion,
@@ -153,7 +153,7 @@ const Chat: FC<IChatProps> = ({
if (!files.find(item => item.type === TransferMethod.local_file && !item.fileId)) {
if (files.length)
onClear()
if (!isResponsing)
if (!isResponding)
onQueryChange('')
}
}
@@ -286,7 +286,7 @@ const Chat: FC<IChatProps> = ({
isHideFeedbackEdit={isHideFeedbackEdit}
onFeedback={onFeedback}
displayScene={displayScene ?? 'web'}
isResponsing={isResponsing && isLast}
isResponding={isResponding && isLast}
answerIcon={answerIcon}
citation={citation}
dataSets={dataSets}
@@ -311,7 +311,7 @@ const Chat: FC<IChatProps> = ({
useCurrentUserAvatar={useCurrentUserAvatar}
item={item}
isShowPromptLog={isShowPromptLog}
isResponsing={isResponsing}
isResponding={isResponding}
/>
)
})}
@@ -320,9 +320,9 @@ const Chat: FC<IChatProps> = ({
!isHideSendInput && (
<div className={cn(!feedbackDisabled && '!left-3.5 !right-3.5', 'absolute z-10 bottom-0 left-0 right-0')}>
{/* Thinking is sync and can not be stopped */}
{(isResponsing && canStopResponsing && ((!!chatList[chatList.length - 1]?.content) || (chatList[chatList.length - 1]?.agent_thoughts && chatList[chatList.length - 1].agent_thoughts!.length > 0))) && (
{(isResponding && canStopResponding && ((!!chatList[chatList.length - 1]?.content) || (chatList[chatList.length - 1]?.agent_thoughts && chatList[chatList.length - 1].agent_thoughts!.length > 0))) && (
<div className='flex justify-center mb-4'>
<Button className='flex items-center space-x-1 bg-white' onClick={() => abortResponsing?.()}>
<Button className='flex items-center space-x-1 bg-white' onClick={() => abortResponding?.()}>
{stopIcon}
<span className='text-xs text-gray-500 font-normal'>{t('appDebug.operation.stopResponding')}</span>
</Button>

View File

@@ -13,10 +13,10 @@ import ImageGallery from '@/app/components/base/image-gallery'
type IQuestionProps = Pick<IChatItem, 'id' | 'content' | 'more' | 'useCurrentUserAvatar'> & {
isShowPromptLog?: boolean
item: IChatItem
isResponsing?: boolean
isResponding?: boolean
}
const Question: FC<IQuestionProps> = ({ id, content, more, useCurrentUserAvatar, isShowPromptLog, item, isResponsing }) => {
const Question: FC<IQuestionProps> = ({ id, content, more, useCurrentUserAvatar, isShowPromptLog, item, isResponding }) => {
const { userProfile } = useContext(AppContext)
const userName = userProfile?.name
const ref = useRef(null)
@@ -28,7 +28,7 @@ const Question: FC<IQuestionProps> = ({ id, content, more, useCurrentUserAvatar,
<div className={`${s.question} group relative text-sm text-gray-900`}>
{
isShowPromptLog && !isResponsing && (
isShowPromptLog && !isResponding && (
<Log log={item.log!} containerRef={ref} />
)
}