class Riffer::StructuredOutput::Result

Wraps the result of structured output parsing and validation.

On success, object contains the validated Hash and error is nil. On failure, error contains the error message and object is nil.

result = structured_output.parse_and_validate(json_string)
if result.success?
  result.object  #=> {sentiment: "positive", score: 0.9}
else
  result.error   #=> "JSON parse error: ..."
end