Class: Anthropic::Models::Beta::BetaCompactionBlock

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/anthropic/models/beta/beta_compaction_block.rb,
sig/anthropic/models/beta/beta_compaction_block.rbs

Defined Under Namespace

Modules: ToolChange

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, inspect, #inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize ⇒ BetaCompactionBlock

Returns a new instance of BetaCompactionBlock.

Parameters:

  • content: (String, nil)
  • encrypted_content: (String, nil)
  • signature: (String, nil)
  • tool_changes: (::Array[Anthropic::Models::Beta::BetaCompactionBlock::tool_change], nil)
  • type: (:compaction)


26
27
28
29
30
31
32
# File 'sig/anthropic/models/beta/beta_compaction_block.rbs', line 26

def initialize: (
  content: String?,
  encrypted_content: String?,
  ?signature: String?,
  ?tool_changes: ::Array[Anthropic::Models::Beta::BetaCompactionBlock::tool_change]?,
  ?type: :compaction
) -> void

Instance Attribute Details

#content ⇒ String?

Summary of compacted content, or null if compaction failed

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


11
# File 'lib/anthropic/models/beta/beta_compaction_block.rb', line 11

required :content, String, nil?: true

#encrypted_content ⇒ String?

Opaque metadata from prior compaction, to be round-tripped verbatim

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


17
# File 'lib/anthropic/models/beta/beta_compaction_block.rb', line 17

required :encrypted_content, String, nil?: true

#signature ⇒ String?

Signature over the summary, to be sent back with the block verbatim

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


28
# File 'lib/anthropic/models/beta/beta_compaction_block.rb', line 28

optional :signature, String, nil?: true

#tool_changes ⇒ Array<Anthropic::Models::Beta::BetaResponseToolAdditionBlock, Anthropic::Models::Beta::BetaResponseToolRemovalBlock>?

The tool changes of the compacted range: the tool_addition and tool_removal blocks that take the request's tools to the tool set in effect at the end of the range, or [] when the range changed no tool. Absent when the server did not compute them. Send the block back unchanged.

Parameters:

  • value (::Array[Anthropic::Models::Beta::BetaCompactionBlock::tool_change], nil)

Returns:



37
38
39
40
41
# File 'lib/anthropic/models/beta/beta_compaction_block.rb', line 37

optional :tool_changes,
-> {
  Anthropic::Internal::Type::ArrayOf[union: Anthropic::Beta::BetaCompactionBlock::ToolChange]
},
nil?: true

#type ⇒ Symbol, :compaction

Parameters:

  • value (:compaction)

Returns:

  • (Symbol, :compaction)


22
# File 'lib/anthropic/models/beta/beta_compaction_block.rb', line 22

required :type, const: :compaction

Instance Method Details

#to_hash ⇒ { content: String?, encrypted_content: String?, type: :compaction, signature: String?, tool_changes: ::Array[Anthropic::Models::Beta::BetaCompactionBlock::tool_change]? }

Returns:

  • ({ content: String?, encrypted_content: String?, type: :compaction, signature: String?, tool_changes: ::Array[Anthropic::Models::Beta::BetaCompactionBlock::tool_change]? })


34
35
36
37
38
39
40
# File 'sig/anthropic/models/beta/beta_compaction_block.rbs', line 34

def to_hash: -> {
  content: String?,
  encrypted_content: String?,
  type: :compaction,
  signature: String?,
  tool_changes: ::Array[Anthropic::Models::Beta::BetaCompactionBlock::tool_change]?
}