structuredOutput method
Implementation
@override
Future<DVJsonObject> structuredOutput(
String prompt,
DVJsonObject schema,
) async {
final payload = await postJson(
endpoint('/v1/messages'),
<String, Object?>{
..._messagesBody(prompt),
'output_config': <String, Object?>{
'format': <String, Object?>{
'type': 'json_schema',
'schema': DVJsonCodec.toJsonObject(schema),
},
},
},
);
return parseStructuredText(_firstTextBlock(payload));
}