Skip to content

关于“自动补充图片域名”的问题 #4635

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

Open
5 of 7 tasks
kenxt opened this issue Apr 23, 2025 · 4 comments
Open
5 of 7 tasks

关于“自动补充图片域名”的问题 #4635

kenxt opened this issue Apr 23, 2025 · 4 comments
Labels
bug Something isn't working

Comments

@kenxt
Copy link

kenxt commented Apr 23, 2025

例行检查

  • 我已确认目前没有类似 issue
  • 我已完整查看过项目 README,以及项目文档
  • 我使用了自己的 key,并确认我的 key 是可正常使用的
  • 我理解并愿意跟进此 issue,协助测试和提供反馈
  • 我理解并认可上述内容,并理解项目维护者精力有限,不遵循规则的 issue 可能会被无视或直接关闭

你的版本

  • 公有云版本
  • 私有部署版本, 具体版本号:

问题描述, 日志截图,配置文件等
新版本的4.9.6增加了一个功能:知识库工具调用结果,自动补充图片域名,不知道该功能的机制是怎么样的。目前出现了自传图片无法显示的问题,pdf文档解析为markdown,部分图片手动修正过,手动上传到前端nginx静态服务器专用location /images下,知识库中图片显示正常,但回答问题时一定几率下会根据内容为图片补充一个与内容相关的域名了,导致图片无法显示。
pdf文档解析base64嵌入的图片在知识库中为: /api/system/img/图片名称,显示均正常
复现步骤
系统架构:nginx---location / upstream fastgpt
--- locaton /images static dir
markdown添加到知识库,其中图片嵌入:

Image

图片文件上传到location /images下,在知识库中可以正常显示,问答后偶发不显示域名被替换补充为相关域名。
预期结果
图片正常显示
相关截图

Image

@kenxt kenxt added the bug Something isn't working label Apr 23, 2025
@c121914yu
Copy link
Collaborator

环境变量中,增加 fedomain 字段后,发给模型时候会自动补充前缀

@kenxt
Copy link
Author

kenxt commented Apr 23, 2025

已经配置了环境变量,如下图:

Image

@c121914yu
Copy link
Collaborator

c121914yu commented Apr 25, 2025

你图片链接为啥这么奇怪,手动的?手动的为啥不是全链接

@kenxt
Copy link
Author

kenxt commented Apr 26, 2025

架构是下面的样子:

Image

因为用MinerU解析pdf时部分图片有问题,需要替换,替换的图片就放在/images下面了,在知识库中修改或增加图片链接时用的是相对目录,比如:

Image

的格式,如果指定域名肯定是没有问题的,目前是这种情况下调用,偶发被替换为与内容有关(文本中出现过)的域名。这么设置主要是考虑图片调用域名不和域名绑定,如果支持知识库编辑时在文本框中粘贴图片实现上传就更好了。类似github编辑框这样。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants