ReqLLM.Output.Result (ReqLLM v1.19.0)

View Source

Describes how a complete ReqLLM.Output value was materialized and validated.

Results keep the retained raw provider value, projected value, validation errors, warnings, repair attempts, extraction source, and provider metadata separate. They are computed with ReqLLM.Response.output_result/3 and do not change the response or trigger another model call.

Summary

Types

repair()

@type repair() :: %{
  :type => :json_repair | :legacy_type_coercion | :callback,
  :status => :applied | :failed,
  optional(:reason) => String.t()
}

source()

@type source() :: :text | :tool_call | :response_object | :missing

t()

@type t() :: %ReqLLM.Output.Result{
  errors: [validation_error()],
  policy: ReqLLM.Output.validation_policy(),
  provider_metadata: map(),
  raw: term(),
  repairs: [repair()],
  source: source(),
  valid?: boolean(),
  value: term(),
  warnings: [String.t()]
}

validation_error()

@type validation_error() :: %{
  type: :missing_value | :invalid_type | :schema_validation,
  message: String.t()
}