From ace8f38dccd587efc0528aba14ec09b50480b514 Mon Sep 17 00:00:00 2001 From: Junhyuk Lee <58055473+xodn348@users.noreply.github.com> Date: Thu, 7 May 2026 13:22:55 -0500 Subject: [PATCH 1/3] chore(examples): update shebang from poetry to uv (#1497) The project migrated from poetry to uv, and CONTRIBUTING.md documents uv as the package manager. Newer examples (agents.py) already use `#!/usr/bin/env -S uv run python`. Update the 4 remaining examples that still referenced poetry. Co-authored-by: Junhyuk Lee Co-authored-by: Claude Opus 4.6 --- examples/bedrock.py | 2 +- examples/text_completions_demo_async.py | 2 +- examples/text_completions_demo_sync.py | 2 +- examples/text_completions_streaming.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/bedrock.py b/examples/bedrock.py index 7b1d85f51..8b9be1351 100644 --- a/examples/bedrock.py +++ b/examples/bedrock.py @@ -1,4 +1,4 @@ -#!/usr/bin/env -S poetry run python +#!/usr/bin/env -S uv run python # Note: you must have installed `anthropic` with the `bedrock` extra # e.g. `pip install -U anthropic[bedrock]` diff --git a/examples/text_completions_demo_async.py b/examples/text_completions_demo_async.py index 00bc593d9..96d0376ea 100644 --- a/examples/text_completions_demo_async.py +++ b/examples/text_completions_demo_async.py @@ -1,4 +1,4 @@ -#!/usr/bin/env -S poetry run python +#!/usr/bin/env -S uv run python import asyncio diff --git a/examples/text_completions_demo_sync.py b/examples/text_completions_demo_sync.py index 63ca8b59b..907dc46d5 100644 --- a/examples/text_completions_demo_sync.py +++ b/examples/text_completions_demo_sync.py @@ -1,4 +1,4 @@ -#!/usr/bin/env -S poetry run python +#!/usr/bin/env -S uv run python import anthropic from anthropic import Anthropic diff --git a/examples/text_completions_streaming.py b/examples/text_completions_streaming.py index 7b897fcc2..a0095783e 100644 --- a/examples/text_completions_streaming.py +++ b/examples/text_completions_streaming.py @@ -1,4 +1,4 @@ -#!/usr/bin/env -S poetry run python +#!/usr/bin/env -S uv run python import asyncio From 1aa8e410fd34d4c4971234a3ae7c7b11a5fadaf9 Mon Sep 17 00:00:00 2001 From: Gopal Bagaswar <67310594+GopalGB@users.noreply.github.com> Date: Fri, 8 May 2026 00:02:07 +0530 Subject: [PATCH 2/3] chore(examples): bump tools_runner.py to claude-sonnet-4-5-20250929 (#1473) The `examples/tools_runner.py` file is the only example still pointing at `claude-3-5-sonnet-latest`. All sibling examples (messages.py, messages_stream.py, mcp_tool_runner.py, tools_stream.py, tools_runner_search_tool.py, thinking.py, images.py, etc.) use `claude-sonnet-4-5-20250929`. Aligning this example so copy-paste users land on a current model. Co-authored-by: Claude Opus 4.7 (1M context) --- examples/tools_runner.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/tools_runner.py b/examples/tools_runner.py index 07a4f2a56..894891a87 100644 --- a/examples/tools_runner.py +++ b/examples/tools_runner.py @@ -44,7 +44,7 @@ def get_weather(location: str, units: Literal["c", "f"]) -> str: def main() -> None: runner = client.beta.messages.tool_runner( max_tokens=1024, - model="claude-3-5-sonnet-latest", + model="claude-sonnet-4-5-20250929", # alternatively, you can use `tools=[anthropic.beta_tool(get_weather)]` tools=[get_weather], messages=[{"role": "user", "content": "What is the weather in SF?"}], From 1a477f0dd6a46dedc27c51d49d76e6e4730cd32f Mon Sep 17 00:00:00 2001 From: Lucky Verma Date: Fri, 8 May 2026 08:52:39 +0000 Subject: [PATCH 3/3] chore(examples): bump workload_identity.py to claude-opus-4-7 The example still pins claude-opus-4-5. Latest opus per src/anthropic/types/model_param.py is claude-opus-4-7 (4-6 also listed but 4-7 is current). Bumping so copy-paste users land on a current model. No logic changes, only the model identifier. --- examples/workload_identity.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/workload_identity.py b/examples/workload_identity.py index 5bd2b35ce..4c41a1f2f 100755 --- a/examples/workload_identity.py +++ b/examples/workload_identity.py @@ -169,7 +169,7 @@ async def main() -> None: ), ) msg = await aclient.messages.create( - model="claude-opus-4-5", + model="claude-opus-4-7", max_tokens=1024, messages=[{"role": "user", "content": "Hello"}], )