Skip to content

feat: add prompt template management for agent generation#2925

Open
2h0u4n wants to merge 13 commits into
ModelEngine-Group:developfrom
2h0u4n:real_prompt_template
Open

feat: add prompt template management for agent generation#2925
2h0u4n wants to merge 13 commits into
ModelEngine-Group:developfrom
2h0u4n:real_prompt_template

Conversation

@2h0u4n
Copy link
Copy Markdown
Contributor

@2h0u4n 2h0u4n commented May 3, 2026

本次 PR 为快速配置第三步“描述业务逻辑”新增了提示词模板功能。用户可以在大语言模型上方选择提示词模板,并在“管理模板”中完成新增、查看、编辑、删除。模板按用户维度入库保存,支持中文必填、英文选填;系统默认模板可查看但不可编辑、删除,并支持从 YAML 自动同步到数据库。生成智能体时会基于所选模板生成角色、使用要求和示例,同时保存模板选择信息到智能体配置中,并补充了对应的后端测试文件。
ef381eec9abfc5d08725490db31d9723
8be07a6bd56fd80b9f278564667836a9
5f33078e52b52ca69271ec3d1ac7b620

@2h0u4n 2h0u4n requested review from Dallas98 and WMC001 as code owners May 3, 2026 05:00
Comment thread backend/consts/const.py
Comment thread backend/consts/model.py Outdated
Comment thread backend/services/agent_service.py
if agent_info.get("prompt_template_id") is None:
agent_info["prompt_template_id"] = SYSTEM_PROMPT_TEMPLATE_ID
if not agent_info.get("prompt_template_name"):
agent_info["prompt_template_name"] = SYSTEM_PROMPT_TEMPLATE_NAME
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

为什么一个地方用is None一个地方用not,如果prompt_template_id不可能传“”空字符串的话,可以统一用if not

Comment thread backend/utils/prompt_template_utils.py Outdated
Comment thread frontend/public/locales/en/common.json Outdated
"businessLogic.config.template.manageDescription": "Choose a prompt template for generation, or create your own private templates.",
"businessLogic.config.template.create": "New Template",
"businessLogic.config.template.edit": "Edit",
"businessLogic.config.template.delete": "Delete",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

编辑和删除是否可以定义在common里,或者看看是不是以及存在了

@2h0u4n 2h0u4n force-pushed the real_prompt_template branch 2 times, most recently from cea068d to cc8cf6f Compare May 11, 2026 11:31
@WMC001 WMC001 self-assigned this May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants