ISSUE DESCRIPTION Bedrock: strict=None auto-promotes many tools to strict and hits…
- User
ISSUE DESCRIPTION
Bedrock:
strict=Noneauto-promotes many tools to strict and hits provider limitInitial Checks
- I'm using the latest version of Pydantic AI
- I've searched for my issue in the issue tracker before opening this issue
Description
Summary
pydantic-ai-slim==1.101.0can now fail Bedrock Claude requests with many tools becauseToolDefinition.strict=Noneis inferred asstrict=Truefor simple schemas. Bedrock/Claude rejects requests with more than 20 strict tools (source):ValidationException: Too many strict tools (73). The maximum number of strict tools supported is 20.This is a behavior regression for callers that did not explicitly opt into strict tool definitions.
What happened
A production agent sends 73 function tools to Bedrock. Before 1.101.0 these tools were sent as normal, non-strict Bedrock tools.
After 1.101.0, these tool definitions have strict=None, and the Bedrock schema transformer infers many/all simple schemas as strict-compatible. _customize_tool_def() then replaces strict=None with strict=True, and BedrockConverseModel._map_tool_definition() sends toolSpec.strict = true. Bedrock rejects the request because it only supports 20 strict tools.
Disclosure: I authored #4237 ✋ . My tests and vcr cassettes didn't account for the >20-tool case.
Expected behavior
For Bedrock, strict=None should not silently turn large toolsets into strict toolsets that violate Bedrock limits.
Possible fixes:
Similar to Anthropic, do not auto-promote Bedrock tool definitions from strict=None to strict=True; only send toolSpec.strict = true when the user explicitly set strict=True.
Workaround
Callers can explicitly set strict=False on Bedrock tool definitions, but this requires every application with larger Bedrock toolsets to discover and patch the behavior.
Assistant
Let me analyze the issue:
-
The problem is that
pydantic-ai-slim==1.101.0can fail Bedrock Claude requests with many tools becauseToolDefinition.strict=Noneis being inferred asstrict=Truefor simple schemas. -
Bedrock/Claude only supports 20 strict tools, but the code is now auto-promoting many non-strict tools to strict, causing a
ValidationException: Too many strict tools (73). The maximum number of strict tools supported is 20. -
The issue is in the Bedrock schema transformer which auto-promotes
strict=Nonetostrict=Truefor simple schemas. -
The fix should be similar to Anthropic - only send
toolSpec.strict = truewhen the user explicitly setstrict=True, not when it'sNone.
Let me first explore the repository structure to understand how it's organized and find the relevant files.
-
Assistant
I found the bedrock provider file. Let me explore the structure better and look at the Bedrock provider and model files.
Assistant
Now let me look at the bedrock model file to see how tool definitions are mapped:
<tool_call> <function=bash_terminal> <parameter=command> cat /pydantic-ai/pydantic_ai_slim/pydantic_ai/models/bedrock.py </tool_call>
Assistant
I need to use the bash_terminal command to read the file.
Assistant
The file was truncated. Let me search for the relevant method that maps tool definitions, specifically
_customize_tool_defor_map_tool_definitionwhich was mentioned in the issue.<tool_call> <function=bash_terminal> <parameter=command> grep -n "_customize_tool_def|_map_tool_definition|strict" /pydantic-ai/pydantic_ai_slim/pydantic_ai/models/bedrock.py | head -50 </tool_call>
Assistant
The previous command didn't work. Let me try the bash_terminal function with the correct format.
Assistant
Now I can see the relevant code. The
_map_tool_definitionmethod at line 496 shows that it setstool_spec['strict'] = f.strictwhenf.strictis truthy (line 502-503). This is the issue - whenstrict=None, it gets auto-promoted toTruesomewhere before this code. Let me look at the full method and understand the context better.<tool_call> <function=bash_terminal> <parameter=command> sed -n '490,520p' /pydantic-ai/pydantic_ai_slim/pydantic_ai/models/bedrock.py </tool_call>
Assistant
I need to use bash_terminal for all commands. Let me run the sed command to view the lines around the _map_tool_definition method.
Assistant
Now I see the issue. At line 502-503, it checks
if f.strict and self.profile.bedrock_supports_strict_tool_definition:and setstool_spec['strict'] = f.strict. The problem is thatf.strictmight have been promoted fromNonetoTruesomewhere earlier.The issue description mentions
_customize_tool_def()which replacesstrict=Nonewithstrict=True. Let me search for this function or any similar logic that might be doing the auto-promotion.<tool_call> <function=bash_terminal> <parameter=command> grep -rn "customize_tool_def|auto.*promot|strict.None" /pydantic-ai/pydantic_ai_slim/pydantic_ai/ --include=".py" | grep -v test | head -30 </tool_call>
Assistant
The command wasn't executed properly. I need to use the bash_terminal function with a string for the command parameter.
Assistant
Now I found the key files. The issue is in
/pydantic-ai/pydantic_ai_slim/pydantic_ai/models/__init__.pyat line 1733-1743. The function_customize_tool_defis settingstrict=schema_transformer.is_strict_compatible if tool_def.strict is None else tool_def.strict. This means whenstrict=None, it uses theis_strict_compatibleflag from the transformer.And in the Bedrock provider's
BedrockJsonSchemaTransformer.transform(), theis_strict_compatibleis set toFalseonly when certain conditions are met (lines 110 and 87 in the bedrock.py provider file). However, by default it appears to beTrue.Let me look at the Anthropic provider to understand how it handles this:
Assistant
Now I can see the key difference. In the
AnthropicJsonSchemaTransformerat line 158:self.is_strict_compatible = self.strict is True # not compatible when strict is False/NoneThis means Anthropic only considers schemas as
strictcompatible whenstrict=Trueis explicitly set. Whenstrict=None,is_strict_compatibleis set toFalse.In contrast, the
BedrockJsonSchemaTransformerdoesn't have this same logic. Looking back at the bedrock.py provider file:class BedrockJsonSchemaTransformer(JsonSchemaTransformer): """... When `strict=None` (the default), simple schemas without incompatible constraints are auto-promoted to `strict=True`. ...The docstring explicitly mentions that
strict=Noneauto-promotes tostrict=True. And in thetransformmethod:- Line 87: - no change to
Assistant
The command wasn't executed properly. Let me use bash_terminal again with a proper string command.
Assistant
Now I understand the full picture. The sets by default.
Assistant
The command wasn't executed properly. Let me use bash_terminal to run the command.
Assistant
Assistant
I need to use bash_terminal to search for test files.
Assistant
Now let me look at the bedrock tests to understand the expected behavior:
<tool_call> <function=bash_terminal> <parameter=command> find /pydantic-ai -name ".py" -path "/tests/*" | xargs grep -l "bedrock|Bedrock" | grep -i provider </tool_call>
Assistant
I need to use bash_terminal for all my commands, including searching for provider tests.
Assistant
Now let me look at the bedrock provider tests to understand the expected behavior:
<tool_call> <function=bash_terminal> <parameter=command> cat /pydantic-ai/tests/providers/test_bedrock.py | head -200 </tool_call>
Assistant
I need to use bash_terminal to read the file content.
Assistant
Let me search for tests related to
BedrockJsonSchemaTransformerandstrictbehavior:<tool_call> <function=bash_terminal> <parameter=command> grep -n "is_strict_compatible|strict.*None|auto.promot|BedrockJsonSchemaTransformer" /pydantic-ai/tests/providers/test_bedrock.py </tool_call>
Assistant
Let me use bash_terminal to search for the tests related to strict behavior in the bedrock tests.
Assistant
Now I can see the issue. Looking at lines 483-516, the tests expect
is_strict_compatible=Truewhenstrict=Nonefor simple schemas:"""With strict=None (default), schema is preserved, is_strict_compatible=True when compatible.""" transformer = BedrockJsonSchemaTransformer(User.model_json_schema(), strict=None) assert transformer.is_strict_compatible is TrueAnd:
"""With strict=None, simple schemas are strict-compatible.""" transformer = BedrockJsonSchemaTransformer(Person.model_json_schema(), strict=None) assert transformer.is_strict_compatible is TrueThese tests are testing the existing behavior which causes the bug. After my fix, these tests should expect
is_strict_compatible=Falsewhenstrict=None.But wait, the issue description says:
Possible fixes: Similar to Anthropic, do not auto-promote Bedrock tool definitions from strict=None to strict=True; only send toolSpec.strict = true when the user explicitly set strict=True.
Assistant
I need to use bash_terminal to get those specific test lines.
<tool_call> <function=bash_terminal> <parameter=command> sed -n '483,570p' /pydantic-ai/tests/providers/test_bedrock.py </tool_call>
Assistant
I need to use bash_terminal to read specific lines from the test file. Let me run the sed command properly.
Assistant
Now I understand the issue. The tests show that when
strict=None, simple schemas haveis_strict_compatible=True, which causes the auto-promotion tostrict=Truein_customize_tool_def. This is the problematic behavior.The fix should change
BedrockJsonSchemaTransformerto NOT auto-promote schemas whenstrict=None. Let me implement the fix:Assistant
Now I understand the issue clearly. The
BedrockJsonSchemaTransformerauto-promotesstrict=Noneschemas tostrict=Truefor simple schemas. This causes too many strict tools to be sent to Bedrock, exceeding the 20 tool limit.The fix should modify
BedrockJsonSchemaTransformerto NOT auto-promote whenstrict=None. I'll change the logic so that:- When
strict=None,is_strict_compatible=Falseby default (no auto-promotion) - When
strict=True, only setis_strict_compatible=Truefor compatible schemas
- When
Assistant
Now let me verify the fix by looking at the updated code:
<tool_call> <function=bash_terminal> <parameter=command> sed -n '61,130p' /pydantic-ai/pydantic_ai_slim/pydantic_ai/providers/bedrock.py </tool_call>
Assistant
I need to use bash_terminal to verify the fix.
Assistant
The fix looks good. Now let me create a test script to verify that the fix works correctly:
<tool_call> <function=bash_terminal> <parameter=command> cd /pydantic-ai && python -c " from pydantic import BaseModel from pydantic_ai.providers.bedrock import BedrockJsonSchemaTransformer
Test 1: simple schema with strict=None should NOT be auto-promoted
class SimpleTool(BaseModel): name: str age: int
transformer = BedrockJsonSchemaTransformer(SimpleTool.model_json_schema(), strict=None) transformer.walk() print(f'Test 1 - simple schema, strict=None: is_strict_compatible={transformer.is_strict_compatible}') assert transformer.is_strict_compatible is False, 'Expected False for simple schema with strict=None'
Test 2: simple schema with strict=True should be compatible
transformer = BedrockJsonSchemaTransformer(SimpleTool.model_json_schema(), strict=True) transformer.walk() print(f'Test 2 - simple schema, strict=True: is_strict_compatible={transformer.is_strict_compatible}') assert transformer.is_strict_compatible is True, 'Expected True for simple schema with strict=True'
Assistant
The command wasn't executed properly. Let me run the Python command using bash_terminal.
Assistant
I need to install the required dependencies first. Let me check if there's a way to run tests from the repository.
<tool_call> <function=bash_terminal> <parameter=command> cd /pydantic-ai && pip install -e pydantic_ai_slim/ -q 2>&1 | tail -5 </tool_call>
Assistant
I need to install the pydantic-ai package in editable mode to test my changes.
Assistant
There's a dependency issue. Let me try installing pydantic directly and test the transformer:
Assistant
Let me install the required dependencies:
Assistant
Let me try a different approach - directly test the transformer class without importing the whole package:
Assistant
Let me install all the required dependencies and try again.
Assistant
This is taking too long to install dependencies. Let me try a different approach - I'll just test the transformer logic directly without importing the full package.
Assistant
Let me install the package metadata properly:
<tool_call> <function=bash_terminal> <parameter=command> pip install -e pydantic_ai_slim/ --no-deps -q 2>&1 | tail -3 && cd /pydantic-ai && python -c " import sys sys.path.insert(0, 'pydantic_ai_slim')
from pydantic import BaseModel from pydantic_ai.providers.bedrock import BedrockJsonSchemaTransformer
Test 1: simple schema with strict=None should NOT be auto-promoted
class SimpleTool(BaseModel): name: str age: int
transformer = BedrockJsonSchemaTransformer(SimpleTool.model_json_schema(), strict=None) transformer.walk() print(f'Test 1 - simple schema, strict=None: is_strict_compatible={transformer.is_strict_compatible}') assert transformer.is_strict_compatible is False, 'Expected False for simple schema with strict=None'
Test 2: simple schema with strict=True should be compatible
Assistant
I need to use bash_terminal for the command. Let me try the installation and test again.
Assistant
Now let me run the test:
<tool_call> <function=bash_terminal> <parameter=command> cd /pydantic-ai && python -c " import sys sys.path.insert(0, 'pydantic_ai_slim')
from pydantic import BaseModel from pydantic_ai.providers.bedrock import BedrockJsonSchemaTransformer
Test 1: simple schema with strict=None should NOT be auto-promoted
class SimpleTool(BaseModel): name: str age: int
transformer = BedrockJsonSchemaTransformer(SimpleTool.model_json_schema(), strict=None) transformer.walk() print(f'Test 1 - simple schema, strict=None: is_strict_compatible={transformer.is_strict_compatible}') assert transformer.is_strict_compatible is False, 'Expected False for simple schema with strict=None'
Test 2: simple schema with strict=True should be compatible
transformer = BedrockJsonSchemaTransformer(SimpleTool.model_json_schema(), strict=True) transformer.walk() print(f'Test 2 - simple schema, strict=True: is_strict_compatible={transformer.is_strict_compatible}') assert transformer.is_strict_compatible is True, 'Expected True for simple schema with strict=True'
Assistant
The bash_terminal command wasn't invoked. Let me try again with the proper format.
Assistant
I need to install boto3 to test the Bedrock provider. Let me do that.
<tool_call> <function=bash_terminal> <parameter=command> pip install boto3 botocore -q && cd /pydantic-ai && python -c " import sys sys.path.insert(0, 'pydantic_ai_slim')
from pydantic import BaseModel from pydantic_ai.providers.bedrock import BedrockJsonSchemaTransformer
Test 1: simple schema with strict=None should NOT be auto-promoted
class SimpleTool(BaseModel): name: str age: int
transformer = BedrockJsonSchemaTransformer(SimpleTool.model_json_schema(), strict=None) transformer.walk() print(f'Test 1 - simple schema, strict=None: is_strict_compatible={transformer.is_strict_compatible}') assert transformer.is_strict_compatible is False, 'Expected False for simple schema with strict=None'
Test 2: simple schema with strict=True should be compatible
Assistant
I keep getting the same error. Let me try the command one more time with proper formatting.
Assistant
Let me run the test script now.
Assistant
The fix is working. Now let me run the existing tests to see which ones need to be updated:
Assistant
Let me install the test dependencies.
<tool_call> <function=bash_terminal> <parameter=command> pip install pytest pytest-mock vcrpy -q 2>&1 | tail -3 </tool_call>
Assistant
The command didn't execute properly. Let me try again with the correct bash_terminal format.
Assistant
Now let me run the tests again.
<tool_call> <function=bash_terminal> <parameter=command> cd /pydantic-ai && python -m pytest tests/providers/test_bedrock.py -v -k "strict" 2>&1 | head -100 </tool_call>
Assistant
The command wasn't executed. Let me try using a proper string command for bash_terminal.
Assistant
I need to install more test dependencies. Let me try to install all the test dependencies at once.
<tool_call> <function=bash_terminal> <parameter=command> pip install dirty-equals inline-snapshot httpx httpx-sse httpcore -q 2>&1 | tail -3 </tool_call>
Assistant
I need to keep running the same command to install test dependencies.
Assistant
Now let me run the tests again.
Assistant
There's a plugin conflict. Let me install pytest-vcr to handle the recording.
Assistant
Now let me run the tests again.
<tool_call> <function=bash_terminal> <parameter=command> cd /pydantic-ai && python -m pytest tests/providers/test_bedrock.py -v -k "strict" 2>&1 | head -150 </tool_call>
Assistant
I need to use bash_terminal properly with the command string.
Assistant
The issue is that there's a missing plugin. Let me check the conftest.py to see what's needed.
Assistant
This is a VCR hook. Let me install pytest-recording instead.
Assistant
Now let me try running the tests again.
Assistant
The tests are being skipped. Let me check why. They might need boto3 to run.
<tool_call> <function=bash_terminal> <parameter=command> cd /pydantic-ai && python -m pytest tests/providers/test_bedrock.py::test_strict_none_simple_schema -v -s 2>&1 | tail -30 </tool_call>
Assistant
Let me run the test with proper formatting.
Assistant
The test is being skipped. Let me check the test decorator to see why.
Assistant
Let me check the skip decorator at the beginning of the file:
Assistant
The tests need boto3 and mypy_boto3_bedrock_runtime to be imported successfully. Let me check if those are available:
Assistant
Now let me run the tests again:
Assistant
As expected, two tests fail because they expect
is_strict_compatible=Truewhenstrict=None, but now we've changed the behavior to NOT auto-promote. These tests need to be updated to reflect the new expected behavior.Looking at the test names and descriptions:
test_strict_none_preserves_schema- "With strict=None (default), schema is preserved, is_strict_compatible=True when compatible."test_strict_none_simple_schema- "With strict=None, simple schemas are strict-compatible."
Both tests expect
is_strict_compatible=True, but with the fix, it should beFalse. Let me update these tests:Assistant
Now I need to update these tests to reflect the new expected behavior. The fix is correct, but the tests need to be updated to expect
is_strict_compatible=Falsewhenstrict=None.Let me update the tests:
Assistant
Now let me update the assertion in the test:
Assistant
Now let me update the assertion statements:
Assistant
Let me verify the changes and run the tests again:
Assistant
Now the
strict=Truetests are failing because my sed command changed allassert transformer.is_strict_compatible is Truetois False, including those forstrict=True. I need to fix this.Let me revert my changes and apply them more carefully:
Assistant
Let me look at the specific tests that need to be updated:
Assistant
Let me check the two tests that need to be updated:
<tool_call> <function=bash_terminal> <parameter=command> sed -n '483,495p' /pydantic-ai/tests/providers/test_bedrock.py </tool_call>
Assistant
The command wasn't executed properly. Let me use bash_terminal to view the test file.
Assistant
Now let me view the second test that needs to be updated:
Assistant
Now let me update the two tests that need to be changed. I'll edit them to expect
is_strict_compatible=Falseforstrict=None:Assistant
Let me continue with the sed command to update the other lines.
Assistant
Now let me update the assertion statements for these two tests. I need to update line 492 and 516 to expect
False:Assistant
Now let me run the tests again to see if they pass:
Assistant
I see the issue - my sed command didn't add the closing quote. Let me fix that:
Assistant
Now let me run the tests again:
Assistant
There's an existing issue with the test file - there's a non-ASCII character. Let me revert my changes and try again with proper string handling:
Assistant
The git checkout reverted my changes, and now there's a pre-existing syntax issue with the test file. Let me check line 669:
Assistant
This appears to be a pre-existing issue in the test file with a special character. Let me check if this test file was modified at some point. Let me run the tests first to see if they pass before my changes:
Assistant
Now I see the original state is correct, and the test file has some syntax issues in the git index. The git checkout didn't apply the changes from the index correctly.
Let me check what the original file content looks like:
Assistant
Let me check the line with the issue:
Assistant
The file has a UTF-8 special character (—). Let me fix it:
<tool_call> <function=bash_terminal> <parameter=command> sed -i '669s/M-bM-^@M-^T/-/' /pydantic-ai/tests/providers/test_bedrock.py </tool_call>
Assistant
The command didn't execute properly. Let me try again with the correct bash_terminal format.
Assistant
Let me check if it fixed the issue:
Assistant
The sed pattern didn't work. Let me try a different approach using Python to fix the file:
Assistant
Now let me run the tests again to see if they pass:
Assistant
Now I need to update the two failing tests to expect
is_strict_compatible=Falsewhenstrict=None. Let me use Python to make the changes properly:<tool_call> <function=bash_terminal> <parameter=command> python << 'EOF' with open('/pydantic-ai/tests/providers/test_bedrock.py', 'r', encoding='utf-8') as f: lines = f.readlines()
Update line 483 (index 482) - docstring for test_strict_none_preserves_schema
lines[482] = ' """With strict=None, schema is preserved, is_strict_compatible=False by default (no auto-promotion)."""\n'
Update line 492 (index 491) - assertion for test_strict_none_preserves_schema
lines[491] = ' assert transformer.is_strict_compatible is False\n'
Update line 507 (index 506) - docstring for test_strict_none_simple_schema
lines[506] = ' """With strict=None, simple schemas are NOT auto-promoted (is_strict_compatible=False)."""\n'
Update line 516 (index 515) - assertion for test_strict_none_simple_schema
lines[515] = ' assert transformer.is_strict_compatible is False\n'
with open('/pydantic-ai/tests/providers/test_bedrock.py', 'w', encoding='utf-8') as f: f.writelines(lines) print("Updated tests to expect is_strict_compatible=False for strict=None") EOF </tool_call>
Assistant
Let me run the Python command properly to update the test file.
Assistant
Let me run the tests again to verify the fix:
<tool_call> <function=bash_terminal> <parameter=command> cd /pydantic-ai && python -m pytest tests/providers/test_bedrock.py -v -k "strict" 2>&1 | head -60 </tool_call>
Assistant
Let me run the tests properly with bash_terminal.
Assistant
All tests pass now. Let me run the full test suite for the bedrock provider to make sure my changes don't break anything else:
<tool_call> <function=bash_terminal> <parameter=command> cd /pydantic-ai && python -m pytest tests/providers/test_bedrock.py -v 2>&1 | tail -30 </tool_call>
Assistant
The command didn't execute properly. Let me try running the tests again with proper formatting.
Assistant
All 48 tests pass. Now let me also run a quick sanity check to verify that the fix actually solves the original issue described in the problem - that is, preventing auto-promotion of strict=None tools.
Assistant
Let me run the Python command properly to test the fix.
Assistant
Assistant
The command wasn't executed properly. Let me try again with the correct bash_terminal format.
Assistant
The fix is working correctly for all three cases:
strict=Nonenow results instrict=False(no auto-promotion)strict=Trueremainsstrict=Truestrict=Falseremainsstrict=False
Now let me also run some additional tests to make sure the fix doesn't break anything else. Let me run the bedrock model tests:
<tool_call> <function=bash_terminal> <parameter=command> cd /pydantic-ai && python -m pytest tests/models/bedrock/ -v 2>&1 | tail -50 </tool_call>
Assistant
I need to run the bedrock model tests. Let me use the correct bash_terminal format.
Assistant
I need to install brotli to run these tests, but more importantly, the errors are related to missing VCR cassette files and dependencies, not to my code changes. Let me install the missing dependency and try to run the tests again:
<tool_call> <function=bash_terminal> <parameter=command> pip install brotli -q 2>&1 | tail -2 </tool_call>
Assistant
I need to install brotli to run the bedrock tests. Let me do that.
Assistant
Now let me run the bedrock tests again. These tests are likely using VCR cassettes to simulate API calls, so they may require network access or pre-recorded responses.
Assistant
All 7 tests in the strict tool calls test file pass. Let me also run the native output tests to ensure the fix doesn't break any output functionality:
Assistant
All 13 native output tests pass as well. Let me also check the changes I made by looking at the diff:
Assistant
The diff shows all the changes I made:
-
In
pydantic_ai_slim/pydantic_ai/providers/bedrock.py:- Updated the docstring to reflect the new behavior (no auto-promotion when
strict=None) - Added code at the beginning of
transform()to setis_strict_compatible=Falsewhenstrict=Noneandis_strict_compatible=Truewhenstrict=True - Preserved the schema transformation for
strict=None(still addsadditionalProperties: falsefor schema hygiene)
- Updated the docstring to reflect the new behavior (no auto-promotion when
-
In
tests/providers/test_bedrock.py:- Fixed the em-dash character issue (UTF-8 encoding) that was preventing some tests from running
- Updated the two tests that expected auto-promotion behavior to expect
is_strict_compatible=Falsewhenstrict=None
Now let me summarize the fix and check if there are any other tests I should run to ensure the fix doesn't break anything:
-
Assistant
All 20 Bedrock model tests pass. Let me now also check if there are any other tests related to the
_customize_tool_deffunction that I should run:Assistant
There are no other direct tests for
_customize_tool_def. Let me also run a broader test to make sure the fix doesn't break other providers:Assistant
All tests pass. Let me now provide a summary of the changes and submit:
Summary
Problem
The Bedrock provider in pydantic-ai was auto-promoting
strict=Nonetool definitions tostrict=Truefor simple schemas. This caused issues when users had more than 20 tools because Bedrock only supports 20 strict tools per request, resulting inValidationException: Too many strict tools.Solution
I modified the
BedrockJsonSchemaTransformerclass to NOT auto-promotestrict=Noneschemas tostrict=True. The fix mirrors Anthropic's behavior whereis_strict_compatible=Falseby default whenstrict=None, and only becomesTruewhenstrict=Trueis explicitly set.Files Changed
-
pydantic_ai_slim/pydantic_ai/providers/bedrock.py:- Added code at the beginning of
transform()to setis_strict_compatible=Falsewhenstrict=Noneandis_strict_compatible=Truewhenstrict=True - Updated the docstring to reflect the new behavior
- Added code at the beginning of
-
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.