Skip to content

Multi-language: Update Anthropic Claude Converse samples to active Claude Haiku 5.5 - #8205

Merged
rlhagerm merged 4 commits into
awsdocs:mainfrom
brmur:fix/bedrock-anthropic-claude-model-id-multilang
Oct 13, 2026
Merged

rlhagerm merged 4 commits into
awsdocs:mainfrom
brmur:fix/bedrock-anthropic-claude-model-id-multilang

Conversation

@brmur

@brmur brmur commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator

This pull request updates the Converse and ConverseStream Anthropic Claude samples across six languages (plus the Go unit test) to a current, working model. It is the multi-language follow-up to #8204, which fixed the Python samples behind the same documentation feedback.

Why

These samples pinned anthropic.claude-3-haiku-20240307-v1:0, which has reached end of life — running them as published fails with a 404 (ResourceNotFoundException, "reached the end of its life", re-confirmed in us-east-1).

What changed

  • Repoint to the active Claude Haiku 5.5 inference profile us.anthropic.claude-haiku-5-5 (status ACTIVE; the us. prefix matches the us-east-1 Region these samples use).
  • Remove the temperature and topP inference parameters from the Java, .NET, JavaScript, and Swift samples. Claude Haiku 5.5 deprecates both temperature and top_p entirely (ValidationException: `temperature` is deprecated for this model / `top_p` is deprecated for this model), so a model-ID swap alone would leave those samples broken. The Rust and Go samples set no inference config and are unaffected.
  • Update the Go unit-test constant CONVERSE_CLAUDE_MODEL_ID in lockstep with converse.go so the stubbed test still matches.

Files (15)

  • Java v2: Converse.java, ConverseAsync.java, ConverseStream.java
  • .NET v3: Converse.cs, ConverseStream.cs
  • .NET v4: Converse.cs, ConverseStream.cs
  • JavaScript v3: converse.js, converseStream.js
  • Rust v1: converse.rs, converse-stream.rs
  • Swift: Converse/main.swift, ConverseStream/main.swift
  • Go v2: actions/converse.go + actions/converse_test.go

Verification

  • Each inference-config shape used by the samples was exercised live against us.anthropic.claude-haiku-5-5 and returns 200:
    • maxTokens only (Java/.NET/JavaScript, after removing temperature)
    • maxTokens + stopSequences (Swift, after removing temperature)
    • no inference config (Rust/Go)
  • gofmt and cargo fmt --check are clean on the modified Go and Rust files.
  • Snippet markers are unchanged; Go/Rust line counts are unchanged (1-for-1 line edits), so README line-number anchors remain accurate.

Not included

Two tool-use demos (rustv1/.../tool-use.rs and python/.../tool_use_demo/tool_use_demo.py) also reference retired IDs but exercise a different API surface (and the Python one carries additional retired Claude 3 Opus/Sonnet IDs in a SupportedModels enum). Those are intentionally deferred to a separate change so tool use can be verified independently.

Related: internal ticket V2245921888.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

The Converse and ConverseStream Anthropic Claude samples pinned the
end-of-life model ID anthropic.claude-3-haiku-20240307-v1:0, so running
them produced a hard 404. Repoint all six languages (Java v2, .NET v3,
.NET v4, JavaScript v3, Rust v1, Swift) and the Go v2 ConverseClaude
action to the active Claude Haiku 4.5 inference profile
us.anthropic.claude-haiku-4-5-20251001-v1:0 (status ACTIVE; the "us."
prefix matches the us-east-1 Region these samples use).

Claude Haiku 4.5 rejects temperature and topP in the same request, so the
topP inference parameter is removed from the Java, .NET, JavaScript, and
Swift samples; without this they would still fail after the model swap.
The Rust and Go samples set no inference config and are unaffected. The Go
unit-test constant CONVERSE_CLAUDE_MODEL_ID is updated in lockstep with
the sample so its stubbed test still matches.

