class

OpenAI::CompactResource

Inherits JSON::Serializable < Reference < Object

Constructors

new(id : String = "", object : CompactResourceObject = CompactResourceObject::ResponseCompaction, output : Array(OutputItem) = [] of OutputItem, created_at : Int64 = 0, usage : ResponseUsage = ResponseUsage.new)
Source
new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source

Instance methods

created_at

Unix timestamp (in seconds) when the compacted conversation was created.

Source
created_at=(created_at : Int64)

Unix timestamp (in seconds) when the compacted conversation was created.

Source
id

The unique identifier for the compacted response.

Source
id=(id : String)

The unique identifier for the compacted response.

Source
object

The object type. Always response.compaction.

Source
object=(object : CompactResourceObject)

The object type. Always response.compaction.

Source
output

The compacted list of output items. This is a list of all user messages, followed by a single compaction item.

Source
output=(output : Array(OutputItem))

The compacted list of output items. This is a list of all user messages, followed by a single compaction item.

Source
usage

Token accounting for the compaction pass, including cached, reasoning, and total tokens.

Source
usage=(usage : ResponseUsage)

Token accounting for the compaction pass, including cached, reasoning, and total tokens.

Source