fix: 去掉用户气泡中<>的显示

This commit is contained in:
ZyGuo committed 2026-06-03 11:33:23 +08:00
1 parent 8ba3a67401
commit cb0b30690e
3 files changed
+35 -17

No files matched your search

@@ -32,11 +32,16 @@ test("parses iframe text, page context, and screenshot into a prompt message", (
assert.equal(result.submitText, [
"提取并翻译",
"<attached_image_priority>\nA screenshot image is attached for this message.\nUse the attached image as the primary source of truth.\nUse page context and text prompt only as supporting context.\nIf the image conflicts with page context or text, trust the image.\n</attached_image_priority>",
"<extension_prompt>\n提取图片中的文字并翻译成简体中文\n</extension_prompt>",
"<page_context>\n<title>\nUN News\n</title>\n\n<url>\nhttps://news.un.org/example\n</url>\n\n<content>\nBanning children from social media is not the answer.\n</content>\n</page_context>",
].join("\n\n"));
assert.deepEqual(result.iframeContext, { brainy_request_id: "iframe-123" });
assert.equal(
result.additionalKwargs?.prompt_prefix,
[
"<attached_image_priority>\nA screenshot image is attached for this message.\nUse the attached image as the primary source of truth.\nUse page context and text prompt only as supporting context.\nIf the image conflicts with page context or text, trust the image.\n</attached_image_priority>",
"<extension_prompt>\n提取图片中的文字并翻译成简体中文\n</extension_prompt>",
"<page_context>\n<title>\nUN News\n</title>\n\n<url>\nhttps://news.un.org/example\n</url>\n\n<content>\nBanning children from social media is not the answer.\n</content>\n</page_context>",
].join("\n\n"),
);
assert.equal(result.files.length, 1);
assert.equal(result.files[0]?.type, "file");
assert.equal(result.files[0]?.filename, "capture.png");
@@ -65,8 +70,9 @@ test("keeps screenshot-only iframe submissions in the conversation flow", () =>
},
});
assert.equal(result.submitText, "");
assert.equal(
result.submitText,
result.additionalKwargs?.prompt_prefix,
"<attached_image_priority>\nA screenshot image is attached for this message.\nUse the attached image as the primary source of truth.\nUse page context and text prompt only as supporting context.\nIf the image conflicts with page context or text, trust the image.\n</attached_image_priority>",
);
assert.equal(result.files.length, 1);