Skip to content

feat(aws-bedrock): add new models [bot]#934

Merged
harshiv-26 merged 3 commits intomainfrom
bot/add-aws-bedrock-20260505-000255
May 6, 2026
Merged

feat(aws-bedrock): add new models [bot]#934
harshiv-26 merged 3 commits intomainfrom
bot/add-aws-bedrock-20260505-000255

Conversation

@harshiv-26
Copy link
Copy Markdown
Collaborator

@harshiv-26 harshiv-26 commented May 5, 2026

Auto-generated by model-addition-agent for provider aws-bedrock.


Note

Low Risk
Low risk: adds a new AWS Bedrock model metadata YAML without changing runtime logic; main risk is incorrect pricing/limits/feature flags affecting model selection or cost estimates.

Overview
Adds a new AWS Bedrock model definition au.anthropic.claude-opus-4-7.yaml, enabling the AU Claude Opus 4.7 variant to be discovered/used with declared token pricing (incl. prompt caching) for ap-southeast-2 and ap-southeast-4.

The model config also specifies supported capabilities (tool/function calling, cache controls, system messages, assistant prefill), large context/output limits, and parameter handling (sets max_tokens defaults and removes temperature/top_p), with thinking: true and status: active.

Reviewed by Cursor Bugbot for commit 1251011. Bugbot is set up for automated code reviews on this repo. Configure here.

Comment thread providers/aws-bedrock/au.anthropic.claude-opus-4-7.yaml
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

/test-models

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 1ddc3b0. Configure here.

Comment thread providers/aws-bedrock/au.anthropic.claude-opus-4-7.yaml
Comment thread providers/aws-bedrock/au.anthropic.claude-opus-4-7.yaml
@harshiv-26
Copy link
Copy Markdown
Collaborator Author

Gateway test results

  • Total: 16
  • Passed: 0
  • Failed: 8
  • Validation failed: 0
  • Errored: 0
  • Skipped: 8
  • Success rate: 0.0%
Provider Model Scenarios
aws-bedrock au.anthropic.claude-opus-4-7 failure: reasoning, params, parallel-tool-call, tool-call, params:boto3, parallel-tool-call:boto3, reasoning:boto3, tool-call:boto3

skipped: tool-call:stream:boto3, reasoning:stream, params:stream, parallel-tool-call:stream:boto3, params:stream:boto3, reasoning:stream:boto3, tool-call:stream, parallel-tool-call:stream
Failures (8)

aws-bedrock/au.anthropic.claude-opus-4-7 — reasoning (failure)

Error:

