fix(multimodal): support HTML image tags in document extraction and chat responses
- Replace plain image URLs with `<img src="..." data-url="...">` HTML tags in multimodal and document extractor services - Propagate citations from workflow end events to client responses - Update system prompts to instruct LLMs to render images using Markdown `` with strict UUID-preserving URL copying
This commit is contained in:
@@ -650,7 +650,10 @@ class AgentRunService:
|
||||
)
|
||||
if has_doc_with_images:
|
||||
system_prompt += (
|
||||
"\n\n文档文字中包含图片位置标记如 [图片 第2页 第1张]: http://...,请在回答中用 Markdown 格式  展示对应图片。"
|
||||
"\n\n文档文字中包含图片位置标记如 [图片 第2页 第1张]: <img src=\"url\"...>,"
|
||||
"请在回答中用 Markdown 格式  展示对应图片。"
|
||||
"重要:图片 URL 中包含 UUID(如 /storage/permanent/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx),"
|
||||
"必须将 src 属性的值原封不动复制到 Markdown 的括号中,不得增删任何字符。"
|
||||
)
|
||||
|
||||
agent = LangChainAgent(
|
||||
@@ -924,7 +927,10 @@ class AgentRunService:
|
||||
)
|
||||
if has_doc_with_images:
|
||||
system_prompt += (
|
||||
"\n\n文档文字中包含图片位置标记如 [图片 第2页 第1张]: http://...,请在回答中用 Markdown 格式  展示对应图片。"
|
||||
"\n\n文档文字中包含图片位置标记如 [图片 第2页 第1张]: <img src=\"url\"...>,"
|
||||
"请在回答中用 Markdown 格式  展示对应图片。"
|
||||
"重要:图片 URL 中包含 UUID(如 /storage/permanent/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx),"
|
||||
"必须将 src 属性的值原封不动复制到 Markdown 的括号中,不得增删任何字符。"
|
||||
)
|
||||
|
||||
# 创建 LangChain Agent
|
||||
|
||||
Reference in New Issue
Block a user