-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Agent response parse error #11978
Comments
@Lz020316 Hello there! I'm here to help you with any bugs, questions, or contributions you have in mind. Let's tackle this issue together while we wait for a human maintainer. Dify currently does not support embedding interactive HTML content, such as the HTML file with JavaScript and CSS for particle effects, in its LLM response box. This limitation means that attempts to include such content in agent responses will likely result in parse errors or unexpected behavior [1]. To address this, consider providing a link to an external resource where the HTML content can be viewed or executed, or simplify the response to exclude interactive elements. To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other |
I think this problem can be solved. It's currently in the market, chatgpt,Claude, There are still many model platforms that support replying to HTML language. I don't think there should be a situation where it displays as empty, which is a bug. Another issue is that the markdown language supports HTML language, for example <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Particle Effect</title>
<style>
body {
margin: 0;
overflow: hidden;
background-color: #000;
}
canvas {
display: block;
}
</style>
</head>
<body>
<canvas id="particleCanvas"></canvas>
<script>
const canvas = document.getElementById('particleCanvas');
const ctx = canvas.getContext('2d');
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
class Particle {
constructor(x, y) {
this.x = x;
this.y = y;
this.size = Math.random() * 5 + 1;
this.speedX = Math.random() * 3 - 1.5;
this.speedY = Math.random() * 3 - 1.5;
}
update() {
this.x += this.speedX;
this.y += this.speedY;
if (this.size > 0.1) this.size -= 0.05;
}
draw() {
ctx.fillStyle = 'rgba(255, 255, 255, 0.8)';
ctx.beginPath();
ctx.arc(this.x, this.y, this.size, 0, Math.PI * 2);
ctx.closePath();
ctx.fill();
}
}
const particlesArray = [];
function animate() {
ctx.clearRect(0, 0, canvas.width, canvas.height);
for (let i = 0; i < particlesArray.length; i++) {
particlesArray[i].update();
particlesArray[i].draw();
if (particlesArray[i].size <= 0.1) {
particlesArray.splice(i, 1);
i--;
}
}
if (particlesArray.length < 100) {
const x = Math.random() * canvas.width;
const y = Math.random() * canvas.height;
particlesArray.push(new Particle(x, y));
}
requestAnimationFrame(animate);
}
animate();
</script>
</body>
</html> |
Self Checks
Dify version
0.11.1
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
The following is the content replied by the agent
The content displayed on the page is as follows:
✔️ Expected Behavior
No response
❌ Actual Behavior
No response
The text was updated successfully, but these errors were encountered: