When using Claude models through AWS, I get the following error for Sonnet 4.5 and Haiku. They support structured output and the results are working but the WARNINGS pop up. This was not an issue with the previous version (v2.5.9). There was a fix for Opus couple of weeks before but it seems it wasn't implemented for other models.
WARNING Model 'us.anthropic.claude-sonnet-4-5-20250929-v1:0' does not support structured outputs. Structured output features will not be available for this model.
from dataclasses import dataclass
from typing import AsyncIterator, Union
from agno.run.agent import CustomEvent
from agno.workflow import Workflow, Step, StepInput, StepOutput
from agno.run.workflow import WorkflowRunOutputEvent
from agno.utils.log import log_info
import asyncio
from agno.workflow import WorkflowAgent
from agno.models.aws import Claude
from dotenv import load_dotenv
import boto3
from agno.workflow import WorkflowAgent
from agno.db.in_memory import InMemoryDb
from enum import Enum
from typing import Optional, Union
from urllib.parse import urlparse
from pydantic import BaseModel, Field
from dataclasses import dataclass
from agno.run.agent import RunInput, RunOutput
from agno.agent import Agent, AgentSession
load_dotenv()
session = boto3.session.Session()
instance = Claude(
id="us.anthropic.claude-haiku-4-5-20251001-v1:0",
# id="us.anthropic.claude-sonnet-4-5-20250929-v1:0",
max_tokens=4096,
temperature=0.0,
session=session,
)
@dataclass
class DataProcessedEvent(CustomEvent):
records_processed: int = None
status: str = None
async def process_data_step(
step_input: StepInput,
) -> AsyncIterator[Union[WorkflowRunOutputEvent, StepOutput]]:
data = step_input.input
processed_count = len(data.split())
yield DataProcessedEvent(records_processed=processed_count, status="completed")
class IntentType(str, Enum):
document = "document"
brief = "brief"
translate = "translate"
followup = "followup"
compare = "compare"
default = "default"
class IntentMapOutput(BaseModel):
intent: IntentType = Field(description="The output format the user wants")
def intent_posthook(
run_output: RunOutput,
session: AgentSession,
) -> None:
response: IntentMapOutput = run_output.content
selection = response.intent.value
log_info(f"Prompt Task Type: {selection}")
intent_classification = Agent(
name="Intent Classification",
db=InMemoryDb(),
model=instance,
instructions="""
Classify user query intent as ONE of: translate (non-English or translation request) | brief (summary/TLDR/key points/highlights) | compare (vs/compare/pros cons/"X or Y") | document (write/draft + email/memo/blog/report, NO brief/compare words) | followup (<6 words or "that/this/expand/elaborate") | default (none match). Brief/compare keywords override writing verbs.
Query: Write an email on AI Agents
Output ONLY the intent label.
""",
add_history_to_context=False,
markdown=False,
post_hooks=[intent_posthook],
output_schema=IntentMapOutput,
debug_mode=True,
debug_level=2,
)
workflow = Workflow(
name="Data Processing",
steps=[
Step(name="Process", executor=process_data_step),
Step(name="User Intent", agent=intent_classification),
],
agent=WorkflowAgent(
model=instance,
instructions="You are an AI research coordinator for tech product analysis. Always send to the workflow.",
),
)
async def run_workflow():
"""Run the workflow and print events"""
run_response = workflow.arun(
"Write an email on AI Agents", stream=True, stream_events=True
)
async for event in run_response:
log_info(event)
if isinstance(event, DataProcessedEvent):
print(
f"Custom Event - Processed: {event.records_processed} records, Status: {event.status}"
)
# Run the workflow
if __name__ == "__main__":
asyncio.run(run_workflow())
Since both Haiku/Sonnet supports structured output, this should not be a warning.
WARNING Model 'us.anthropic.claude-sonnet-4-5-20250929-v1:0' does not support structured outputs. Structured output features will not be available for this model.
WARNING Model 'us.anthropic.claude-haiku-4-5-20251001-v1:0' does not support structured outputs. Structured output features will not be available for this model.
- MacOS/Linux
- Agno 2.5.17 (works fine in 2.5.9)
Description
When using Claude models through AWS, I get the following error for Sonnet 4.5 and Haiku. They support structured output and the results are working but the WARNINGS pop up. This was not an issue with the previous version (v2.5.9). There was a fix for Opus couple of weeks before but it seems it wasn't implemented for other models.
Steps to Reproduce
Agent Configuration (if applicable)
No response
Expected Behavior
Since both Haiku/Sonnet supports structured output, this should not be a warning.
Actual Behavior
Screenshots or Logs (if applicable)
No response
Environment
Possible Solutions (optional)
No response
Additional Context
No response