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 的擴展上下文窗口來處理複雜、資料豐富的任務的提示和最佳實踐。

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

    Claude 的擴展上下文窗口(Claude 3 模型支持 200K 個 token)能夠處理複雜、資料豐富的任務。本指南將幫助您有效地利用這一強大功能。

    長文本提示詞的基本技巧

    • 將長篇資料放在頂部:將您的長文檔和輸入(約 20K+ 個 token)放在提示詞的頂部,位於您的查詢、指令和示例之上。這可以顯著提高 Claude 在所有模型上的性能。

      根據測試,將查詢放在末尾可以將響應品質提高多達 30%,特別是在處理複雜的多文檔輸入時。
    • 使用 XML 標籤結構化文檔內容和元數據:使用多個文檔時,將每個文檔包裝在 <document> 標籤中,並使用 <document_content> 和 <source>(以及其他元數據)子標籤以提高清晰度。

    • 在引用中基礎響應:對於長文檔任務,要求 Claude 先引用文檔的相關部分,然後再執行其任務。這有助於 Claude 穿過文檔其餘內容的「噪音」。


    提示詞庫

    從精選的各種任務和用例提示詞中獲得靈感。

    GitHub 提示詞教程

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

    Google Sheets 提示詞教程

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