Repository navigation
feat: 生图支持 reference_subject,画真实产品时找参考图 - #384
Merged
Merged
Conversation
- generate_image 新增 reference_subject,由模型在需要画准某个真实对象时显式填写,不按提示词猜。 - 透传给 image-service #20;记录 reference_search 状态与参考图数量。 - 没找到参考图(none_accepted / search_failed)时,回复要如实告诉用户外观可能和真品不同。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
改动
image-service #20 上线了自动找参考图:调用方传入
reference_subject,服务先用 Tavily 搜图,再由视觉模型筛选,最后带 1 张背面参考图出图。Fusion 这边:
generate_image新增可选参数reference_subject(≤80 字符)。工具说明要求:只有在需要画准某个真实对象(具体产品型号、车型、建筑、地标)时,才按用户原话填写它的名字;通用、虚构或风格化的主体不填。由模型显式选择,后端不从提示词里猜。reference_search.status和reference_images_used,写入结果数据:reference_subject、reference_search_status、reference_image_count。none_accepted或search_failed时,图照常出,但回复上下文会要求模型如实告诉用户:没找到参考图,外观可能和真品不同。prompt参数的说明不变,仍然要求不要自己编外观细节。验证
test_image_service_tools.py、test_mcp_agent_tools.py共 75 个测试通过,新增参数校验和四种状态的上下文测试;prompt 目录相关测试 19 个通过;ruff 无报错。reference_subject、端到端出图),合并部署后用「iPhone 18 Pro 产品宣发图」测一次。🤖 Generated with Claude Code