Loading...
    • 開發者指南
    • API 參考
    • MCP
    • 資源
    • 發行說明
    Search...
    ⌘K
    開始使用
    Claude 簡介快速開始
    模型與定價
    模型概覽選擇模型Claude 4.5 新功能遷移至 Claude 4.5模型棄用定價
    使用 Claude 構建
    功能概覽使用 Messages API上下文窗口提示詞最佳實踐
    功能
    提示詞快取上下文編輯擴展思考努力串流消息批次處理引用多語言支援Token 計數嵌入視覺PDF 支援Files API搜尋結果結構化輸出
    工具
    概覽如何實現工具使用細粒度工具串流Bash 工具代碼執行工具程式化工具調用計算機使用工具文字編輯器工具網頁擷取工具網頁搜尋工具記憶體工具工具搜尋工具
    Agent Skills
    概覽快速開始最佳實踐使用 API 的 Skills
    Agent SDK
    概覽快速開始TypeScript SDKTypeScript V2 (預覽)Python SDK遷移指南
    API 中的 MCP
    MCP 連接器遠端 MCP 伺服器
    第三方平台上的 Claude
    Amazon BedrockMicrosoft FoundryVertex AI
    提示詞工程
    概覽提示詞生成器使用提示詞範本提示詞改進器清晰直接使用範例 (多次提示)讓 Claude 思考 (CoT)使用 XML 標籤給 Claude 一個角色 (系統提示詞)預填 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 提示教程

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