Class: Cadenya::Models::ContextLengths

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/cadenya/models/context_lengths.rb,
sig/cadenya/models/context_lengths.rbs

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(assistant_messages:, available_tools:, episodic_memory:, skills_memory:, system_prompt:, tool_definitions:, tool_results:, user_messages:) ⇒ Object

Some parameter documentations has been truncated, see Cadenya::Models::ContextLengths for more details.

ContextLengths is the measured character length of each distinct component of an iteration's assembled context window. Values are raw character lengths of the component as assembled into the request — token estimates are derived by the client against input_tokens (component share = component length / sum of all lengths).

New components are added as new fields — wire-compatible; absent components read as 0.

Parameters:

  • assistant_messages (Integer)

    Chat history messages with the assistant role.

  • available_tools (Integer)

    The discoverable/available-tools appendix attached to the system prompt.

  • episodic_memory (Integer)

    The episodic memory appendix attached to the system prompt.

  • skills_memory (Integer)

    The skills memory appendix attached to the system prompt.

  • system_prompt (Integer)

    The objective's base system prompt (rendered variation template).

  • tool_definitions (Integer)

    Serialized tool definitions sent with the completion request

  • tool_results (Integer)

    Tool results present in the chat history.

  • user_messages (Integer)

    Chat history messages with the user role.



# File 'lib/cadenya/models/context_lengths.rb', line 57

Instance Attribute Details

#assistant_messagesInteger

Returns the value of attribute assistant_messages.

Returns:

  • (Integer)


16
17
18
# File 'sig/cadenya/models/context_lengths.rbs', line 16

def assistant_messages
  @assistant_messages
end

#available_toolsInteger

Returns the value of attribute available_tools.

Returns:

  • (Integer)


18
19
20
# File 'sig/cadenya/models/context_lengths.rbs', line 18

def available_tools
  @available_tools
end

#episodic_memoryInteger

Returns the value of attribute episodic_memory.

Returns:

  • (Integer)


20
21
22
# File 'sig/cadenya/models/context_lengths.rbs', line 20

def episodic_memory
  @episodic_memory
end

#skills_memoryInteger

Returns the value of attribute skills_memory.

Returns:

  • (Integer)


22
23
24
# File 'sig/cadenya/models/context_lengths.rbs', line 22

def skills_memory
  @skills_memory
end

#system_promptInteger

Returns the value of attribute system_prompt.

Returns:

  • (Integer)


24
25
26
# File 'sig/cadenya/models/context_lengths.rbs', line 24

def system_prompt
  @system_prompt
end

#tool_definitionsInteger

Returns the value of attribute tool_definitions.

Returns:

  • (Integer)


26
27
28
# File 'sig/cadenya/models/context_lengths.rbs', line 26

def tool_definitions
  @tool_definitions
end

#tool_resultsInteger

Returns the value of attribute tool_results.

Returns:

  • (Integer)


28
29
30
# File 'sig/cadenya/models/context_lengths.rbs', line 28

def tool_results
  @tool_results
end

#user_messagesInteger

Returns the value of attribute user_messages.

Returns:

  • (Integer)


30
31
32
# File 'sig/cadenya/models/context_lengths.rbs', line 30

def user_messages
  @user_messages
end

Instance Method Details

#to_hash{

Returns:

  • ({)


43
# File 'sig/cadenya/models/context_lengths.rbs', line 43

def to_hash: -> {