Loading...
    • 開發者指南
    • API 參考
    • MCP
    • 資源
    • 發行說明
    Search...
    ⌘K
    入門
    Claude 簡介快速開始
    模型與定價
    模型概覽選擇模型Claude 4.6 新功能遷移指南模型棄用定價
    使用 Claude 構建
    功能概覽使用 Messages API處理停止原因提示詞最佳實踐
    上下文管理
    上下文視窗壓縮上下文編輯
    功能
    提示詞快取延伸思考自適應思考思考力度串流訊息批次處理引用多語言支援Token 計數嵌入視覺PDF 支援Files API搜尋結果結構化輸出
    工具
    概覽如何實作工具使用細粒度工具串流Bash 工具程式碼執行工具程式化工具呼叫電腦使用工具文字編輯器工具網頁擷取工具網頁搜尋工具記憶工具工具搜尋工具
    Agent Skills
    概覽快速開始最佳實踐企業級 Skills透過 API 使用 Skills
    Agent SDK
    概覽快速開始TypeScript SDKTypeScript V2(預覽版)Python SDK遷移指南
    API 中的 MCP
    MCP 連接器遠端 MCP 伺服器
    第三方平台上的 Claude
    Amazon BedrockMicrosoft FoundryVertex AI
    提示詞工程
    概覽提示詞產生器使用提示詞範本提示詞改進器清晰直接使用範例(多範例提示)讓 Claude 思考(CoT)使用 XML 標籤賦予 Claude 角色(系統提示詞)串聯複雜提示詞長上下文技巧延伸思考技巧
    測試與評估
    定義成功標準開發測試案例使用評估工具降低延遲
    強化防護機制
    減少幻覺提高輸出一致性防範越獄攻擊串流拒絕減少提示詞洩漏讓 Claude 保持角色
    管理與監控
    Admin API 概覽資料駐留工作區用量與成本 APIClaude Code Analytics API零資料保留
    Console
    Log in
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...

    Solutions

    • AI agents
    • Code modernization
    • Coding
    • Customer support
    • Education
    • Financial services
    • Government
    • Life sciences

    Partners

    • Amazon Bedrock
    • Google Cloud's Vertex AI

    Learn

    • Blog
    • Catalog
    • Courses
    • Use cases
    • Connectors
    • Customer stories
    • Engineering at Anthropic
    • Events
    • Powered by Claude
    • Service partners
    • Startups program

    Company

    • Anthropic
    • Careers
    • Economic Futures
    • Research
    • News
    • Responsible Scaling Policy
    • Security and compliance
    • Transparency

    Learn

    • Blog
    • Catalog
    • Courses
    • Use cases
    • Connectors
    • Customer stories
    • Engineering at Anthropic
    • Events
    • Powered by Claude
    • Service partners
    • Startups program

    Help and security

    • Availability
    • Status
    • Support
    • Discord

    Terms and policies

    • Privacy policy
    • Responsible disclosure policy
    • Terms of service: Commercial
    • Terms of service: Consumer
    • Usage policy
    提示詞工程

    使用範例(多次提示)來引導 Claude 的行為

    通過在提示中提供精心設計的範例,可以顯著改進 Claude 輸出的準確性、一致性和品質。

    While these tips apply broadly to all Claude models, you can find prompting tips specific to extended thinking models here.

    範例是讓 Claude 生成您所需內容的秘密武器捷徑。通過在提示中提供幾個精心設計的範例,您可以顯著改進 Claude 輸出的準確性、一致性和品質。 這種技術被稱為少量示例或多次提示,特別適用於需要結構化輸出或遵守特定格式的任務。

    增強您的提示:包含 3-5 個多樣化、相關的範例來向 Claude 展示您確切想要的內容。更多範例 = 更好的性能,特別是對於複雜任務。

    為什麼使用範例?

    • 準確性:範例減少對指令的誤解。
    • 一致性:範例強制統一的結構和風格。
    • 性能:精心選擇的範例提升 Claude 處理複雜任務的能力。

    製作有效的範例

    為了最大效果,請確保您的範例具有:

    • 相關性:您的範例反映您的實際使用案例。
    • 多樣性:您的範例涵蓋邊界情況和潛在挑戰,並且變化足夠大,使 Claude 不會無意中拾取意外的模式。
    • 清晰性:您的範例用 <example> 標籤包裝(如果有多個,嵌套在 <examples> 標籤內)以便結構化。
    要求 Claude 評估您的範例的相關性、多樣性或清晰性。或者讓 Claude 根據您的初始集合生成更多範例。


    提示庫

    從為各種任務和使用案例精心挑選的提示集合中獲得靈感。

    GitHub 提示教程

    一個充滿範例的教程,涵蓋我們文檔中的提示工程概念。

    Google Sheets 提示教程

    通過互動式電子表格提供的我們提示工程教程的輕量級版本。

    Was this page helpful?