The Dartantic AI docs show an example of generating a structured response using JsonSchema.create but it is not exported from dartantic_ai or dartantic_interface:
// Use typed outputs
final location = await agent.sendFor<TownAndCountry>(
'The windy city in the US',
outputSchema: JsonSchema.create({
'type': 'object',
'properties': {
'town': {'type': 'string'},
'country': {'type': 'string'},
},
'required': ['town', 'country'],
}),
outputFromJson: TownAndCountry.fromJson,
);
print('${location.output.town}, ${location.output.country}');

The Dartantic AI docs show an example of generating a structured response using
JsonSchema.createbut it is not exported from dartantic_ai or dartantic_interface: