正式语气与非正式语气
在提示中指定专业、轻松、学术或对话式的表达风格
正式语气与非正式语气 是 CoddyKit 上的免费 AI Prompt Engineering 课时。 这是第 1 节课,共 4 节。 你可以在下方免费阅读本课时的完整内容 — 然后在浏览器中使用内置代码编辑器和全天候 AI 导师进行实践。 这是 AI Prompt Engineering 学习路径的一部分,你的进度在网页和 CoddyKit 应用中同步。 AI Prompt Engineering 课程共包含 4 节课。
语气:内容的声音
语气是指文字带给读者的感受。同样的信息可以使用正式、权威的语调表达,也可以使用随意、友好的语调表达——正确的选择完全取决于您的受众、渠道和目标。
人工智能模型几乎可以复现您描述的任何语气,但您必须明确说明。没有指示时,它们通常默认使用略显正式且中性的语域。
正式写作的特点
正式写作具有以下特点:
- 不使用缩约形式,而使用完整表达
- 不使用口语化表达或俚语
- 在可能的情况下使用第三人称视角
- 使用完整且语法结构复杂的句子
- 偶尔使用被动语态
- 准确使用技术词汇
- 未作介绍时不直接使用名字
import anthropic
client = anthropic.Anthropic(api_key='sk-ant-your-key-here')
formal_instruction = (
'Write in a formal, professional tone. '
'No contractions. No colloquialisms. No first-person pronouns. '
'Use complete, grammatically precise sentences. '
'Vocabulary: professional but accessible — not academic jargon.'
)
response = client.messages.create(
model='claude-opus-4-5',
max_tokens=150,
messages=[{
'role': 'user',
'content': (
f'{formal_instruction}\n\n'
f'Explain why we are updating our privacy policy.'
)
}]
)
print(response.content[0].text)随意写作的特点
随意写作具有以下特点:
- 经常使用缩略形式(例如“我们是”“您将”“它是”)
- 使用对话式词汇
- 使用更短的句子和段落
- 使用第一人称和第二人称(我、您、我们)
- 偶尔加入幽默、温暖感或个性
- 向读者提出问题
- 使用来自日常生活的贴近读者的示例
import openai
client = openai.OpenAI(api_key='sk-your-key-here')
casual_instruction = (
'Write in a casual, friendly tone. '
'Use contractions freely. Use "you" to address the reader directly. '
'Keep sentences short. Add warmth and personality. '
'Write like you would explain this to a friend over coffee.'
)
response = client.chat.completions.create(
model='gpt-4o',
max_tokens=150,
messages=[{
'role': 'user',
'content': (
f'{casual_instruction}\n\n'
f'Explain why we are updating our privacy policy.'
)
}]
)
print(response.choices[0].message.content)相同内容的三种语气
理解语气最快的方法,是观察同一内容以多种语域书写时的差异。我们使用一个简单场景:通知用户我们的应用将在周六晚上停机维护。
我们将使用三种语气来撰写:正式的企业语气、随意的初创企业语气和学术语气。请注意词汇、句子结构以及与读者之间的关系如何发生变化。
import anthropic
client = anthropic.Anthropic(api_key='sk-ant-your-key-here')
tones = [
('CORPORATE FORMAL',
'Formal, no contractions, passive voice acceptable, corporate vocabulary. No personality.'),
('STARTUP CASUAL',
'Casual, contractions OK, friendly, empathetic, slightly playful. Address reader as "you".'),
('ACADEMIC',
'Precise, objective, technical vocabulary, third person, no emotion, no contractions.')
]
for label, tone_desc in tones:
response = client.messages.create(
model='claude-opus-4-5',
max_tokens=80,
messages=[{
'role': 'user',
'content': (
f'Tone: {tone_desc}\n\n'
f'Write a 2-sentence notification: our app will be down for maintenance '
f'on Saturday from 11 PM to 2 AM UTC.'
)
}]
)
print(f'[{label}]')
print(response.content[0].text.strip())
print()使用形容词指定语气
最简单的语气指定方式,是列出描述性形容词:
- “使用自信、直接、不拐弯抹角的语气”
- “使用温暖、富有同理心、鼓励性的语气”
- “使用活泼、风趣、略带不敬的语气”
- “使用严肃、权威、精准的语气”
请使用 2 至 4 个能够体现不同维度的形容词:活力水平、正式程度、情绪温度和个性特征。
import openai
client = openai.OpenAI(api_key='sk-your-key-here')
test_tones = [
'confident, direct, no-nonsense',
'warm, empathetic, encouraging',
'playful, witty, slightly irreverent',
]
for tone in test_tones:
response = client.chat.completions.create(
model='gpt-4o',
max_tokens=60,
messages=[{
'role': 'user',
'content': (
f'Tone: {tone}.\n\n'
f'Write one sentence of marketing copy for a new AI writing tool. '
f'Audience: busy startup founders.'
)
}]
)
print(f'Tone ({tone}):')
print(response.choices[0].message.content.strip())
print()使用模型角色设定指定语气
基于角色设定的语气描述通常比单独使用形容词更精确。与其说“友好”,不如说“像某项目管理工具的产品博客那样写——轻松但有思考,绝不居高临下。”
您可以引用现实世界中的写作风格:
- “像某支付平台的技术博客文章”
- “像保罗·格雷厄姆写创业文章时那样”
- “像《哈佛商业评论》的高管摘要”
- “像一位您所敬重的同事发来的友好即时消息”
import anthropic
client = anthropic.Anthropic(api_key='sk-ant-your-key-here')
references = [
'Write like a Stripe technical blog post: clear, precise, respects the reader\'s intelligence.',
'Write like a Harvard Business Review executive summary: formal, data-driven, concise.',
'Write like a friendly Slack message from a helpful colleague — casual, direct, gets to the point.'
]
topic = 'Why our new feature reduces API response time by 40%.'
for ref in references:
response = client.messages.create(
model='claude-opus-4-5',
max_tokens=80,
messages=[{
'role': 'user',
'content': f'Style reference: {ref}\n\nWrite 2 sentences about: {topic}'
}]
)
print(f'Style: {ref[:55]}...')
print(response.content[0].text.strip())
print()语气不匹配及其代价
当表达方式与受众或情境不匹配时,就会出现语气不匹配。常见的不匹配包括:
- 面向消费者的移动应用使用正式的企业语言
- 法律合同中使用随意的俚语
- 给非技术用户发送的支持邮件使用过于技术化的语言
- 工程 README 中使用夸张吹捧的营销用语
不匹配的语气会侵蚀信任,迫使读者花更多力气才能理解含义。
import openai
client = openai.OpenAI(api_key='sk-your-key-here')
# Mismatched tone examples
mismatches = [
(
'ERROR MESSAGE for a consumer app:',
'Formal legal tone: no contractions, passive voice',
'A fatal error has been encountered in the processing of your request.'
),
(
'LEGAL TERMS section:',
'Casual startup tone: contractions, emojis',
'Hey, so like, you gotta agree to our stuff before using this app okay?'
)
]
for context, bad_tone, example in mismatches:
response = client.chat.completions.create(
model='gpt-4o',
max_tokens=80,
messages=[{
'role': 'user',
'content': (
f'CONTEXT: {context}\n'
f'PROBLEM (wrong tone): {example}\n\n'
f'Rewrite with the correct tone for the context. '
f'One sentence. Explain in brackets why this tone works better.'
)
}]
)
print(response.choices[0].message.content.strip())
print()控制情感温度
除了正式程度之外,语气还有情感温度之分——从冷淡、客观到温暖、热情:
- 冷淡:“结果表明性能提升了 12%。”(纯数据)
- 中性:“我们在最新版本中将性能提升了 12%。”
- 温暖:“我们很自豪地分享这一成果:团队将速度提升了 12%。”
- 热情:“这太了不起了——我们的性能实现了 12% 的飞跃!”
import anthropic
client = anthropic.Anthropic(api_key='sk-ant-your-key-here')
temperatures = [
('COLD/OBJECTIVE', 'Purely factual, no emotion, no personality, third person.'),
('NEUTRAL', 'Balanced, professional, slight warmth but no enthusiasm.'),
('WARM', 'Friendly, first person plural ("we"), positive but measured.'),
('ENTHUSIASTIC', 'High energy, excited, uses exclamation points, celebrates the user.')
]
fact = 'Our app now loads 3 seconds faster after the latest update.'
for label, instruction in temperatures:
response = client.messages.create(
model='claude-opus-4-5',
max_tokens=50,
messages=[{
'role': 'user',
'content': f'Tone: {instruction}\n\nAnnounce this fact in 1 sentence: {fact}'
}]
)
print(f'[{label}]: {response.content[0].text.strip()}')保持语气一致
语气的一致性与语气的选择同样重要。一份文档如果在中途从正式风格切换为随意风格,会让读者感到困惑,也会削弱可信度。
对于包含多个部分的文档:
- 在系统消息中或提示开头设定语气
- 明确说明:“请始终保持这一语气”
- 对于很长的内容,在后续提示中提醒模型注意语气
import openai
client = openai.OpenAI(api_key='sk-your-key-here')
# System message tone sets voice for all sections
response = client.chat.completions.create(
model='gpt-4o',
messages=[
{
'role': 'system',
'content': (
'You are writing all content for a developer-focused SaaS company called GridDB. '
'Tone: technical but approachable. No jargon without explanation. '
'No contractions. Short sentences. No marketing superlatives. '
'Maintain this tone consistently across every section.'
)
},
{
'role': 'user',
'content': (
'Write 2 short sections for our website:\n'
'1. Hero tagline (max 8 words)\n'
'2. One-paragraph product description (max 60 words)'
)
}
]
)
print(response.choices[0].message.content)不同内容类型中的语气
不同内容类型都有默认且受期待的语气。偏离这些语气可能会产生很好的效果——但前提是这种偏离出于有意安排:
- 法律文档:正式、精确 → 随意会显得不专业
- 错误消息:清晰、富有同理心 → 冷淡会让人感到敌意
- 营销文案:热情、突出益处 → 枯燥会让人提不起兴趣
- 应用程序接口文档:技术化、简洁 → 华丽辞藻会浪费开发人员的时间
- 客户支持:温暖、以解决问题为导向 → 防御性语气会显得咄咄逼人
import anthropic
client = anthropic.Anthropic(api_key='sk-ant-your-key-here')
content_types = [
('ERROR MESSAGE', 'Empathetic, clear, action-oriented. No technical jargon. No blame.'),
('API DOCS', 'Terse, precise, no fluff. Technical vocabulary. Example-driven.'),
('SUPPORT REPLY', 'Warm, solution-focused, acknowledges frustration, offers next steps.')
]
scenario = 'A user cannot log in because their account has been temporarily locked.'
for content_type, tone in content_types:
response = client.messages.create(
model='claude-opus-4-5',
max_tokens=80,
messages=[{
'role': 'user',
'content': (
f'Content type: {content_type}\n'
f'Tone: {tone}\n\n'
f'Write 2 sentences for this scenario: {scenario}'
)
}]
)
print(f'[{content_type}]')
print(response.content[0].text.strip())
print()跨渠道的语气
同一品牌完全可以在不同渠道使用不同的语气。重要的是,每个渠道的语气都应经过有意识的设计,并且与渠道相匹配:
- 社交平台短帖:随意、有冲击力、突出个性
- LinkedIn:专业、深思熟虑、以洞察为驱动
- 电子邮件通讯:温暖、口语化、富有个人色彩
- 法律文档:正式、精确、必要时使用被动语态
- 应用内消息:友好、简短、以行动为导向
import openai
client = openai.OpenAI(api_key='sk-your-key-here')
channels = [
('TWITTER', 'Casual, punchy, max 200 chars, can use one emoji'),
('LINKEDIN', 'Professional, insight-driven, 2 sentences, no emoji'),
('IN-APP', 'Friendly, action-oriented, 1 sentence, second person')
]
news = 'We just launched dark mode in our app.'
for channel, tone in channels:
response = client.chat.completions.create(
model='gpt-4o',
max_tokens=60,
messages=[{
'role': 'user',
'content': f'Channel: {channel}. Tone: {tone}.\n\nAnnounce: {news}'
}]
)
print(f'[{channel}]: {response.choices[0].message.content.strip()}')
print()知识检查
一家公司的移动应用需要在支付失败时显示错误消息。当前消息是:“由于关联金融账户中的资金不足,该交易无法处理。” 核心的语气问题是什么?
正式与非正式语气——回顾
语气是控制提示效果最有力的维度之一。要点如下:
- 人工智能默认使用中性偏正式的语域——请始终明确指定您想要的语气
- 使用形容词组合:“自信、直接、不绕弯子”
- 使用角色设定引用:“像某支付平台的博客文章那样”
- 控制情感温度:从冷淡、客观到热情
- 让语气匹配内容类型和受众
- 在系统消息中一次设定语气,确保应用的表达风格一致
- 语气不匹配会侵蚀信任——法律文档不应听起来像一条推文
用 AI 导师学习 AI Prompt Engineering — 免费
在浏览器中编写并运行真实代码,获得全天候 AI 导师的即时帮助,并在网页或应用中继续学习。
- 课程
- 53
- 课程
- 199
常见问题解答
「正式语气与非正式语气」课时是免费的吗?
是的 — 「正式语气与非正式语气」的完整文本可在网页上免费阅读。要进行交互式练习(内置代码编辑器和全天候 AI 导师)并解锁 AI Prompt Engineering 课程的其余内容,请升级到 CoddyKit PRO。 AI Prompt Engineering 课程共包含 4 节课。
「正式语气与非正式语气」这节课中我会学到什么?
在提示中指定专业、轻松、学术或对话式的表达风格 你通过在浏览器中直接运行的动手代码来练习 AI Prompt Engineering,全天候 AI 导师会在你学习这节课的过程中回答你的问题。
学习 AI Prompt Engineering 需要有经验吗?
无需任何先前经验。CoddyKit 上的 AI Prompt Engineering 课程适合初学者到高级学习者,你可以从这里开始或从头开始,按照自己的节奏学习。 这是第 1 节课,共 4 节。
「正式语气与非正式语气」课时需要多长时间?
大多数 CoddyKit 课程大约需要 5–10 分钟。每节课都很精短且互动,所以你能稳步进步,并在网页和应用中从离开的地方继续。
我能在这节 AI Prompt Engineering 课中编写并运行代码吗?
能。每节 AI Prompt Engineering 课都包含内置代码编辑器,你可以在浏览器中直接编写并运行真实代码,并获得即时 AI 反馈 — 无需本地设置。