You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I tried using claude-sonnet-3-5-latest with structured output in an agent, but it doesn't output structured output. I also can't find anything in the docs about using claude for structured output. I tried getting structured output with gpt-4o instead and that works like a charm.
Here's the code that I used to try with Claude
classCreateUserStoryDescriptionResponse(BaseModel):
story_description: str=Field(
...,
description="The user story description based on the project information and task description",
)
agent=Agent(
name="Story generator",
model=Claude(id="claude-sonnet-3-5-latest"),
instructions=(
"You're a world-class requirements engineer. ",
"It's your job to generate a user story description. ",
"Use 'As a <role>, I want <goal> so that <reason>' format to generate the story description.",
),
response_model=CreateUserStoryDescriptionResponse,
structured_outputs=True,
)
Is there a way to make this work with anthropic/claude?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi, I tried using claude-sonnet-3-5-latest with structured output in an agent, but it doesn't output structured output. I also can't find anything in the docs about using claude for structured output. I tried getting structured output with gpt-4o instead and that works like a charm.
Here's the code that I used to try with Claude
Is there a way to make this work with anthropic/claude?
Beta Was this translation helpful? Give feedback.
All reactions