Support simpleApp select workflow (#2772)

* fix: share page id error

* feat: simple workflow support childApp tool

* perf: aichat box animation
This commit is contained in:
Archer
2024-09-23 15:43:57 +08:00
committed by shilin66
parent 66b2eb3a0b
commit 8e0edaace1
14 changed files with 83 additions and 51 deletions

View File

@@ -95,7 +95,7 @@ const AIContentCard = React.memo(function AIContentCard({
<AIResponseBox
key={key}
value={value}
isLastChild={isLastChild && i === chatValue.length - 1}
isLastResponseValue={isLastChild && i === chatValue.length - 1}
isChatting={isChatting}
/>
);

View File

@@ -33,7 +33,7 @@ const RenderOutput = () => {
<AIResponseBox
key={key}
value={value}
isLastChild={true}
isLastResponseValue={true}
isChatting={isChatting}
/>
);

View File

@@ -110,9 +110,9 @@ const RenderPluginInput = ({
*
</Box>
)}
{input.label}
{t(input.label as any)}
</Box>
{input.description && <QuestionTip ml={2} label={input.description} />}
{input.description && <QuestionTip ml={2} label={t(input.description as any)} />}
</Flex>
{render}
</Box>

View File

@@ -24,7 +24,7 @@ import { onSendPrompt } from '../ChatContainer/useChat';
type props = {
value: UserChatItemValueItemType | AIChatItemValueItemType;
isLastChild: boolean;
isLastResponseValue: boolean;
isChatting: boolean;
};
@@ -167,11 +167,13 @@ const RenderInteractive = React.memo(function RenderInteractive({
);
});
const AIResponseBox = ({ value, isLastChild, isChatting }: props) => {
const AIResponseBox = ({ value, isLastResponseValue, isChatting }: props) => {
if (value.type === ChatItemValueTypeEnum.text && value.text)
return <RenderText showAnimation={isChatting && isLastChild} text={value.text.content} />;
return (
<RenderText showAnimation={isChatting && isLastResponseValue} text={value.text.content} />
);
if (value.type === ChatItemValueTypeEnum.tool && value.tools)
return <RenderTool showAnimation={isChatting && isLastChild} tools={value.tools} />;
return <RenderTool showAnimation={isChatting} tools={value.tools} />;
if (
value.type === ChatItemValueTypeEnum.interactive &&
value.interactive &&