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} />
)
}

View File

@@ -46,7 +46,7 @@ const ChatItem: FC<ChatItemProps> = ({
const config = useConfigFromDebugContext()
const {
chatList,
isResponsing,
isResponding,
handleSend,
suggestedQuestions,
handleRestart,
@@ -118,7 +118,7 @@ const ChatItem: FC<ChatItemProps> = ({
<Chat
config={config}
chatList={chatList}
isResponsing={isResponsing}
isResponding={isResponding}
noChatInput
noStopResponding
chatContainerclassName='p-4'

View File

@@ -83,7 +83,7 @@ const TextGenerationItem: FC<TextGenerationItemProps> = ({
const {
completion,
handleSend,
isResponsing,
isResponding,
messageId,
} = useTextGeneration()
@@ -143,8 +143,8 @@ const TextGenerationItem: FC<TextGenerationItemProps> = ({
innerClassName='grow flex flex-col'
contentClassName='grow'
content={completion}
isLoading={!completion && isResponsing}
isResponsing={isResponsing}
isLoading={!completion && isResponding}
isResponding={isResponding}
isInstalledApp={false}
messageId={messageId}
isError={false}

View File

@@ -45,7 +45,7 @@ const DebugWithSingleModel = forwardRef<DebugWithSingleModelRefType, DebugWithSi
const config = useConfigFromDebugContext()
const {
chatList,
isResponsing,
isResponding,
handleSend,
suggestedQuestions,
handleStop,
@@ -118,7 +118,7 @@ const DebugWithSingleModel = forwardRef<DebugWithSingleModelRefType, DebugWithSi
<Chat
config={config}
chatList={chatList}
isResponsing={isResponsing}
isResponding={isResponding}
chatContainerclassName='p-6'
chatFooterClassName='px-6 pt-10 pb-4'
suggestedQuestions={suggestedQuestions}

View File

@@ -93,7 +93,7 @@ const Debug: FC<IDebug> = ({
}
}, [])
const [isResponsing, { setTrue: setResponsingTrue, setFalse: setResponsingFalse }] = useBoolean(false)
const [isResponding, { setTrue: setRespondingTrue, setFalse: setRespondingFalse }] = useBoolean(false)
const [isShowFormattingChangeConfirm, setIsShowFormattingChangeConfirm] = useState(false)
const [isShowCannotQueryDataset, setShowCannotQueryDataset] = useState(false)
@@ -191,7 +191,7 @@ const Debug: FC<IDebug> = ({
const [messageId, setMessageId] = useState<string | null>(null)
const sendTextCompletion = async () => {
if (isResponsing) {
if (isResponding) {
notify({ type: 'info', message: t('appDebug.errorMessage.waitForResponse') })
return false
}
@@ -277,7 +277,7 @@ const Debug: FC<IDebug> = ({
setMessageId('')
let res: string[] = []
setResponsingTrue()
setRespondingTrue()
sendCompletionMessage(appId, data, {
onData: (data: string, _isFirstMessage: boolean, { messageId }) => {
res.push(data)
@@ -289,10 +289,10 @@ const Debug: FC<IDebug> = ({
setCompletionRes(res.join(''))
},
onCompleted() {
setResponsingFalse()
setRespondingFalse()
},
onError() {
setResponsingFalse()
setRespondingFalse()
},
})
}
@@ -440,13 +440,13 @@ const Debug: FC<IDebug> = ({
{mode === AppType.completion && (
<div className="mt-6 px-6 pb-4">
<GroupName name={t('appDebug.result')} />
{(completionRes || isResponsing) && (
{(completionRes || isResponding) && (
<TextGeneration
className="mt-2"
content={completionRes}
isLoading={!completionRes && isResponsing}
isLoading={!completionRes && isResponding}
isShowTextToSpeech={textToSpeechConfig.enabled && !!text2speechDefaultModel}
isResponsing={isResponsing}
isResponding={isResponding}
isInstalledApp={false}
messageId={messageId}
isError={false}

View File

@@ -32,7 +32,7 @@ export type IGenerationItemProps = {
messageId?: string | null
conversationId?: string
isLoading?: boolean
isResponsing?: boolean
isResponding?: boolean
isInWebApp?: boolean
moreLikeThis?: boolean
depth?: number
@@ -81,7 +81,7 @@ const GenerationItem: FC<IGenerationItemProps> = ({
content,
messageId,
isLoading,
isResponsing,
isResponding,
moreLikeThis,
isInWebApp = false,
feedback,
@@ -277,7 +277,7 @@ const GenerationItem: FC<IGenerationItemProps> = ({
<div className='flex items-center justify-between mt-3'>
<div className='flex items-center'>
{
!isInWebApp && !isInstalledApp && !isResponsing && (
!isInWebApp && !isInstalledApp && !isResponding && (
<PromptLog
log={promptLog}
containerRef={ref}