Message.ResultFinal result messages with metadata about the conversation.
module Usage : sig ... endUsage statistics for API calls.
val create :
subtype:string ->
duration_ms:int ->
duration_api_ms:int ->
is_error:bool ->
num_turns:int ->
session_id:string ->
?total_cost_usd:float ->
?usage:Usage.t ->
?result:string ->
?structured_output:Jsont.json ->
unit ->
tcreate ~subtype ~duration_ms ~duration_api_ms ~is_error ~num_turns ~session_id ?total_cost_usd ?usage ?result ?structured_output () creates a result message.
val subtype : t -> stringsubtype t returns the subtype of the result.
val duration_ms : t -> intduration_ms t returns the total duration in milliseconds.
val duration_api_ms : t -> intduration_api_ms t returns the API duration in milliseconds.
val is_error : t -> boolis_error t returns whether this result represents an error.
val num_turns : t -> intnum_turns t returns the number of conversation turns.
val session_id : t -> stringsession_id t returns the session identifier.
val total_cost_usd : t -> float optiontotal_cost_usd t returns the optional total cost in USD.
val result : t -> string optionresult t returns the optional result string.
val structured_output : t -> Jsont.json optionstructured_output t returns the optional structured JSON output.