Closed
Description
Initial Checks
- I confirm that I'm using the latest version of Pydantic AI
- I confirm that I searched for my issue in https://github.com/pydantic/pydantic-ai/issues before opening this issue
Description
When using BedrockConverseModel
with an Agent
, if no system prompt is provided, the Bedrock API call fails because it sends the system
key with an empty value, which Bedrock does not support. While prompts are a fundamental part of agents, this should not cause a failure, or the system_prompt
in the Agent
model should be made required.
Bedrock Payload
{
"modelId":"us.amazon.nova-pro-v1:0",
"messages":[
{
"role":"user",
"content":[
{
"text":"What is the capital of Italy?"
}
]
}
],
"system":[
{
"text":""
}
],
"inferenceConfig":{
}
}
Error
botocore.exceptions.ParamValidationError: Parameter validation failed:
Invalid length for parameter system[0].text, value: 0, valid min length: 1
Example Code
from pydantic_ai import Agent
from pydantic_ai.models.bedrock import BedrockConverseModel
model = BedrockConverseModel(model_name="us.amazon.nova-pro-v1:0")
agent = Agent(model=model)
result_sync = agent.run_sync('What is the capital of Italy?')
print(result_sync.data)
Python, Pydantic AI & LLM client version
(venv) ➜ python --version
Python 3.12.8
(venv) ➜ pip freeze |grep pydantic
pydantic==2.11.2
pydantic-ai==0.0.53
pydantic-ai-slim==0.0.53
pydantic-evals==0.0.53
pydantic-graph==0.0.53
pydantic-settings==2.8.1
pydantic_core==2.33.1