0Pricing
AI Prompt Engineering · 课时

指定受众

针对专家、初学者、儿童、高管或普通受众调整输出

指定受众 是 CoddyKit 上的免费 AI Prompt Engineering 课时。 这是第 2 节课,共 4 节。 你可以在下方免费阅读本课时的完整内容 — 然后在浏览器中使用内置代码编辑器和全天候 AI 导师进行实践。 这是 AI Prompt Engineering 学习路径的一部分,你的进度在网页和 CoddyKit 应用中同步。 AI Prompt Engineering 课程共包含 4 节课。

受众:最少被使用的提示变量

在可以添加到提示中的各种明确性维度里,指定受众对输出质量的提升最稳定、最显著。

同样是解释“机器学习”,面向 10 岁儿童的版本与面向资深机器学习研究人员的版本,所使用的词汇和结构几乎不应有任何相似之处。如果没有受众背景,模型会选择一个折中版本——对任何特定人群都不够有用。

以年龄为依据的受众锚点

按年龄指定受众是最简单、也最普遍易懂的方法。模型见过数百万份面向不同年龄群体撰写的内容,因此会相应调整词汇、复杂程度和类比方式。

  • “面向 10 岁儿童” → 简单词汇、具体类比、短句
  • “面向高中生” → 更抽象一些,默认读者具备基础数学素养
  • “面向大学毕业生” → 默认读者掌握一般学术词汇
import anthropic

client = anthropic.Anthropic(api_key='sk-ant-your-key-here')

ages = ['a 10-year-old', 'a 16-year-old high school student', 'a college graduate with no CS background']

for age in ages:
    response = client.messages.create(
        model='claude-opus-4-5',
        max_tokens=80,
        messages=[{
            'role': 'user',
            'content': f'Explain what a computer CPU does in 2 sentences for {age}.'
        }]
    )
    print(f'Audience ({age}):')
    print(response.content[0].text.strip())
    print()

基于角色的受众定义

基于角色的受众描述对专业内容最为有效。它会说明:

  • 这个人的工作内容
  • 这个人掌握的领域知识
  • 这个人最关心的事情
  • 这个人提出问题的动机

示例:

  • “面向了解用户研究但不了解工程的产品经理”
  • “面向以 ROI 和季度数据为思考方式的 CFO”
  • “面向了解 JavaScript 但不了解数据库的初级开发人员”
import openai

client = openai.OpenAI(api_key='sk-your-key-here')

audiences = [
    'a product manager who understands user flows but has no coding background',
    'a CFO evaluating whether to approve a $200k infrastructure investment',
    'a first-year developer who knows Python but has never worked with APIs'
]

topic = 'why our system needs a message queue (like RabbitMQ or Kafka)'

for audience in audiences:
    response = client.chat.completions.create(
        model='gpt-4o',
        max_tokens=100,
        messages=[{
            'role': 'user',
            'content': f'Explain {topic} for {audience}. 2 sentences maximum.'
        }]
    )
    print(f'Audience: {audience[:55]}...')
    print(response.choices[0].message.content.strip())
    print()

面向非技术高管

非技术高管是人工智能生成内容的常见受众。他们需要:

  • 业务影响,而不是技术细节
  • 以 ROI、风险或竞争优势为框架呈现的数据
  • 可以直接用于决策的建议,而不是需要自行分析的选项
  • 除非经过解释,否则不要使用缩略语
  • 不要提供实施细节

关键措辞是:“面向将要作出是否推进决策的非技术高管”

import anthropic

client = anthropic.Anthropic(api_key='sk-ant-your-key-here')

response = client.messages.create(
    model='claude-opus-4-5',
    max_tokens=200,
    messages=[{
        'role': 'user',
        'content': (
            'Explain why we should migrate from our custom authentication system '
            'to Auth0 or Okta.\n\n'
            'Audience: non-technical CEO and CFO who will make the go/no-go decision.\n'
            'Format: 3 bullet points — one per business benefit.\n'
            'Language: no technical jargon. Frame entirely in business value. '
            'Each bullet: max 20 words.'
        )
    }]
)
print(response.content[0].text)

面向资深软件工程师

资深软件工程师需要的内容与高管摘要恰恰相反。他们需要:

  • 技术上的精确性——确切的版本、应用程序接口和算法名称
  • 权衡分析——成本和风险是什么
  • 实施层面的细节
  • 明确陈述假设
  • 无需手把手指导,也不要过度解释

请使用:“面向熟悉分布式系统的资深软件工程师”

import openai

client = openai.OpenAI(api_key='sk-your-key-here')

response = client.chat.completions.create(
    model='gpt-4o',
    messages=[{
        'role': 'user',
        'content': (
            'Explain the trade-offs between using PostgreSQL advisory locks vs Redis distributed locks '
            'for preventing duplicate job processing.\n\n'
            'Audience: senior backend engineer with 8+ years experience, familiar with '
            'CAP theorem, knows Redis and PostgreSQL internals.\n'
            'Format: 4-bullet trade-off analysis — no intro, no conclusion. '
            'Assume expert-level knowledge throughout. No definitions needed.'
        )
    }]
)
print(response.choices[0].message.content)

面向营销专业人士

营销专业人士关注:

  • 客户沟通和市场定位
  • 竞争差异化
  • 转化率和参与度指标
  • 品牌表达风格的一致性
  • 特定渠道的格式(搜索引擎优化、电子邮件、社交媒体)

他们 NOT 需要技术实施细节——他们需要充分理解价值主张,从而能够有说服力地传达它。

import anthropic

client = anthropic.Anthropic(api_key='sk-ant-your-key-here')

response = client.messages.create(
    model='claude-opus-4-5',
    max_tokens=300,
    messages=[{
        'role': 'user',
        'content': (
            'Explain our new AI-powered search feature to our marketing team.\n\n'
            'Audience: marketing professionals who run email campaigns, SEO, and social media. '
            'They understand marketing KPIs but not ML or engineering.\n'
            'What they need to know:\n'
            '1. What customer problem it solves (in customer language, not tech language)\n'
            '2. How to message it in campaigns (key benefit in one memorable sentence)\n'
            '3. Which customer segment benefits most (for targeting)\n'
            'The feature: semantic search that finds relevant results even when keywords do not match.'
        )
    }]
)
print(response.content[0].text)

以受众知识为锚点

最精确的受众定义方式,是将角色与他们已经掌握的知识结合起来:

“面向每天使用电子表格和结构化查询语言、但从未构建过机器学习模型的数据分析师。”

这种锚定技巧可以:

  • 告诉模型读者已经掌握哪些词汇
  • 告诉模型哪些内容需要解释,哪些内容可以默认读者了解
  • 避免过度解释(显得居高临下)和解释不足(让人困惑)
import openai

client = openai.OpenAI(api_key='sk-your-key-here')

anchored_audiences = [
    'a data analyst who uses Excel and SQL daily but has never used Python',
    'a Python developer who knows pandas and numpy but has never used machine learning',
    'an ML engineer who knows sklearn but has never worked with deep learning frameworks'
]

for audience in anchored_audiences:
    response = client.chat.completions.create(
        model='gpt-4o',
        max_tokens=80,
        messages=[{
            'role': 'user',
            'content': (
                f'Explain what a neural network is in 2 sentences for {audience}. '
                f'Build on what they already know — use it as an analogy anchor.'
            )
        }]
    )
    print(f'Audience: {audience[:60]}...')
    print(response.choices[0].message.content.strip())
    print()

受众与内容格式

不同受众偏好的格式各不相同。同样的信息应针对不同受众采用不同的格式:

  • 高管 → 3 条要点的决策简报,不使用技术术语
  • 工程师 → 带有代码片段的编号步骤,不要手把手指导
  • 销售团队 → 先讲益处,再列出功能,并提供异议处理方案
  • 最终用户 → 对话式操作指南,分步骤说明,语气友好
  • 开发人员(文档) → 简洁、精确、以代码为先,不添加多余的说明性文字
import anthropic

client = anthropic.Anthropic(api_key='sk-ant-your-key-here')

aggregated_prompt = (
    'We launched two-factor authentication (2FA) for our SaaS app. '
    'Generate one short piece of communication for each of the following audiences. '
    'Label each section clearly.\n\n'
    '1. EXECUTIVES (2 bullets, business risk/benefit framing)\n'
    '2. ENGINEERS (numbered steps to enable and test 2FA in dev)\n'
    '3. END USERS (2-sentence friendly explanation of what to do next time they log in)\n'
    'Total: 120 words maximum across all three sections.'
)

response = client.messages.create(
    model='claude-opus-4-5',
    max_tokens=250,
    messages=[{'role': 'user', 'content': aggregated_prompt}]
)
print(response.content[0].text)

受众定义模式

以下是最有效的受众定义模式:

  • 角色 + 知识差距:“面向了解用户旅程但不了解数据架构的产品经理”
  • 角色 + 目标:“面向下周一将向董事会展示这份内容的 CTO”
  • 角色 + 现有工具:“面向目前使用 HubSpot、正在评估另一款客户关系管理平台的营销人员”
  • 角色 + 顾虑:“面向对云端托管人工智能工具持怀疑态度的安全工程师”
import openai

client = openai.OpenAI(api_key='sk-your-key-here')

# Role + concern pattern: most useful for persuasive content
skeptic_audience = (
    'For a CISO (Chief Information Security Officer) at a regulated financial institution '
    'who is skeptical about AI tools handling sensitive customer data. '
    'They prioritize: data residency, audit trails, and regulatory compliance.'
)

response = client.chat.completions.create(
    model='gpt-4o',
    messages=[{
        'role': 'user',
        'content': (
            f'Audience: {skeptic_audience}\n\n'
            f'Write a 3-bullet summary of why our AI document processing tool is safe to use. '
            f'Focus entirely on their specific concerns. '
            f'Each bullet: max 20 words. No marketing language.'
        )
    }]
)
print(response.choices[0].message.content)

面向混合受众的文档

有些文档同时服务于多个受众——例如既会被技术用户阅读,也会被业务相关方阅读的产品公告。

策略是:将文档组织成多个部分,每个部分面向不同的受众。为各部分添加标签,让读者能够找到所需内容:

  • 高管摘要(面向管理层)
  • 主要益处(面向最终用户)
  • 技术细节(面向工程师)
  • 入门指南(面向实施人员)
import anthropic

client = anthropic.Anthropic(api_key='sk-ant-your-key-here')

response = client.messages.create(
    model='claude-opus-4-5',
    max_tokens=400,
    messages=[{
        'role': 'user',
        'content': (
            'Write a new feature release note for our API v2 launch. '
            'Structure for mixed audiences:\n'
            '## For Leadership (2 bullets: business impact only)\n'
            '## For Developers (2 bullets: breaking changes + migration path)\n'
            '## For End Users (1 sentence: what changes for them)\n'
            'Feature: API v2 processes requests 3x faster, adds webhook support, '
            'but deprecates the /v1/upload endpoint.'
        )
    }]
)
print(response.content[0].text)

受众反馈循环

完善受众定义的最佳方法,是运行反馈循环:使用 generate 生成内容,评估内容是否符合目标读者的需求,然后调整受众描述并重新生成。

常见的完善信号:

  • 过于技术化 → 添加“没有编程背景”或“解释所有缩略语”
  • 过于基础 → 添加“假设读者熟悉 X”或“跳过基础知识”
  • 语气不对 → 添加“他们时间紧迫”或“他们对人工智能持怀疑态度”
  • 角度不对 → 添加“他们最关心成本,而不是功能”
import openai

client = openai.OpenAI(api_key='sk-your-key-here')

# Audience refinement loop
def generate_for_audience(topic, audience_spec):
    response = client.chat.completions.create(
        model='gpt-4o',
        max_tokens=100,
        messages=[{
            'role': 'user',
            'content': f'Audience: {audience_spec}\n\nExplain in 2 sentences: {topic}'
        }]
    )
    return response.choices[0].message.content.strip()

topic = 'why we need database backups'

# Iteration 1: too broad
v1 = generate_for_audience(topic, 'business professional')
print('v1 (too broad):', v1[:120])

# Iteration 2: refined with role + concern
v2 = generate_for_audience(topic, 'non-technical e-commerce founder who lost sales data once before and is skeptical of IT advice')
print('v2 (refined):', v2[:120])

知识检查

一名开发人员需要向三个不同的受众解释数据库事务,却为三者撰写了完全相同的解释。这种做法的主要问题是什么?

指定您的受众——回顾

指定受众是目前最稳定、投资回报率最高的提示改进方法。请掌握以下模式:

  • 基于年龄:“面向 10 岁儿童”/“面向大学毕业生”
  • 基于角色:“面向了解用户流程但不了解代码的产品经理”
  • 以知识为锚点:“了解 SQL 但从未使用过另一种编程语言的人”
  • 以目标为锚点:“下周一将作出是否推进决策的人”
  • 以顾虑为锚点:“对云端托管人工智能工具持怀疑态度的人”
  • 对于混合受众:使用带标签的部分进行组织,每个受众对应一个部分

常见问题解答

「指定受众」课时是免费的吗?

是的 — 「指定受众」的完整文本可在网页上免费阅读。要进行交互式练习(内置代码编辑器和全天候 AI 导师)并解锁 AI Prompt Engineering 课程的其余内容,请升级到 CoddyKit PRO。 AI Prompt Engineering 课程共包含 4 节课。

「指定受众」这节课中我会学到什么?

针对专家、初学者、儿童、高管或普通受众调整输出 你通过在浏览器中直接运行的动手代码来练习 AI Prompt Engineering,全天候 AI 导师会在你学习这节课的过程中回答你的问题。

学习 AI Prompt Engineering 需要有经验吗?

无需任何先前经验。CoddyKit 上的 AI Prompt Engineering 课程适合初学者到高级学习者,你可以从这里开始或从头开始,按照自己的节奏学习。 这是第 2 节课,共 4 节。

「指定受众」课时需要多长时间?

大多数 CoddyKit 课程大约需要 5–10 分钟。每节课都很精短且互动,所以你能稳步进步,并在网页和应用中从离开的地方继续。

我能在这节 AI Prompt Engineering 课中编写并运行代码吗?

能。每节 AI Prompt Engineering 课都包含内置代码编辑器,你可以在浏览器中直接编写并运行真实代码,并获得即时 AI 反馈 — 无需本地设置。

此课程中的所有课时

  1. 正式语气与非正式语气
  2. 指定受众
  3. 专业写作风格
  4. 调整词汇难度
← 返回 AI Prompt Engineering