mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-14 18:56:00 +08:00
fix(agent app): moderation feature can't work as expected (#16794)
This commit is contained in:
parent
8b89447549
commit
0722beeb0b
@ -11,10 +11,12 @@ import { getProcessedFilesFromResponse } from '@/app/components/base/file-upload
|
|||||||
type AgentContentProps = {
|
type AgentContentProps = {
|
||||||
item: ChatItem
|
item: ChatItem
|
||||||
responding?: boolean
|
responding?: boolean
|
||||||
|
content?: string
|
||||||
}
|
}
|
||||||
const AgentContent: FC<AgentContentProps> = ({
|
const AgentContent: FC<AgentContentProps> = ({
|
||||||
item,
|
item,
|
||||||
responding,
|
responding,
|
||||||
|
content,
|
||||||
}) => {
|
}) => {
|
||||||
const {
|
const {
|
||||||
annotation,
|
annotation,
|
||||||
@ -26,7 +28,7 @@ const AgentContent: FC<AgentContentProps> = ({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
{agent_thoughts?.map((thought, index) => (
|
{content ? <Markdown content={content} /> : agent_thoughts?.map((thought, index) => (
|
||||||
<div key={index} className='px-2 py-1'>
|
<div key={index} className='px-2 py-1'>
|
||||||
{thought.thought && (
|
{thought.thought && (
|
||||||
<Markdown content={thought.thought} />
|
<Markdown content={thought.thought} />
|
||||||
|
@ -164,10 +164,11 @@ const Answer: FC<AnswerProps> = ({
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
hasAgentThoughts && (
|
(hasAgentThoughts || content) && (
|
||||||
<AgentContent
|
<AgentContent
|
||||||
item={item}
|
item={item}
|
||||||
responding={responding}
|
responding={responding}
|
||||||
|
content={content}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user