Loading...
    • 開發者指南
    • API 參考
    • MCP
    • 資源
    • 發行說明
    Search...
    ⌘K

    第一步

    Claude 介紹快速入門

    模型與定價

    模型概覽選擇模型Claude 4.5 的新功能遷移到 Claude 4.5模型棄用定價

    使用 Claude 建構

    功能概覽使用 Messages API上下文視窗提示詞最佳實踐

    功能

    提示詞快取上下文編輯延伸思考串流訊息批次處理引用多語言支援Token 計數嵌入向量視覺PDF 支援Files API搜尋結果Google Sheets 附加元件

    工具

    概述如何實現工具使用代幣高效工具使用細粒度工具串流Bash 工具代碼執行工具電腦使用工具文字編輯工具網頁擷取工具網路搜尋工具記憶工具

    代理技能

    概述在 API 中開始使用 Agent Skills技能編寫最佳實踐使用 Agent Skills 與 API

    Agent SDK

    概述Agent SDK 參考 - TypeScriptPython SDK

    指南

    串流輸入處理權限會話管理託管 Agent SDK修改系統提示SDK 中的 MCP自訂工具SDK 中的子代理SDK 中的斜線命令SDK 中的代理技能追蹤成本和使用量待辦事項清單SDK 中的外掛程式

    API 中的 MCP

    MCP 連接器遠端 MCP 伺服器

    Claude 在第三方平台上

    Amazon BedrockVertex AI

    提示工程

    概述提示詞生成器使用提示模板提示詞改進器保持清晰和直接使用範例(多樣提示)讓 Claude 思考(思維鏈)使用 XML 標籤給 Claude 分配角色(系統提示詞)預填 Claude 的回應串接複雜提示長文本技巧延伸思考技巧

    測試與評估

    定義成功標準開發測試案例使用評估工具降低延遲

    加強防護措施

    減少幻覺提高輸出一致性防範越獄handle-streaming-refusals減少提示詞洩漏保持 Claude 的角色特性

    管理和監控

    Admin API 概述使用量和成本 APIClaude Code 分析 API
    Console
    測試與評估

    建立強大的實證評估

    學習如何開發測試案例來衡量 LLM 性能並建立有效的評估方法。

    在定義成功標準後,下一步是設計評估來衡量 LLM 相對於這些標準的性能。這是提示工程循環的重要組成部分。

    本指南專注於如何開發您的測試案例。

    建立評估和測試案例

    評估設計原則

    1. 針對特定任務:設計能夠反映您真實世界任務分佈的評估。別忘了考慮邊緣案例!

    2. 盡可能自動化:結構化問題以允許自動評分(例如,多選題、字符串匹配、代碼評分、LLM 評分)。
    3. 優先考慮數量而非質量:更多問題配合稍低信號的自動評分,比更少問題配合高質量人工評分更好。

    評估範例

    手動編寫數百個測試案例可能很困難!讓 Claude 幫助您從基準範例測試案例集合中生成更多案例。
    如果您不知道哪些評估方法可能對評估您的成功標準有用,您也可以與 Claude 進行腦力激盪!

    評分評估

    在決定使用哪種方法來評分評估時,選擇最快、最可靠、最可擴展的方法:

    1. 基於代碼的評分:最快且最可靠,極其可擴展,但對於需要較少基於規則剛性的更複雜判斷缺乏細微差別。

      • 精確匹配:output == golden_answer
      • 字符串匹配:key_phrase in output
    2. 人工評分:最靈活且高質量,但緩慢且昂貴。如果可能的話應避免。

    3. 基於 LLM 的評分:快速且靈活,可擴展且適合複雜判斷。首先測試以確保可靠性,然後擴展。

    基於 LLM 評分的技巧

    • 有詳細、清晰的評分標準:"答案應該總是在第一句中提到 'Acme Inc.'。如果沒有,答案自動被評為'不正確'。"
      給定的用例,甚至該用例的特定成功標準,可能需要多個評分標準來進行全面評估。
    • 實證或具體:例如,指示 LLM 僅輸出'正確'或'不正確',或從 1-5 的量表進行判斷。純定性評估很難快速且大規模地評估。
    • 鼓勵推理:要求 LLM 在決定評估分數之前先思考,然後丟棄推理。這提高了評估性能,特別是對於需要複雜判斷的任務。

    下一步

    腦力激盪評估

    學習如何製作能最大化您評估分數的提示。

    評估食譜

    更多人工、代碼和 LLM 評分評估的代碼範例。

    • 基於 LLM 評分的技巧
    © 2025 ANTHROPIC PBC

    Products

    • Claude
    • Claude Code
    • Max plan
    • Team plan
    • Enterprise plan
    • Download app
    • Pricing
    • Log in

    Features

    • Claude and Slack
    • Claude in Excel

    Models

    • Opus
    • Sonnet
    • Haiku

    Solutions

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

    Claude Developer Platform

    • Overview
    • Developer docs
    • Pricing
    • Amazon Bedrock
    • Google Cloud’s Vertex AI
    • Console login

    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

    Help and security

    • Availability
    • Status
    • Support center

    Terms and policies

    • Privacy policy
    • Responsible disclosure policy
    • Terms of service: Commercial
    • Terms of service: Consumer
    • Usage policy

    Products

    • Claude
    • Claude Code
    • Max plan
    • Team plan
    • Enterprise plan
    • Download app
    • Pricing
    • Log in

    Features

    • Claude and Slack
    • Claude in Excel

    Models

    • Opus
    • Sonnet
    • Haiku

    Solutions

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

    Claude Developer Platform

    • Overview
    • Developer docs
    • Pricing
    • Amazon Bedrock
    • Google Cloud’s Vertex AI
    • Console login

    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

    Help and security

    • Availability
    • Status
    • Support center

    Terms and policies

    • Privacy policy
    • Responsible disclosure policy
    • Terms of service: Commercial
    • Terms of service: Consumer
    • Usage policy
    © 2025 ANTHROPIC PBC