Skip to content

Commit

Permalink
fix typo: responsing -> responding (#2718)
Browse files Browse the repository at this point in the history
Co-authored-by: OSS-MAOLONGDONG\kaihong <maolongdong@kaihong.com>
  • Loading branch information
lancemao and OSS-MAOLONGDONG\kaihong authored Mar 7, 2024
1 parent 31070ff commit 7052565
Show file tree
Hide file tree
Showing 19 changed files with 127 additions and 127 deletions.
12 changes: 6 additions & 6 deletions web/app/components/app/chat/answer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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[]
Expand All @@ -74,7 +74,7 @@ const Answer: FC<IAnswerProps> = ({
isHideFeedbackEdit = false,
onFeedback,
displayScene = 'web',
isResponsing,
isResponding,
answerIcon,
citation,
isShowCitation,
Expand Down Expand Up @@ -229,7 +229,7 @@ const Answer: FC<IAnswerProps> = ({
<Thought
thought={item}
allToolIcons={allToolIcons || {}}
isFinished={!!item.observation || !isResponsing}
isFinished={!!item.observation || !isResponding}
/>
)}

Expand All @@ -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>
Expand All @@ -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' />
Expand Down Expand Up @@ -314,7 +314,7 @@ const Answer: FC<IAnswerProps> = ({
</div>
)}
{
!!citation?.length && isShowCitation && !isResponsing && (
!!citation?.length && isShowCitation && !isResponding && (
<Citation data={citation} showHitInfo={isShowCitationHitInfo} />
)
}
Expand Down
22 changes: 11 additions & 11 deletions web/app/components/app/chat/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -82,9 +82,9 @@ const Chat: FC<IChatProps> = ({
onSend = () => { },
displayScene,
useCurrentUserAvatar,
isResponsing,
canStopResponsing,
abortResponsing,
isResponding,
canStopResponding,
abortResponding,
controlClearQuery,
controlFocus,
isShowSuggestion,
Expand Down Expand Up @@ -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('')
}
}
Expand Down Expand Up @@ -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}
Expand All @@ -311,7 +311,7 @@ const Chat: FC<IChatProps> = ({
useCurrentUserAvatar={useCurrentUserAvatar}
item={item}
isShowPromptLog={isShowPromptLog}
isResponsing={isResponsing}
isResponding={isResponding}
/>
)
})}
Expand All @@ -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>
Expand Down
6 changes: 3 additions & 3 deletions web/app/components/app/chat/question/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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} />
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const ChatItem: FC<ChatItemProps> = ({
const config = useConfigFromDebugContext()
const {
chatList,
isResponsing,
isResponding,
handleSend,
suggestedQuestions,
handleRestart,
Expand Down Expand Up @@ -118,7 +118,7 @@ const ChatItem: FC<ChatItemProps> = ({
<Chat
config={config}
chatList={chatList}
isResponsing={isResponsing}
isResponding={isResponding}
noChatInput
noStopResponding
chatContainerclassName='p-4'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const TextGenerationItem: FC<TextGenerationItemProps> = ({
const {
completion,
handleSend,
isResponsing,
isResponding,
messageId,
} = useTextGeneration()

Expand Down Expand Up @@ -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}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const DebugWithSingleModel = forwardRef<DebugWithSingleModelRefType, DebugWithSi
const config = useConfigFromDebugContext()
const {
chatList,
isResponsing,
isResponding,
handleSend,
suggestedQuestions,
handleStop,
Expand Down Expand Up @@ -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}
Expand Down
16 changes: 8 additions & 8 deletions web/app/components/app/configuration/debug/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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)
Expand All @@ -289,10 +289,10 @@ const Debug: FC<IDebug> = ({
setCompletionRes(res.join(''))
},
onCompleted() {
setResponsingFalse()
setRespondingFalse()
},
onError() {
setResponsingFalse()
setRespondingFalse()
},
})
}
Expand Down Expand Up @@ -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}
Expand Down
6 changes: 3 additions & 3 deletions web/app/components/app/text-generate/item/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export type IGenerationItemProps = {
messageId?: string | null
conversationId?: string
isLoading?: boolean
isResponsing?: boolean
isResponding?: boolean
isInWebApp?: boolean
moreLikeThis?: boolean
depth?: number
Expand Down Expand Up @@ -81,7 +81,7 @@ const GenerationItem: FC<IGenerationItemProps> = ({
content,
messageId,
isLoading,
isResponsing,
isResponding,
moreLikeThis,
isInWebApp = false,
feedback,
Expand Down Expand Up @@ -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}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const ChatWrapper = () => {
chatList,
handleSend,
handleStop,
isResponsing,
isResponding,
suggestedQuestions,
} = useChat(
appConfig,
Expand Down Expand Up @@ -130,7 +130,7 @@ const ChatWrapper = () => {
<Chat
config={appConfig}
chatList={chatList}
isResponsing={isResponsing}
isResponding={isResponding}
chatContainerInnerClassName={`mx-auto pt-6 w-full max-w-[720px] ${isMobile && 'px-4'}`}
chatFooterClassName='pb-4'
chatFooterInnerClassName={`mx-auto w-full max-w-[720px] ${isMobile && 'px-4'}`}
Expand Down
6 changes: 3 additions & 3 deletions web/app/components/base/chat/chat/answer/agent-content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ import type { Emoji } from '@/app/components/tools/types'

type AgentContentProps = {
item: ChatItem
responsing?: boolean
responding?: boolean
allToolIcons?: Record<string, string | Emoji>
}
const AgentContent: FC<AgentContentProps> = ({
item,
responsing,
responding,
allToolIcons,
}) => {
const {
Expand Down Expand Up @@ -46,7 +46,7 @@ const AgentContent: FC<AgentContentProps> = ({
<Thought
thought={thought}
allToolIcons={allToolIcons || {}}
isFinished={!!thought.observation || !responsing}
isFinished={!!thought.observation || !responding}
/>
)}

Expand Down
14 changes: 7 additions & 7 deletions web/app/components/base/chat/chat/answer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type AnswerProps = {
index: number
config?: ChatConfig
answerIcon?: ReactNode
responsing?: boolean
responding?: boolean
allToolIcons?: Record<string, string | Emoji>
}
const Answer: FC<AnswerProps> = ({
Expand All @@ -34,7 +34,7 @@ const Answer: FC<AnswerProps> = ({
index,
config,
answerIcon,
responsing,
responding,
allToolIcons,
}) => {
const { t } = useTranslation()
Expand All @@ -58,7 +58,7 @@ const Answer: FC<AnswerProps> = ({
)
}
{
responsing && (
responding && (
<div className='absolute -top-[3px] -left-[3px] pl-[6px] flex items-center w-4 h-4 bg-white rounded-full shadow-xs border-[0.5px] border-gray-50'>
<LoadingAnim type='avatar' />
</div>
Expand All @@ -70,7 +70,7 @@ const Answer: FC<AnswerProps> = ({
<AnswerTriangle className='absolute -left-2 top-0 w-2 h-3 text-gray-100' />
<div className='group relative inline-block px-4 py-3 max-w-full bg-gray-100 rounded-b-2xl rounded-tr-2xl text-sm text-gray-900'>
{
!responsing && (
!responding && (
<Operation
item={item}
question={question}
Expand All @@ -79,7 +79,7 @@ const Answer: FC<AnswerProps> = ({
)
}
{
responsing && !content && !hasAgentThoughts && (
responding && !content && !hasAgentThoughts && (
<div className='flex items-center justify-center w-6 h-5'>
<LoadingAnim type='text' />
</div>
Expand All @@ -94,7 +94,7 @@ const Answer: FC<AnswerProps> = ({
hasAgentThoughts && (
<AgentContent
item={item}
responsing={responsing}
responding={responding}
allToolIcons={allToolIcons}
/>
)
Expand All @@ -109,7 +109,7 @@ const Answer: FC<AnswerProps> = ({
}
<SuggestedQuestions item={item} />
{
!!citation?.length && config?.retriever_resource?.enabled && !responsing && (
!!citation?.length && config?.retriever_resource?.enabled && !responding && (
<Citation data={citation} showHitInfo={config.supportCitationHitInfo} />
)
}
Expand Down
Loading

0 comments on commit 7052565

Please sign in to comment.