尧图建网站 尧图建网站 YAOTU WEB BUILD 免费咨询
ARTICLE DETAIL

资讯详情

深耕网站建设与建站编程的一线实战洞察。

Code Agent 系统提示词是怎么组装的

Code Agent 系统提示词是怎么组装的 结论:发给 LLM 的 messages = [system] Constitution ← L1:身份、语气、安全、工作方式 [system] Tool Contracts ← 各工具的自然语言用法说明 [system] Project Rules ← 仓库里的 code_law.md(若有) [system] Runtime Signals ← 运行时通知块(可变) [system] Session Memory ← 跨轮摘要前馈(可选,在 ContextEngine 注入) + history 投影后的 user/assistant/tool/...四层(加可选的 session memory)合在一起,才是 agent 的「人格 + 能力说明书 + 项目记忆」。和 Function Calling 的关系要先分清:通道内容走哪Tool Contracts(本文)自然语言:怎么用、什么时候用、响应长什么样prompts/tools_prompts/*.py→ system 消息tools schema(下一篇)JSON Schema:参数名、类型、requiredToolRegistry.get_openai_tools()→ API 的
返回列表