Comment on Structured outputs on the Claude Developer PlatformparentComments−gradys9moYou might be using JSON mode, which doesn’t guarantee a schema will be followed, or structured outputs not in strict mode. It is possible to get the property that the response is either a valid instance of the schema or an error (eg for refusal)−jawiggins9moHow do you activate strict mode when using pydantic schemas? It doesn't look like that is a valid parameter to me.No, I don't get refusals, I see literally invalid json, like: `{"field": ["value...}`
Comments
You might be using JSON mode, which doesn’t guarantee a schema will be followed, or structured outputs not in strict mode. It is possible to get the property that the response is either a valid instance of the schema or an error (eg for refusal)
How do you activate strict mode when using pydantic schemas? It doesn't look like that is a valid parameter to me.
No, I don't get refusals, I see literally invalid json, like: `{"field": ["value...}`