Prompt engineering

简介: 本文介绍如何结合Markdown与XML优化提示词:Markdown用于结构化分节(如标题、列表),提升可读性;XML则通过标签及属性清晰界定内容边界与元数据。典型开发者消息含身份、指令、示例、上下文四部分,助力模型精准理解意图。(239字)

Message formatting with Markdown and XML
When writing developer and user messages, you can help the model understand logical boundaries of your prompt and context data using a combination of Markdown formatting and XML tags.

Markdown headers and lists can be helpful to mark distinct sections of a prompt, and to communicate hierarchy to the model. They can also potentially make your prompts more readable during development. XML tags can help delineate where one piece of content (like a supporting document used for reference) begins and ends. XML attributes can also be used to define metadata about content in the prompt that can be referenced by your instructions.

In general, a developer message will contain the following sections, usually in this order (though the exact optimal content and order may vary by which model you are using):

Identity: Describe the purpose, communication style, and high-level goals of the assistant.
Instructions: Provide guidance to the model on how to generate the response you want. What rules should it follow? What should the model do, and what should the model never do? This section could contain many subsections as relevant for your use case, like how the model should call custom functions.
Examples: Provide examples of possible inputs, along with the desired output from the model.
Context: Give the model any additional information it might need to generate a response, like private/proprietary data outside its training data, or any other data you know will be particularly relevant. This content is usually best positioned near the end of your prompt, as you may include different context for different generation requests.

目录
相关文章
|
1天前
|
人工智能 自然语言处理 安全
OpenAI Evals:先定义成功,再让 Agent 上线
本文剖析OpenAI Evals在AI测试中的本质:不重“回答像不像人”,而重“业务动作是否可靠”。主张将Agent测试拆解为三层——硬规则(代码断言决策/调用/禁语)、边界(工具顺序与权限)、表达(LLM Judge评分)。强调用可版本化的YAML用例固化业务契约,以结构化输出+固定夹具保障回归稳定性,并建立“P0硬失败零容忍”的发布门禁。
|
1天前
|
缓存
TokenPlan的Credits怎么计费?1个Credits不等于固定Token数,Qwen3.6‑Plus计算示例解析
阿里云百炼Token Plan按Credits动态计费,1 Credits不等于固定Token数。消耗由模型类型(如qwen3.6-plus)、Token数量、思考模式、工具调用及缓存命中等共同决定。示例显示:8,349输入Token≈1.67 Credits,573输出Token≈0.69 Credits,合计约4 Credits。百万Tokens成本低至1.12元,较按量计费最高省44%。详情以官网为准。在阿里云百炼官网:https://t.aliyun.com/U/fPVHqY 免费领取千万Tokens
37 3
|
1天前
|
人工智能 自然语言处理 安全
阿里云AI数智鉴密:AI 生成内容如何拿到一张"防篡改的身份证"
隐形水印 + C2PA签名:让AI生成内容“持证上岗”。
1088 0
|
10天前
|
人工智能 自然语言处理 安全
阿里云千问办公、Qoder Teams、Qoder CN区别与选择指南:模型能力、适用场景与最新活动参考
本文聚焦阿里云2026年推出的三款自研AI办公产品,清晰拆解千问办公、Qoder Teams、Qoder CN的差异化定位与能力边界:千问办公主打职场全场景提效,支持自然语言指令一键完成PPT生成、数据分析等高频办公任务;Qoder Teams面向程序员团队,深度整合AI代码生成、团队协同与企业知识库能力;Qoder CN则专为金融、政务等强合规场景打造,实现数据不出境与VPC私有化部署。文章同步给出分场景选型指南与最新活动定价,帮助不同类型的企业按需组合产品,实现业务岗、研发岗与强合规场景的AI能力全覆盖。
3621 3
阿里云千问办公、Qoder Teams、Qoder CN区别与选择指南:模型能力、适用场景与最新活动参考
|
22天前
|
人工智能 缓存 前端开发
DeepSeek Harness 首发实测 + 入门教程,夯爆了!梁神我错了
DeepSeek Harness + DeepSeek V4 Pro 项目实战保姆级教程!手把手带你从零安装开源 AI 编程工具,开发架构图、知识讲解网站、3D 网页游戏、全栈 AI 应用 4 个项目,覆盖运行模式选择、插件安装与开发,看看能不能对标 Claude。
13355 91
DeepSeek Harness 首发实测 + 入门教程,夯爆了!梁神我错了
|
15天前
|
Web App开发 人工智能 API
16 个超火的 DeepSeek Harness 插件,大肥鱼已经落后 N 个版本了。。。
DeepSeek Harness 精选插件推荐合集,从图片识别、浏览器操控、多 Agent 协作到手机远程控制,一口气带你看完 DSH 社区热门的十几个插件,覆盖技能扩展、UI 界面增强、整活玩法三大类,让你的鲸鱼变得更强。
1883 5
|
8天前
|
人工智能 监控 测试技术
Qwen3.8-Flash 来了,100万上下文、Agent、Coding 都加强了
8月26日,通义千问发布Qwen3.8-Flash-Next:125B参数、每Token仅激活6B,原生支持26万Token、可扩展至100万上下文;Coding、Agent与工具调用能力显著增强,面向真实软件工程任务,推动大模型从“回答问题”迈向“完成工作”。
|
11天前
|
人工智能 Linux iOS开发
Ollama使用教程:Ollama官网下载、Ollama本地部署大模型(2026最新)
Ollama 是一款免费开源的本地大模型运行工具,支持在 Windows/macOS/Linux 上离线运行 Qwen、DeepSeek、Llama 等主流开源模型,数据不出本机、隐私安全。提供 OpenAI 兼容 API,命令行一键拉取/运行/管理模型,无需联网,无调用限制,是开发者与 AI 爱好者部署本地 AI 助手的理想选择。(239 字)