Traceback (most recent call last):
  File "/tmp/tmp5yd6wsid/snippet.py", line 5, in <module>
    response = client.chat.completions.create(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/openai/_utils/_utils.py", line 286, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/openai/resources/chat/completions/completions.py", line 1147, in create
    return self._post(
           ^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/openai/_base_client.py", line 1259, in post
    return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/openai/_base_client.py", line 1047, in request
    raise self._make_status_error_from_response(err.response) from None
openai.BadRequestError: Error code: 400 - {'status': 'failure', 'message': 'aws-bedrock error: The model returned the following errors: You have not filled out the required use-case form for this model. Complete the form at https://ap-southeast-4.console.aws.amazon.com/bedrock/ before requesting access.', 'error': {'message': 'aws-bedrock error: The model returned the following errors: You have not filled out the required use-case form for this model. Complete the form at https://ap-southeast-4.console.aws.amazon.com/bedrock/ before requesting access.', 'type': 'APIError', 'code': '400'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
Code snippet
from openai import OpenAI

client = OpenAI(api_key="***", base_url="https://internal.devtest.truefoundry.tech/api/llm")

response = client.chat.completions.create(
    model="test-v2-aws-bedrock/au.anthropic.claude-opus-4-7",
    messages=[
        {"role": "system", "content": "You are a helpful assistant. You MUST think step by step and show your reasoning. Never skip reasoning steps."},
        {"role": "user", "content": "Hi"},
        {"role": "assistant", "content": "Hi, how can I help you"},
        {"role": "user", "content": "How to calculate 3^3^3^3? Think step by step and show all reasoning."},
    ],
    reasoning_effort="medium",
    stream=False,
)

_usage = getattr(response, "usage", None)
_reasoning_detected = False

_choices = getattr(response, "choices", None)
if _choices and len(_choices) > 0:
    _message = getattr(_choices[0], "message", None)
else:
    _message = None

if _message and getattr(_message, "content", None) is not None:
    print(_message.content)

if _usage is not None:
    _output_token_details = getattr(_usage, "completion_tokens_details", None)
    if _output_token_details and getattr(_output_token_details, "reasoning_tokens", 0) > 0:
        _reasoning_detected = True
    elif getattr(_usage, "reasoning", None) is not None:
        _reasoning_detected = True

if getattr(_message, "reasoning_content", None) is not None:
    _reasoning_detected = True
elif getattr(_message, "reasoning", None) is not None:
    _reasoning_detected = True

if not _reasoning_detected:
    print("Response: ", response)
    raise Exception("VALIDATION FAILED: reasoning - no reasoning information in response")
print("VALIDATION: reasoning SUCCESS")

aws-bedrock/au.anthropic.claude-opus-4-7 — params (failure)

Error:

Traceback (most recent call last):
  File "/tmp/tmpavlx4otc/snippet.py", line 5, in <module>
    response = client.chat.completions.create(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/openai/_utils/_utils.py", line 286, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/openai/resources/chat/completions/completions.py", line 1147, in create
    return self._post(
           ^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/openai/_base_client.py", line 1259, in post
    return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/openai/_base_client.py", line 1047, in request
    raise self._make_status_error_from_response(err.response) from None
openai.BadRequestError: Error code: 400 - {'status': 'failure', 'message': 'aws-bedrock error: The model returned the following errors: You have not filled out the required use-case form for this model. Complete the form at https://ap-southeast-4.console.aws.amazon.com/bedrock/ before requesting access.', 'error': {'message': 'aws-bedrock error: The model returned the following errors: You have not filled out the required use-case form for this model. Complete the form at https://ap-southeast-4.console.aws.amazon.com/bedrock/ before requesting access.', 'type': 'APIError', 'code': '400'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
Code snippet
from openai import OpenAI

client = OpenAI(api_key="***", base_url="https://internal.devtest.truefoundry.tech/api/llm")

response = client.chat.completions.create(
    model="test-v2-aws-bedrock/au.anthropic.claude-opus-4-7",
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "Hi"},
        {"role": "assistant", "content": "Hi, how can I help you"},
        {"role": "user", "content": "What is the capital of France?"},
    ],
    max_tokens=1000,
    stream=False,
)

print(response.choices[0].message.content)

aws-bedrock/au.anthropic.claude-opus-4-7 — parallel-tool-call (failure)

Error:

Traceback (most recent call last):
  File "/tmp/tmp22hd0klt/snippet.py", line 27, in <module>
    response = client.chat.completions.create(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/openai/_utils/_utils.py", line 286, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/openai/resources/chat/completions/completions.py", line 1147, in create
    return self._post(
           ^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/openai/_base_client.py", line 1259, in post
    return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/openai/_base_client.py", line 1047, in request
    raise self._make_status_error_from_response(err.response) from None
openai.BadRequestError: Error code: 400 - {'status': 'failure', 'message': 'aws-bedrock error: The model returned the following errors: You have not filled out the required use-case form for this model. Complete the form at https://ap-southeast-4.console.aws.amazon.com/bedrock/ before requesting access.', 'error': {'message': 'aws-bedrock error: The model returned the following errors: You have not filled out the required use-case form for this model. Complete the form at https://ap-southeast-4.console.aws.amazon.com/bedrock/ before requesting access.', 'type': 'APIError', 'code': '400'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
Code snippet
from openai import OpenAI

client = OpenAI(api_key="***", base_url="https://internal.devtest.truefoundry.tech/api/llm")

tools = [
    {
        "type": "function",
        "function": {
            "name": "get_weather",
            "description": "Get the current weather for a location.",
            "parameters": {
                "type": "object",
                "properties": {
                    "location": {
                        "type": "string",
                        "description": "The city name, e.g. London",
                    },
                },
                "required": ["location"],
                "additionalProperties": False,
            },
            "strict": True,
        },
    },
]

response = client.chat.completions.create(
    model="test-v2-aws-bedrock/au.anthropic.claude-opus-4-7",
    messages=[
        {"role": "system", "content": "You are a helpful assistant with access to tools. You MUST strictly call multiple tools in parallel whenever possible. Never call them sequentially."},
        {"role": "user", "content": "Hi"},
        {"role": "assistant", "content": "Hi, how can I help you"},
        {"role": "user", "content": "Use the get_weather tool to check the weather in London and Paris. You MUST make both tool calls strictly in parallel, not sequentially."},
    ],
    tools=tools,
    tool_choice="auto",
    parallel_tool_calls=True,
    stream=False,
)

_message = response.choices[0].message
if _message.tool_calls:
    print(f"Number of parallel tool calls: {len(_message.tool_calls)}")
    for _tc in _message.tool_calls:
        print(f"Function: {_tc.function.name}")
        print(f"Arguments: {_tc.function.arguments}")
else:
    print(_message.content)

if not _message.tool_calls or len(_message.tool_calls) < 1:
    raise Exception(
        f"VALIDATION FAILED: parallel-tool-call - expected at least 1 tool call, "
        f"got {len(_message.tool_calls) if _message.tool_calls else 0}"
    )
print("VALIDATION: parallel-tool-call SUCCESS")

aws-bedrock/au.anthropic.claude-opus-4-7 — tool-call (failure)

Error:

Traceback (most recent call last):
  File "/tmp/tmptsp3c2kw/snippet.py", line 27, in <module>
    response = client.chat.completions.create(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/openai/_utils/_utils.py", line 286, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/openai/resources/chat/completions/completions.py", line 1147, in create
    return self._post(
           ^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/openai/_base_client.py", line 1259, in post
    return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/openai/_base_client.py", line 1047, in request
    raise self._make_status_error_from_response(err.response) from None
openai.BadRequestError: Error code: 400 - {'status': 'failure', 'message': 'aws-bedrock error: The model returned the following errors: You have not filled out the required use-case form for this model. Complete the form at https://ap-southeast-4.console.aws.amazon.com/bedrock/ before requesting access.', 'error': {'message': 'aws-bedrock error: The model returned the following errors: You have not filled out the required use-case form for this model. Complete the form at https://ap-southeast-4.console.aws.amazon.com/bedrock/ before requesting access.', 'type': 'APIError', 'code': '400'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
Code snippet
from openai import OpenAI

client = OpenAI(api_key="***", base_url="https://internal.devtest.truefoundry.tech/api/llm")

tools = [
    {
        "type": "function",
        "function": {
            "name": "get_weather",
            "description": "Get the current weather for a location.",
            "parameters": {
                "type": "object",
                "properties": {
                    "location": {
                        "type": "string",
                        "description": "The city name, e.g. London",
                    },
                },
                "required": ["location"],
                "additionalProperties": False,
            },
            "strict": True,
        },
    },
]

response = client.chat.completions.create(
    model="test-v2-aws-bedrock/au.anthropic.claude-opus-4-7",
    messages=[
        {"role": "system", "content": "You are a helpful assistant with access to tools. You MUST strictly use the provided tools to answer. Never respond with plain text when a tool is available."},
        {"role": "user", "content": "Hi"},
        {"role": "assistant", "content": "Hi, how can I help you"},
        {"role": "user", "content": "Use the get_weather tool to check the weather in London. You must call the tool, do not respond with plain text."},
    ],
    tools=tools,
    tool_choice="auto",
    stream=False,
)

_message = response.choices[0].message
if _message.tool_calls:
    for _tc in _message.tool_calls:
        print(f"Function: {_tc.function.name}")
        print(f"Arguments: {_tc.function.arguments}")
else:
    print(_message.content)

if not _message.tool_calls or len(_message.tool_calls) == 0:
    raise Exception("VALIDATION FAILED: tool-call - no tool calls in response")
print("VALIDATION: tool-call SUCCESS")

aws-bedrock/au.anthropic.claude-opus-4-7 — params:boto3 (failure)

Error:

Traceback (most recent call last):
  File "/tmp/tmpf35ywmbk/snippet.py", line 30, in <module>
    response = client.converse(
               ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/botocore/client.py", line 606, in _api_call
    return self._make_api_call(operation_name, kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/botocore/context.py", line 123, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/botocore/client.py", line 1094, in _make_api_call
    raise error_class(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (500) when calling the Converse operation (reached max retries: 4): The model returned the following errors: You have not filled out the required use-case form for this model. Complete the form at https://ap-southeast-4.console.aws.amazon.com/bedrock/ before requesting access.
Code snippet
import boto3
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm/bedrock"
_api_key = "***"
_model = "test-v2-aws-bedrock/au.anthropic.claude-opus-4-7"

client = boto3.client(
    "bedrock-runtime",
    region_name="us-east-1",
    endpoint_url=f"{_endpoint}/proxy",
    aws_access_key_id="dummy",
    aws_secret_access_key="dummy",
    config=Config(inject_host_prefix=False),
)

def _add_auth_header(request, **kwargs):
    request.headers["x-tfy-api-key"] = _api_key

client.meta.events.register("before-sign.bedrock-runtime.*", _add_auth_header)

messages = [
    {"role": "user", "content": [{"text": "Hi"}]},
    {"role": "assistant", "content": [{"text": "Hi, how can I help you"}]},
    {"role": "user", "content": [{"text": "What is the capital of France?"}]},
]

system = [{"text": "You are a helpful assistant."}]

response = client.converse(
    modelId=_model,
    system=system,
    messages=messages,
    inferenceConfig={
        "maxTokens": 1000,
    },
)

_content = response["output"]["message"]["content"]
for _block in _content:
    if "text" in _block:
        print(_block["text"])

aws-bedrock/au.anthropic.claude-opus-4-7 — parallel-tool-call:boto3 (failure)

Error:

Traceback (most recent call last):
  File "/tmp/tmp61ze2a51/snippet.py", line 54, in <module>
    response = client.converse(
               ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/botocore/client.py", line 606, in _api_call
    return self._make_api_call(operation_name, kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/botocore/context.py", line 123, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/botocore/client.py", line 1094, in _make_api_call
    raise error_class(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (500) when calling the Converse operation (reached max retries: 4): The model returned the following errors: You have not filled out the required use-case form for this model. Complete the form at https://ap-southeast-4.console.aws.amazon.com/bedrock/ before requesting access.
Code snippet
import boto3
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm/bedrock"
_api_key = "***"
_model = "test-v2-aws-bedrock/au.anthropic.claude-opus-4-7"

client = boto3.client(
    "bedrock-runtime",
    region_name="us-east-1",
    endpoint_url=f"{_endpoint}/proxy",
    aws_access_key_id="dummy",
    aws_secret_access_key="dummy",
    config=Config(inject_host_prefix=False),
)

def _add_auth_header(request, **kwargs):
    request.headers["x-tfy-api-key"] = _api_key

client.meta.events.register("before-sign.bedrock-runtime.*", _add_auth_header)

tool_config = {
    "tools": [
        {
            "toolSpec": {
                "name": "get_weather",
                "description": "Get the current weather for a location.",
                "inputSchema": {
                    "json": {
                        "type": "object",
                        "properties": {
                            "location": {
                                "type": "string",
                                "description": "The city name, e.g. London",
                            },
                        },
                        "required": ["location"],
                    }
                },
            }
        }
    ],
    "toolChoice": {"auto": {}},
}

messages = [
    {"role": "user", "content": [{"text": "Hi"}]},
    {"role": "assistant", "content": [{"text": "Hi, how can I help you"}]},
    {"role": "user", "content": [{"text": "Use the get_weather tool to check the weather in London and Paris. You MUST make both tool calls strictly in parallel, not sequentially."}]},
]

system = [{"text": "You are a helpful assistant with access to tools. You MUST strictly call multiple tools in parallel whenever possible. Never call them sequentially."}]

response = client.converse(
    modelId=_model,
    system=system,
    messages=messages,
    toolConfig=tool_config,
)

_content = response["output"]["message"]["content"]
_tool_uses = [block for block in _content if "toolUse" in block]
if _tool_uses:
    for _tu in _tool_uses:
        print(f"Tool: {_tu['toolUse']['name']}")
        print(f"Input: {_tu['toolUse']['input']}")
else:
    _text_blocks = [block["text"] for block in _content if "text" in block]
    print("\n".join(_text_blocks))

_content = response["output"]["message"]["content"]
_tool_uses = [block for block in _content if "toolUse" in block]

if _tool_uses:
    print(f"Number of parallel tool calls: {len(_tool_uses)}")
    for _tu in _tool_uses:
        print(f"Tool: {_tu['toolUse']['name']}")
        print(f"Input: {_tu['toolUse']['input']}")
else:
    _text_blocks = [block["text"] for block in _content if "text" in block]
    print("\n".join(_text_blocks))

if not _tool_uses or len(_tool_uses) < 1:
    raise Exception(
        f"VALIDATION FAILED: parallel-tool-call - expected at least 1 tool call, "
        f"got {len(_tool_uses) if _tool_uses else 0}"
    )
print("VALIDATION: parallel-tool-call SUCCESS")

aws-bedrock/au.anthropic.claude-opus-4-7 — reasoning:boto3 (failure)

Error:

Traceback (most recent call last):
  File "/tmp/tmpq23ahys4/snippet.py", line 30, in <module>
    response = client.converse(
               ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/botocore/client.py", line 606, in _api_call
    return self._make_api_call(operation_name, kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/botocore/context.py", line 123, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/botocore/client.py", line 1094, in _make_api_call
    raise error_class(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (500) when calling the Converse operation (reached max retries: 4): The model returned the following errors: You have not filled out the required use-case form for this model. Complete the form at https://ap-southeast-4.console.aws.amazon.com/bedrock/ before requesting access.
Code snippet
import boto3
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm/bedrock"
_api_key = "***"
_model = "test-v2-aws-bedrock/au.anthropic.claude-opus-4-7"

client = boto3.client(
    "bedrock-runtime",
    region_name="us-east-1",
    endpoint_url=f"{_endpoint}/proxy",
    aws_access_key_id="dummy",
    aws_secret_access_key="dummy",
    config=Config(inject_host_prefix=False),
)

def _add_auth_header(request, **kwargs):
    request.headers["x-tfy-api-key"] = _api_key

client.meta.events.register("before-sign.bedrock-runtime.*", _add_auth_header)

messages = [
    {"role": "user", "content": [{"text": "Hi"}]},
    {"role": "assistant", "content": [{"text": "Hi, how can I help you"}]},
    {"role": "user", "content": [{"text": "How to calculate 3^3^3^3? Think step by step and show all reasoning."}]},
]

system = [{"text": "You are a helpful assistant. You MUST think step by step and show your reasoning. Never skip reasoning steps."}]

response = client.converse(
    modelId=_model,
    system=system,
    messages=messages,
    additionalModelRequestFields={
        "thinking": {"type":"adaptive"},
    },
)

_content = response["output"]["message"]["content"]
for _block in _content:
    if "reasoningContent" in _block:
        print(_block["reasoningContent"]["reasoningText"]["text"])
    if "text" in _block:
        print(_block["text"])

_content = response["output"]["message"]["content"]
_reasoning_detected = False

for _block in _content:
    if "text" in _block:
        print(_block["text"])
    if "reasoningContent" in _block:
        _reasoning_detected = True
        _reasoning = _block["reasoningContent"]
        if "reasoningText" in _reasoning:
            print(f"Reasoning: {_reasoning['reasoningText']['text'][:200]}...")

_usage = response.get("usage", {})
if _usage.get("reasoning_tokens") or _usage.get("reasoningTokens"):
    _reasoning_detected = True

if not _reasoning_detected:
    print("Response: ", response)
    raise Exception("VALIDATION FAILED: reasoning - no reasoning information in Bedrock response")
print("VALIDATION: reasoning SUCCESS")

aws-bedrock/au.anthropic.claude-opus-4-7 — tool-call:boto3 (failure)

Error:

Traceback (most recent call last):
  File "/tmp/tmpxlfvfq2a/snippet.py", line 54, in <module>
    response = client.converse(
               ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/botocore/client.py", line 606, in _api_call
    return self._make_api_call(operation_name, kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/botocore/context.py", line 123, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/botocore/client.py", line 1094, in _make_api_call
    raise error_class(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (500) when calling the Converse operation (reached max retries: 4): The model returned the following errors: You have not filled out the required use-case form for this model. Complete the form at https://ap-southeast-4.console.aws.amazon.com/bedrock/ before requesting access.
Code snippet
import boto3
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm/bedrock"
_api_key = "***"
_model = "test-v2-aws-bedrock/au.anthropic.claude-opus-4-7"

client = boto3.client(
    "bedrock-runtime",
    region_name="us-east-1",
    endpoint_url=f"{_endpoint}/proxy",
    aws_access_key_id="dummy",
    aws_secret_access_key="dummy",
    config=Config(inject_host_prefix=False),
)

def _add_auth_header(request, **kwargs):
    request.headers["x-tfy-api-key"] = _api_key

client.meta.events.register("before-sign.bedrock-runtime.*", _add_auth_header)

tool_config = {
    "tools": [
        {
            "toolSpec": {
                "name": "get_weather",
                "description": "Get the current weather for a location.",
                "inputSchema": {
                    "json": {
                        "type": "object",
                        "properties": {
                            "location": {
                                "type": "string",
                                "description": "The city name, e.g. London",
                            },
                        },
                        "required": ["location"],
                    }
                },
            }
        }
    ],
    "toolChoice": {"auto": {}},
}

messages = [
    {"role": "user", "content": [{"text": "Hi"}]},
    {"role": "assistant", "content": [{"text": "Hi, how can I help you"}]},
    {"role": "user", "content": [{"text": "Use the get_weather tool to check the weather in London. You must call the tool, do not respond with plain text."}]},
]

system = [{"text": "You are a helpful assistant with access to tools. You MUST strictly use the provided tools to answer. Never respond with plain text when a tool is available."}]

response = client.converse(
    modelId=_model,
    system=system,
    messages=messages,
    toolConfig=tool_config,
)

_content = response["output"]["message"]["content"]
_tool_uses = [block for block in _content if "toolUse" in block]
if _tool_uses:
    for _tu in _tool_uses:
        print(f"Tool: {_tu['toolUse']['name']}")
        print(f"Input: {_tu['toolUse']['input']}")
else:
    _text_blocks = [block["text"] for block in _content if "text" in block]
    print("\n".join(_text_blocks))

_content = response["output"]["message"]["content"]
_tool_uses = [block for block in _content if "toolUse" in block]

if _tool_uses:
    for _tu in _tool_uses:
        print(f"Tool: {_tu['toolUse']['name']}")
        print(f"Input: {_tu['toolUse']['input']}")
else:
    _text_blocks = [block["text"] for block in _content if "text" in block]
    print("\n".join(_text_blocks))

if not _tool_uses:
    raise Exception("VALIDATION FAILED: tool-call - no tool uses in Bedrock response")
print("VALIDATION: tool-call SUCCESS")
Skipped (8)

aws-bedrock/au.anthropic.claude-opus-4-7 — tool-call:stream:boto3 (skipped)

Skip reason:

Snippet runner exceeded its timeout

aws-bedrock/au.anthropic.claude-opus-4-7 — reasoning:stream (skipped)

Skip reason:

Snippet runner exceeded its timeout

aws-bedrock/au.anthropic.claude-opus-4-7 — params:stream (skipped)

Skip reason:

Snippet runner exceeded its timeout

aws-bedrock/au.anthropic.claude-opus-4-7 — parallel-tool-call:stream:boto3 (skipped)

Skip reason:

Snippet runner exceeded its timeout

aws-bedrock/au.anthropic.claude-opus-4-7 — params:stream:boto3 (skipped)

Skip reason:

Snippet runner exceeded its timeout

aws-bedrock/au.anthropic.claude-opus-4-7 — reasoning:stream:boto3 (skipped)

Skip reason:

Snippet runner exceeded its timeout

aws-bedrock/au.anthropic.claude-opus-4-7 — tool-call:stream (skipped)

Skip reason:

Snippet runner exceeded its timeout

aws-bedrock/au.anthropic.claude-opus-4-7 — parallel-tool-call:stream (skipped)

Skip reason:

Snippet runner exceeded its timeout

@harshiv-26
Copy link
Copy Markdown
Collaborator Author

/test-models

@harshiv-26
Copy link
Copy Markdown
Collaborator Author

Gateway test results

  • Total: 16
  • Passed: 15
  • Failed: 0
  • Validation failed: 1
  • Errored: 0
  • Skipped: 0
  • Success rate: 93.75%
Provider Model Scenarios
aws-bedrock au.anthropic.claude-opus-4-7 success: params:boto3, params:stream:boto3, params:stream, params, tool-call:stream:boto3, tool-call:boto3, tool-call:stream, tool-call, parallel-tool-call:stream:boto3, parallel-tool-call:boto3, parallel-tool-call, parallel-tool-call:stream, reasoning:boto3, reasoning:stream, reasoning:stream:boto3

validation_failure: reasoning
Failures (1)

aws-bedrock/au.anthropic.claude-opus-4-7 — reasoning (validation_failure)

Error:

Traceback (most recent call last):
  File "/tmp/tmpe0n_ax8x/snippet.py", line 43, in <module>
    raise Exception("VALIDATION FAILED: reasoning - no reasoning information in response")
Exception: VALIDATION FAILED: reasoning - no reasoning information in response
Code snippet
from openai import OpenAI

client = OpenAI(api_key="***", base_url="https://internal.devtest.truefoundry.tech/api/llm")

response = client.chat.completions.create(
    model="test-v2-aws-bedrock/au.anthropic.claude-opus-4-7",
    messages=[
        {"role": "system", "content": "You are a helpful assistant. You MUST think step by step and show your reasoning. Never skip reasoning steps."},
        {"role": "user", "content": "Hi"},
        {"role": "assistant", "content": "Hi, how can I help you"},
        {"role": "user", "content": "How to calculate 3^3^3^3? Think step by step and show all reasoning."},
    ],
    reasoning_effort="medium",
    stream=False,
)

_usage = getattr(response, "usage", None)
_reasoning_detected = False

_choices = getattr(response, "choices", None)
if _choices and len(_choices) > 0:
    _message = getattr(_choices[0], "message", None)
else:
    _message = None

if _message and getattr(_message, "content", None) is not None:
    print(_message.content)

if _usage is not None:
    _output_token_details = getattr(_usage, "completion_tokens_details", None)
    if _output_token_details and getattr(_output_token_details, "reasoning_tokens", 0) > 0:
        _reasoning_detected = True
    elif getattr(_usage, "reasoning", None) is not None:
        _reasoning_detected = True

if getattr(_message, "reasoning_content", None) is not None:
    _reasoning_detected = True
elif getattr(_message, "reasoning", None) is not None:
    _reasoning_detected = True

if not _reasoning_detected:
    print("Response: ", response)
    raise Exception("VALIDATION FAILED: reasoning - no reasoning information in response")
print("VALIDATION: reasoning SUCCESS")

@harshiv-26 harshiv-26 closed this May 6, 2026
@harshiv-26 harshiv-26 deleted the bot/add-aws-bedrock-20260505-000255 branch May 6, 2026 00:03
@harshiv-26 harshiv-26 restored the bot/add-aws-bedrock-20260505-000255 branch May 6, 2026 05:18
@harshiv-26 harshiv-26 reopened this May 6, 2026
@harshiv-26 harshiv-26 enabled auto-merge (squash) May 6, 2026 08:03
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

/test-models

@harshiv-26 harshiv-26 merged commit 28e1adb into main May 6, 2026
8 checks passed
@harshiv-26 harshiv-26 deleted the bot/add-aws-bedrock-20260505-000255 branch May 6, 2026 08:04
@harshiv-26
Copy link
Copy Markdown
Collaborator Author

Gateway test results

  • Total: 16
  • Passed: 15
  • Failed: 0
  • Validation failed: 1
  • Errored: 0
  • Skipped: 0
  • Success rate: 93.75%
Provider Model Scenarios
aws-bedrock au.anthropic.claude-opus-4-7 success: params:boto3, params:stream:boto3, tool-call:stream:boto3, parallel-tool-call:boto3, params, params:stream, parallel-tool-call:stream:boto3, tool-call:stream, parallel-tool-call, parallel-tool-call:stream, tool-call, tool-call:boto3, reasoning:boto3, reasoning:stream:boto3, reasoning:stream

validation_failure: reasoning
Failures (1)

aws-bedrock/au.anthropic.claude-opus-4-7 — reasoning (validation_failure)

Error:

Traceback (most recent call last):
  File "/tmp/tmp15lo3x81/snippet.py", line 43, in <module>
    raise Exception("VALIDATION FAILED: reasoning - no reasoning information in response")
Exception: VALIDATION FAILED: reasoning - no reasoning information in response
Code snippet
from openai import OpenAI

client = OpenAI(api_key="***", base_url="https://internal.devtest.truefoundry.tech/api/llm")

response = client.chat.completions.create(
    model="test-v2-aws-bedrock/au.anthropic.claude-opus-4-7",
    messages=[
        {"role": "system", "content": "You are a helpful assistant. You MUST think step by step and show your reasoning. Never skip reasoning steps."},
        {"role": "user", "content": "Hi"},
        {"role": "assistant", "content": "Hi, how can I help you"},
        {"role": "user", "content": "How to calculate 3^3^3^3? Think step by step and show all reasoning."},
    ],
    reasoning_effort="medium",
    stream=False,
)

_usage = getattr(response, "usage", None)
_reasoning_detected = False

_choices = getattr(response, "choices", None)
if _choices and len(_choices) > 0:
    _message = getattr(_choices[0], "message", None)
else:
    _message = None

if _message and getattr(_message, "content", None) is not None:
    print(_message.content)

if _usage is not None:
    _output_token_details = getattr(_usage, "completion_tokens_details", None)
    if _output_token_details and getattr(_output_token_details, "reasoning_tokens", 0) > 0:
        _reasoning_detected = True
    elif getattr(_usage, "reasoning", None) is not None:
        _reasoning_detected = True

if getattr(_message, "reasoning_content", None) is not None:
    _reasoning_detected = True
elif getattr(_message, "reasoning", None) is not None:
    _reasoning_detected = True

if not _reasoning_detected:
    print("Response: ", response)
    raise Exception("VALIDATION FAILED: reasoning - no reasoning information in response")
print("VALIDATION: reasoning SUCCESS")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants