% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/public__s3_methods.R
\name{asa_response}
\alias{asa_response}
\title{Constructor for asa_response Objects}
\usage{
asa_response(
  message,
  status_code,
  raw_response,
  trace,
  elapsed_time,
  prompt,
  trace_json = "",
  fold_stats = list(),
  thread_id = NULL,
  stop_reason = NULL,
  budget_state = list(),
  field_status = list(),
  diagnostics = list(),
  json_repair = list(),
  final_payload = NULL,
  terminal_valid = FALSE,
  terminal_payload_hash = NULL,
  payload_integrity = list(),
  completion_gate = list(),
  tokens_used = NA_integer_,
  input_tokens = NA_integer_,
  output_tokens = NA_integer_,
  token_trace = list()
)
}
\arguments{
\item{message}{The final response text}

\item{status_code}{Status code (200 = success, 100 = error)}

\item{raw_response}{The full Python response object}

\item{trace}{Full text trace of agent execution}

\item{elapsed_time}{Execution time in minutes}

\item{prompt}{The original prompt}

\item{trace_json}{Structured JSON trace (when available)}

\item{fold_stats}{Diagnostic metrics from memory folding (list).
Includes \code{fold_count} (integer or error message string),
\code{fold_messages_removed}, \code{fold_total_messages_removed},
\code{fold_chars_input}, \code{fold_summary_chars} (effective per-fold
summary growth chars), \code{fold_summary_total_chars},
\code{fold_summary_delta_chars},
\code{fold_trigger_reason}, \code{fold_safe_boundary_idx},
\code{fold_compression_ratio}, \code{fold_parse_success}, and
\code{fold_summarizer_latency_m}.}

\item{thread_id}{Resolved LangGraph thread identifier used for this run.}

\item{stop_reason}{Terminal stop reason from agent state (when available).}

\item{budget_state}{Tool-call budget state snapshot from agent state.}

\item{field_status}{Per-field extraction status map from agent state.}

\item{diagnostics}{Runtime diagnostics counters and intervention notes.}

\item{json_repair}{JSON repair/fallback events emitted during execution.}

\item{final_payload}{Canonical terminal payload from agent state (when available).}

\item{terminal_valid}{Logical flag indicating whether a schema-valid terminal
payload was emitted.}

\item{terminal_payload_hash}{Canonical hash of terminal payload from agent state.}

\item{payload_integrity}{Diagnostics about released payload provenance, repair,
and truncation markers.}

\item{completion_gate}{Deterministic outcome-verification report from agent state.}

\item{tokens_used}{Total token count for this invocation (integer, or NA).}

\item{input_tokens}{Input (prompt) token count (integer, or NA).}

\item{output_tokens}{Output (completion) token count (integer, or NA).}

\item{token_trace}{Per-step token usage trace (list).}
}
\value{
An object of class \code{asa_response}
}
\description{
Creates an S3 object representing an agent response.
}
