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
    功能

    Google Sheets 附加元件

    Claude for Sheets 擴充功能 將 Claude 整合到 Google Sheets 中,讓您可以直接在儲存格中執行與 Claude 的互動。

    為什麼要使用 Claude for Sheets?

    Claude for Sheets 透過讓您能夠在評估套件中並行測試提示,實現了大規模的提示工程。此外,它在辦公室任務(如調查分析和線上資料處理)方面表現出色。

    請造訪我們的提示工程範例表格來看看實際應用。


    開始使用 Claude for Sheets

    安裝 Claude for Sheets

    使用以下步驟輕鬆啟用 Claude for Sheets:

    1. 1

      取得您的 Claude API 金鑰

      如果您還沒有 API 金鑰,您可以在 Claude Console 中建立 API 金鑰。

    2. 2

      安裝 Claude for Sheets 擴充功能

      在附加元件市集中找到 Claude for Sheets 擴充功能,然後點擊藍色的 安裝 按鈕並接受權限。

    3. 3

      連接您的 API 金鑰

      在 擴充功能 > Claude for Sheets™ > 開啟側邊欄 > ☰ > 設定 > API 提供者 中輸入您的 API 金鑰。您可能需要等待或重新整理頁面才能看到 Claude for Sheets 選單。

    每次建立新的 Google Sheet 時,您都必須重新輸入您的 API 金鑰

    輸入您的第一個提示

    您可以使用兩個主要函數來透過 Claude for Sheets 呼叫 Claude。現在,讓我們使用 CLAUDE()。

    1. 1

      簡單提示

      在任何儲存格中,輸入 =CLAUDE("Claude,用一句話說說藍色有什麼好處?")

      Claude 應該會回應一個答案。您會知道提示正在處理中,因為儲存格會顯示 載入中...

    2. 2

      新增參數

      參數引數位於初始提示之後,如 =CLAUDE(prompt, model, params...)。

      model 在清單中總是第二個。

      現在在任何儲存格中輸入 =CLAUDE("嗨,Claude!", "claude-3-haiku-20240307", "max_tokens", 3)

      任何 API 參數 都可以這樣設定。您甚至可以傳入一個僅用於此特定儲存格的 API 金鑰,如下所示:"api_key", "sk-ant-api03-j1W..."

    進階使用

    CLAUDEMESSAGES 是一個允許您特別使用 Messages API 的函數。這使您能夠向 Claude 發送一系列 User: 和 Assistant: 訊息。

    如果您想要模擬對話或預填 Claude 的回應,這特別有用。

    嘗試在儲存格中寫入:

    =CLAUDEMESSAGES("User: 用一句話說說藍色有什麼好處?
    Assistant: 藍色很棒,因為")

    換行

    每個後續的對話輪次(User: 或 Assistant:)前面必須有一個換行符號。要在儲存格中輸入換行,請使用以下按鍵組合:

    • Mac: Cmd + Enter
    • Windows: Alt + Enter

    可選函數參數

    您可以透過列出引數-值對來指定可選的 API 參數。 您可以設定多個參數。只需將它們一個接一個地列出,每個引數和值對之間用逗號分隔。

    前兩個參數必須始終是提示和模型。您不能在不設定模型的情況下設定可選參數。

    您可能最關心的引數-值參數是:

    引數描述
    max_tokens模型在被強制停止之前輸出的總標記數。對於是/否或多選答案,您可能希望值為 1-3。
    temperature注入結果中的隨機性量。對於多選或分析任務,您會希望它接近 0。對於想法生成,您會希望它設為 1。
    system用於指定系統提示,可以為 Claude 提供角色詳細資訊和上下文。
    stop_sequencesJSON 字串陣列,如果遇到會導致模型停止生成文字。由於 Google Sheets™ 中的轉義規則,字串內的雙引號必須透過加倍來轉義。
    api_key用於指定呼叫 Claude 時使用的特定 API 金鑰。


    Claude for Sheets 使用範例

    提示工程互動教學

    我們深入的提示工程互動教學使用了 Claude for Sheets。 查看它來學習或複習提示工程技巧。

    就像任何 Claude for Sheets 實例一樣,您需要一個 API 金鑰來與教學互動。

    提示工程工作流程

    我們的 Claude for Sheets 提示範例工作台 是一個由 Claude 驅動的試算表,包含範例提示和提示工程結構。

    Claude for Sheets 工作簿範本

    複製我們的 Claude for Sheets 工作簿範本 來開始您自己的 Claude for Sheets 工作!


    疑難排解


    更多資訊

    有關此擴充功能的更多資訊,請參閱 Claude for Sheets Google Workspace Marketplace 概覽頁面。

    • 為什麼要使用 Claude for Sheets?
    • 開始使用 Claude for Sheets
    • 安裝 Claude for Sheets
    © 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