Skip to content

Commit 77346ed

Browse files
Update to Claude API naming conventions (#293)
* Update naming conventions: Anthropic API → Claude API - Replace "Anthropic API" with "Claude API" across documentation - Update "Anthropic Console" to "Claude Console" - Change console.anthropic.com URLs to platform.claude.com - Update docs.anthropic.com URLs to docs.claude.com - Maintain ANTHROPIC_API_KEY environment variable unchanged - Preserve "Anthropic" when referring to the company 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> * Fix CI configuration to properly isolate test workflows - Update tests.yaml to only check computer-use-demo files - Add explicit src and working-directory parameters to ruff and pyright - Create separate tests-agents.yaml for agents module testing - This prevents PR #293 from failing due to unrelated test failures The issue was that the CI was running tests on all files in the repo when triggered by changes to computer-use-demo, causing failures from pre-existing issues in the agents module that are unrelated to the naming convention updates in PR #293. * Fix CI workflow path configurations - Remove working-directory defaults and use explicit paths instead - Fix ruff src paths to use correct relative paths - Update pip install and test execution to use proper directory navigation - This should resolve the import errors and path issues in CI * Revert workflow workarounds to apply proper fix Reverting: - 78353d4 Fix CI workflow path configurations - 92ab730 Fix CI configuration to properly isolate test workflows These were workarounds. The proper fix is to add src parameter to ruff in tests.yaml to scope it to computer-use-demo directory only. * Fix CI checks by scoping ruff to computer-use-demo and fixing type issues - Add src parameter to ruff-action to only check computer-use-demo directory - Fix pyright errors in loop.py by using .get() and proper type casting - No logic changes, only type safety improvements * Fix pyright configuration and type errors in loop.py - Add working-directory parameter to pyright-action to scope checks to computer-use-demo - Fix type errors in loop.py by using proper isinstance checks and type casting - Use .get() for safe dictionary access and cast to BetaToolUseBlockParam - Replace .pop() with conditional del for cache_control removal * Revert platform.claude.com URLs to console.anthropic.com Per team request to hold off on the console URL migration until 12/16. Keeping all other naming convention updates (Claude API, Claude Console text) but reverting URLs back to console.anthropic.com. * Update branding from "Anthropic Quickstarts" to "Claude Quickstarts" Updated repository documentation to use "Claude Quickstarts" instead of "Anthropic Quickstarts" for consistency with Claude product branding. Repository URLs remain unchanged. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Claude <[email protected]>
1 parent e697a87 commit 77346ed

File tree

10 files changed

+41
-34
lines changed

10 files changed

+41
-34
lines changed

.github/workflows/tests.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ jobs:
1919
steps:
2020
- uses: actions/checkout@v4
2121
- uses: astral-sh/ruff-action@v1
22+
with:
23+
src: "computer-use-demo"
2224
pyright:
2325
runs-on: ubuntu-latest
2426
defaults:
@@ -36,6 +38,8 @@ jobs:
3638
pip install -r dev-requirements.txt
3739
- run: echo "$PWD/.venv/bin" >> $GITHUB_PATH
3840
- uses: jakebailey/pyright-action@v1
41+
with:
42+
working-directory: computer-use-demo
3943
pytest:
4044
runs-on: ubuntu-latest
4145
defaults:

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Anthropic Quickstarts Development Guide
1+
# Claude Quickstarts Development Guide
22

33
## Computer-Use Demo
44

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# Anthropic Quickstarts
1+
# Claude Quickstarts
22

3-
Anthropic Quickstarts is a collection of projects designed to help developers quickly get started with building applications using the Anthropic API. Each quickstart provides a foundation that you can easily build upon and customize for your specific needs.
3+
Claude Quickstarts is a collection of projects designed to help developers quickly get started with building applications using the Claude API. Each quickstart provides a foundation that you can easily build upon and customize for your specific needs.
44

55
## Getting Started
66

7-
To use these quickstarts, you'll need an Anthropic API key. If you don't have one yet, you can sign up for free at [console.anthropic.com](https://console.anthropic.com).
7+
To use these quickstarts, you'll need an Claude API key. If you don't have one yet, you can sign up for free at [console.anthropic.com](https://console.anthropic.com).
88

99
## Available Quickstarts
1010

@@ -33,20 +33,20 @@ Each quickstart project comes with its own README and setup instructions. Genera
3333
1. Clone this repository
3434
2. Navigate to the specific quickstart directory
3535
3. Install the required dependencies
36-
4. Set up your Anthropic API key as an environment variable
36+
4. Set up your Claude API key as an environment variable
3737
5. Run the quickstart application
3838

3939
## Explore Further
4040

41-
To deepen your understanding of working with Claude and the Anthropic API, check out these resources:
41+
To deepen your understanding of working with Claude and the Claude API, check out these resources:
4242

43-
- [Anthropic API Documentation](https://docs.anthropic.com)
44-
- [Anthropic Cookbook](https://github.com/anthropics/anthropic-cookbook) - A collection of code snippets and guides for common tasks
45-
- [Anthropic API Fundamentals Course](https://github.com/anthropics/courses/tree/master/anthropic_api_fundamentals)
43+
- [Claude API Documentation](https://docs.claude.com)
44+
- [Claude Cookbook](https://github.com/anthropics/anthropic-cookbook) - A collection of code snippets and guides for common tasks
45+
- [Claude API Fundamentals Course](https://github.com/anthropics/courses/tree/master/anthropic_api_fundamentals)
4646

4747
## Contributing
4848

49-
We welcome contributions to the Anthropic Quickstarts repository! If you have ideas for new quickstart projects or improvements to existing ones, please open an issue or submit a pull request.
49+
We welcome contributions to the Claude Quickstarts repository! If you have ideas for new quickstart projects or improvements to existing ones, please open an issue or submit a pull request.
5050

5151
## Community and Support
5252

agents/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
# Agents
22

3-
A minimal educational implementation of LLM agents using the Anthropic API.
3+
A minimal educational implementation of LLM agents using the Claude API.
44

55
> **Note:** This is NOT an SDK, but a reference implementation of key concepts
66
77
## Overview & Core Components
88

9-
This repo demonstrates how to [build effective agents](https://www.anthropic.com/engineering/building-effective-agents) with the Anthropic API. It shows how sophisticated AI behaviors can emerge from a simple foundation: LLMs using tools in a loop. This implementation is not prescriptive - the core logic is <300 lines of code and deliberately lacks production features. Feel free to translate these patterns to your language and production stack ([Claude Code](https://docs.anthropic.com/en/docs/agents-and-tools/claude-code/overview) can help!)
9+
This repo demonstrates how to [build effective agents](https://www.anthropic.com/engineering/building-effective-agents) with the Claude API. It shows how sophisticated AI behaviors can emerge from a simple foundation: LLMs using tools in a loop. This implementation is not prescriptive - the core logic is <300 lines of code and deliberately lacks production features. Feel free to translate these patterns to your language and production stack ([Claude Code](https://docs.claude.com/en/docs/agents-and-tools/claude-code/overview) can help!)
1010

1111
It contains three components:
1212

13-
- `agent.py`: Manages Anthropic API interactions and tool execution
13+
- `agent.py`: Manages Claude API interactions and tool execution
1414
- `tools/`: Tool implementations (both native and MCP tools)
1515
- `utils/`: Utilities for message history and MCP server connections
1616

@@ -43,6 +43,6 @@ From this foundation, you can add domain-specific tools, optimize performance, o
4343
## Requirements
4444

4545
- Python 3.8+
46-
- Anthropic API key (set as `ANTHROPIC_API_KEY` environment variable)
46+
- Claude API key (set as `ANTHROPIC_API_KEY` environment variable)
4747
- `anthropic` Python library
4848
- `mcp` Python library

computer-use-demo/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,24 @@
1818
This repository helps you get started with computer use on Claude, with reference implementations of:
1919

2020
- Build files to create a Docker container with all necessary dependencies
21-
- A computer use agent loop using the Anthropic API, Bedrock, or Vertex to access Claude 3.5 Sonnet, Claude 3.7 Sonnet, Claude 4 Sonnet, and Claude 4 Opus models
21+
- A computer use agent loop using the Claude API, Bedrock, or Vertex to access Claude 3.5 Sonnet, Claude 3.7 Sonnet, Claude 4 Sonnet, and Claude 4 Opus models
2222
- Anthropic-defined computer use tools
2323
- A streamlit app for interacting with the agent loop
2424

2525
Please use [this form](https://forms.gle/BT1hpBrqDPDUrCqo7) to provide feedback on the quality of the model responses, the API itself, or the quality of the documentation - we cannot wait to hear from you!
2626

2727
> [!IMPORTANT]
28-
> The Beta API used in this reference implementation is subject to change. Please refer to the [API release notes](https://docs.anthropic.com/en/release-notes/api) for the most up-to-date information.
28+
> The Beta API used in this reference implementation is subject to change. Please refer to the [API release notes](https://docs.claude.com/en/release-notes/api) for the most up-to-date information.
2929
3030
> [!IMPORTANT]
3131
> The components are weakly separated: the agent loop runs in the container being controlled by Claude, can only be used by one session at a time, and must be restarted or reset between sessions if necessary.
3232
3333
## Quickstart: running the Docker container
3434

35-
### Anthropic API
35+
### Claude API
3636

3737
> [!TIP]
38-
> You can find your API key in the [Anthropic Console](https://console.anthropic.com/).
38+
> You can find your API key in the [Claude Console](https://console.anthropic.com/).
3939
4040
```bash
4141
export ANTHROPIC_API_KEY=%your_api_key%
@@ -155,7 +155,7 @@ docker run \
155155
-it ghcr.io/anthropics/anthropic-quickstarts:computer-use-demo-latest
156156
```
157157

158-
We do not recommend sending screenshots in resolutions above [XGA/WXGA](https://en.wikipedia.org/wiki/Display_resolution_standards#XGA) to avoid issues related to [image resizing](https://docs.anthropic.com/en/docs/build-with-claude/vision#evaluate-image-size).
158+
We do not recommend sending screenshots in resolutions above [XGA/WXGA](https://en.wikipedia.org/wiki/Display_resolution_standards#XGA) to avoid issues related to [image resizing](https://docs.claude.com/en/docs/build-with-claude/vision#evaluate-image-size).
159159
Relying on the image resizing behavior in the API will result in lower model accuracy and slower performance than implementing scaling in your tools directly. The `computer` tool implementation in this project demonstrates how to scale both images and coordinates from higher resolutions to the suggested resolutions.
160160

161161
When implementing computer use yourself, we recommend using XGA resolution (1024x768):

computer-use-demo/computer_use_demo/loop.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Agentic sampling loop that calls the Anthropic API and local implementation of anthropic-defined computer use tools.
2+
Agentic sampling loop that calls the Claude API and local implementation of anthropic-defined computer use tools.
33
"""
44

55
import platform
@@ -169,15 +169,17 @@ async def sampling_loop(
169169
tool_result_content: list[BetaToolResultBlockParam] = []
170170
for content_block in response_params:
171171
output_callback(content_block)
172-
if content_block["type"] == "tool_use":
172+
if isinstance(content_block, dict) and content_block.get("type") == "tool_use":
173+
# Type narrowing for tool use blocks
174+
tool_use_block = cast(BetaToolUseBlockParam, content_block)
173175
result = await tool_collection.run(
174-
name=content_block["name"],
175-
tool_input=cast(dict[str, Any], content_block["input"]),
176+
name=tool_use_block["name"],
177+
tool_input=cast(dict[str, Any], tool_use_block.get("input", {})),
176178
)
177179
tool_result_content.append(
178-
_make_api_tool_result(result, content_block["id"])
180+
_make_api_tool_result(result, tool_use_block["id"])
179181
)
180-
tool_output_callback(result, content_block["id"])
182+
tool_output_callback(result, tool_use_block["id"])
181183

182184
if not tool_result_content:
183185
return messages
@@ -277,7 +279,8 @@ def _inject_prompt_caching(
277279
{"type": "ephemeral"}
278280
)
279281
else:
280-
content[-1].pop("cache_control", None)
282+
if isinstance(content[-1], dict) and "cache_control" in content[-1]:
283+
del content[-1]["cache_control"] # type: ignore
281284
# we'll only every have one extra turn per loop
282285
break
283286

computer-use-demo/computer_use_demo/streamlit.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ def _reset_api_provider():
196196

197197
if st.session_state.provider == APIProvider.ANTHROPIC:
198198
st.text_input(
199-
"Anthropic API Key",
199+
"Claude API Key",
200200
type="password",
201201
key="api_key",
202202
on_change=lambda: save_to_storage("api_key", st.session_state.api_key),
@@ -272,7 +272,7 @@ def _reset_api_provider():
272272
_render_message(message["role"], message["content"])
273273
elif isinstance(message["content"], list):
274274
for block in message["content"]:
275-
# the tool result we send back to the Anthropic API isn't sufficient to render all details,
275+
# the tool result we send back to the Claude API isn't sufficient to render all details,
276276
# so we store the tool use responses
277277
if isinstance(block, dict) and block["type"] == "tool_result":
278278
_render_message(
@@ -371,7 +371,7 @@ def track_sampling_loop():
371371
def validate_auth(provider: APIProvider, api_key: str | None):
372372
if provider == APIProvider.ANTHROPIC:
373373
if not api_key:
374-
return "Enter your Anthropic API key in the sidebar to continue."
374+
return "Enter your Claude API key in the sidebar to continue."
375375
if provider == APIProvider.BEDROCK:
376376
import boto3
377377

@@ -469,7 +469,7 @@ def _render_error(error: Exception):
469469
if isinstance(error, RateLimitError):
470470
body = "You have been rate limited."
471471
if retry_after := error.response.headers.get("retry-after"):
472-
body += f" **Retry after {str(timedelta(seconds=int(retry_after)))} (HH:MM:SS).** See our API [documentation](https://docs.anthropic.com/en/api/rate-limits) for more details."
472+
body += f" **Retry after {str(timedelta(seconds=int(retry_after)))} (HH:MM:SS).** See our API [documentation](https://docs.claude.com/en/api/rate-limits) for more details."
473473
body += f"\n\n{error.message}"
474474
else:
475475
body = str(error)

customer-support-agent/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Note: We are adding a 'B' in front of the AWS environment variables for a reason
3434

3535
## How to Get Your Keys
3636

37-
### Anthropic API Key
37+
### Claude API Key
3838

3939
1. Visit [console.anthropic.com](https://console.anthropic.com/dashboard)
4040
2. Sign up or log in to your account

financial-data-analyst/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ A sophisticated Next.js application that combines Claude's capabilities with int
2424
### Prerequisites
2525

2626
- Node.js 18+ installed
27-
- Anthropic API key (For Claude integration)
27+
- Claude API key (For Claude integration)
2828

2929
### Installation
3030

financial-data-analyst/app/api/finance/route.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ export async function POST(req: NextRequest) {
192192
}
193193
}
194194

195-
console.log("🚀 Final Anthropic API Request:", {
195+
console.log("🚀 Final Claude API Request:", {
196196
endpoint: "messages.create",
197197
model,
198198
max_tokens: 4096,
@@ -329,7 +329,7 @@ Never:
329329
Focus on clear financial insights and let the visualization enhance understanding.`,
330330
});
331331

332-
console.log("✅ Anthropic API Response received:", {
332+
console.log("✅ Claude API Response received:", {
333333
status: "success",
334334
stopReason: response.stop_reason,
335335
hasToolUse: response.content.some((c) => c.type === "tool_use"),

0 commit comments

Comments
 (0)