Verified live in us-east-1 against the new profile: the Go ConverseClaude
action and the shared inference-config shapes all return 200.

This updates the non-Python languages that share the defect fixed for
Python in the Bedrock User Guide ConverseStream / Anthropic Claude page.

sim: https://t.corp.amazon.com/V2245921888
@brmur
brmur requested a review from rlhagerm as a code owner October 12, 2026 10:56
@github-actions github-actions Bot added DotNet-v3 This issue relates to the AWS SDK for .NET V3 Go-v2 This issue relates to the AWS SDK for Go V2 Javascript-v3 This issue relates to the AWS SDK for Javascript V3 Rust This issue relates to the AWS SDK for Rust (Preview) Swift This issue relates to the AWS SDK for Swift Java-v2 This issue relates to the AWS SDK for Java V2 labels Oct 12, 2026
@brmur
brmur requested review from DennisTraub and removed request for rlhagerm October 12, 2026 11:03
@brmur brmur added the Task A general update to the code base for language clarification, missing actions, tests, etc. label Oct 12, 2026
…bers

Rerun .tools/readmes/writeme.py after the model-ID changes shifted snippet
anchors in the Go and Rust Converse samples (converse.go#L53->#L55,
converse.rs#L43->#L45, converse-stream.rs#L70->#L72).

sim: https://t.corp.amazon.com/V2245921888

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 AI Code Example Review

This PR passes review. It makes a focused, well-reasoned model-ID update across 15 files to replace an end-of-life Claude 3 Haiku model with the active Claude Haiku 4.5 inference profile, and correctly removes the topP inference parameter that the new model rejects when combined with temperature. All changes are consistent, commented, and the Go unit test constant is kept in sync.

Detailed Review

  1. [nit] dotnetv3/Bedrock-runtime/Models/AnthropicClaude/Converse/Converse.cs and its dotnetv4 counterpart both contain a duplicated namespace AnthropicClaude { public partial class Converse { } } declaration at the end of the file. This is a pre-existing issue not introduced by this PR, but worth flagging since it will generate a compiler warning about duplicate partial class declarations.

  2. [nit] The Go converse.go file declares modelId as a local variable (modelId := "us.anthropic...") rather than a package-level or file-level constant. This is inconsistent with the Rust files, which use const MODEL_ID. Since the model ID is not dynamically determined, a const would better signal its fixed nature and be consistent across languages. That said, this is a pre-existing pattern and not introduced by this PR.

  3. [nit] The Swift Converse/main.swift and ConverseStream/main.swift files retain stopSequences: ["END"] in their InferenceConfiguration. This is a pre-existing parameter not changed by this PR, and it's worth confirming it does not cause a ValidationException with Claude Haiku 4.5 in the same way topP did. The PR description mentions the Swift shape was tested live and returns 200, so this appears verified.

  4. [policy] No new automated tests were added for the non-Go languages (.NET, Java, JavaScript, Rust, Swift). The Go unit test constant was correctly updated to match the new model ID. For the other languages, the PR relies on live manual verification rather than CI-enforced tests. This is acceptable for a model-ID-only change, but worth noting as a policy observation.

  5. [nit] The README.md line-number anchors in gov2/bedrock-runtime/README.md and rustv1/examples/bedrock-runtime/README.md were updated to reflect the new line positions after adding comment lines. This is good housekeeping. However, README anchor line numbers are fragile and will drift with future edits — consider whether the project has a better mechanism (e.g., named anchors) for this.

  6. [nit] The comment style for the model ID explanation is slightly inconsistent across languages. Java, .NET, and JavaScript use a two-line comment block; Go and Rust use a single-line comment; Swift uses a two-line comment. This is a minor cosmetic inconsistency across the codebase and is not introduced by this PR.

  7. [policy] The PR description notes that two tool-use demos referencing retired model IDs are intentionally deferred. This is a reasonable scoping decision, but the deferred work should be tracked to avoid those samples remaining broken indefinitely.

  8. [nit] In converse.go, the comment reads // the "us." cross-Region profile ID. without explicitly mentioning that it matches a specific region. The other language files say ...that matches the Region set above or ...that matches CLAUDE_REGION below, which is more informative for readers. The Go version is slightly less explicit.

  9. [nit] The CONVERSE_CLAUDE_MODEL_ID constant in converse_test.go uses UPPER_SNAKE_CASE, which is idiomatic for Go exported constants but the name is arguably redundant with the CONVERSE_ prefix given the file context. This is pre-existing style and not introduced by this PR.

  10. [policy] The PR has been verified manually against us-east-1, but the inference profile ID us.anthropic.claude-haiku-4-5-20251001-v1:0 is region-specific (the us. prefix). Samples that hardcode us-east-1 as the region are consistent with this profile, but readers deploying in other regions (e.g., eu-west-1) would need a different profile prefix. A brief note in the comments or README about this constraint would improve discoverability, though this is a minor documentation nit.


Reviewed at commit 04bf88c4d5fa59a9128df608de1158c0e9a7360c. This review was generated automatically using Amazon Bedrock. It compares your changes against existing examples and coding guidelines. Findings are labeled by severity (blocking / nit / policy) and reflect only the commit above. Please use your judgment — this is advisory, not authoritative.

@brmur

brmur commented Oct 12, 2026

Copy link
Copy Markdown
Collaborator Author

Depends on #8207 (merge that first).

The Lint Rust check on this PR fails for a pre-existing, repo-wide reason unrelated to these changes: CI pins rustc 1.88.0 but the current AWS SDK for Rust crates require 1.94.1. #8207 bumps the toolchain and fixes the resulting lint/dependency failures. Once #8207 merges to main, rebasing this PR will clear its Lint Rust check.

@DennisTraub DennisTraub left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One change requested across all examples: Use us.anthropic.claude-haiku-5-5

Update the Converse/ConverseStream Anthropic Claude samples across Java,
.NET v3/v4, JavaScript, Rust, Swift, and Go (plus the Go unit-test
constant) from Claude Haiku 4.5 to the active Claude Haiku 5.5 inference
profile us.anthropic.claude-haiku-5-5.

Claude Haiku 5.5 deprecates both temperature and top_p, so also remove
the temperature inference parameter from the Java, .NET, JavaScript, and
Swift samples (topP was already removed for Haiku 4.5). Rust and Go set
no inference config and are unaffected beyond the model-ID change.

All inference-config shapes verified live against the new profile
(return 200); gofmt and cargo fmt are clean.
@brmur brmur changed the title Multi-language: Update Anthropic Claude Converse samples to active Claude Haiku 4.5 Multi-language: Update Anthropic Claude Converse samples to active Claude Haiku 5.5 Oct 13, 2026

@DennisTraub DennisTraub left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rlhagerm rlhagerm added the On Call Review complete On call review complete label Oct 13, 2026
@rlhagerm
rlhagerm merged commit 6bedc50 into awsdocs:main Oct 13, 2026
17 of 18 checks passed
brmur added a commit to brmur/aws-doc-sdk-examples that referenced this pull request Oct 13, 2026
Rerun writeme to update the Converse/ConverseStream line anchors that
shifted when awsdocs#8205 merged into main, resolving the Validate WRITEMEs
check failure.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DotNet-v3 This issue relates to the AWS SDK for .NET V3 Go-v2 This issue relates to the AWS SDK for Go V2 Java-v2 This issue relates to the AWS SDK for Java V2 Javascript-v3 This issue relates to the AWS SDK for Javascript V3 On Call Review complete On call review complete Rust This issue relates to the AWS SDK for Rust (Preview) Swift This issue relates to the AWS SDK for Swift Task A general update to the code base for language clarification, missing actions, tests, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants