Class: Cadenya::Models::Objective

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

Overview

See Also:

  • Cadenya::Resources::Objectives#create

Defined Under Namespace

Modules: State Classes: EpisodicMemory

Instance Attribute Summary collapse

Class Method 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(config_snapshot:, first_user_message:, metadata:, state:, system_prompt:, episodic_memory: nil, first_user_message_data: nil, info: nil, memory_cascade: nil, output: nil, parent_objective_id: nil, secrets: nil, state_message: nil, system_prompt_data: nil) ⇒ Object

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

Objective is the data for an objective. It contains the snapshotted fields for the selected agent and variation. Secrets are returned only with their names, and the output definition is copied from the agent's configuration.

Parameters:

  • config_snapshot (Cadenya::Models::ObjectiveConfigSnapshot)

    ObjectiveConfigSnapshot is the point-in-time snapshot of the agent, variation, a

  • first_user_message (String)

    The first user message in the LLM chat history, either provided explicitly at

  • metadata (Cadenya::Models::OperationMetadata)

    Metadata for ephemeral operations and activities (e.g., objectives, executions,

  • state (Symbol, Cadenya::Models::Objective::State)

    The current lifecycle state of the objective.

  • system_prompt (String)

    system_prompt is read-only, derived from the selected variation's prompt

  • episodic_memory (Cadenya::Models::Objective::EpisodicMemory) (defaults to: nil)

    Episodic is used to configure the episodic memory for the objective

  • first_user_message_data (Hash{Symbol=>Object}) (defaults to: nil)

    Arbitrary data rendered into the variation's first_user_message_template

  • info (Cadenya::Models::ObjectiveInfo) (defaults to: nil)

    ObjectiveInfo provides read-only aggregated statistics about an objective's exec

  • memory_cascade (Array<Cadenya::Models::MemoryReference>) (defaults to: nil)

    Memory layers/entries layered over the baseline cascade inherited

  • output (Hash{Symbol=>Object}) (defaults to: nil)

    The output of the objective, populated when the objective completes. Will match

  • parent_objective_id (String) (defaults to: nil)

    A parent objective means the objective was spawned off using a separate agent to

  • secrets (Array<Cadenya::Models::ObjectiveSecret>) (defaults to: nil)

    Secrets that can be used in the headers for tool calls using the secret interpol

  • state_message (String) (defaults to: nil)

    Optional human-readable detail about the current state (e.g. a failure reason).

  • system_prompt_data (Hash{Symbol=>Object}) (defaults to: nil)

    Arbitrary data rendered into the variation's system_prompt_template



# File 'lib/cadenya/models/objective.rb', line 119

Instance Attribute Details

#config_snapshotCadenya::ObjectiveConfigSnapshot

Returns the value of attribute config_snapshot.



44
45
46
# File 'sig/cadenya/models/objective.rbs', line 44

def config_snapshot
  @config_snapshot
end

#episodic_memoryCadenya::Models::Objective::EpisodicMemory?

Episodic is used to configure the episodic memory for the objective



25
# File 'lib/cadenya/models/objective.rb', line 25

optional :episodic_memory, -> { Cadenya::Objective::EpisodicMemory }, api_name: :episodicMemory

#first_user_messageString

The first user message in the LLM chat history, either provided explicitly at creation or rendered from the variation's first_user_message_template.

Parameters:

  • value (String)

Returns:

  • (String)


12
# File 'lib/cadenya/models/objective.rb', line 12

required :first_user_message, String, api_name: :firstUserMessage

#first_user_message_data::Hash[Symbol, top]? (readonly)

Returns the value of attribute first_user_message_data.

Returns:

  • (::Hash[Symbol, top], nil)


50
51
52
# File 'sig/cadenya/models/objective.rbs', line 50

def first_user_message_data
  @first_user_message_data
end

#infoCadenya::ObjectiveInfo? (readonly)

Returns the value of attribute info.

Returns:



54
55
56
# File 'sig/cadenya/models/objective.rbs', line 54

def info
  @info
end

#memory_cascadeArray<Cadenya::Models::MemoryReference>?

Memory layers/entries layered over the baseline cascade inherited from the selected variation — element-level rules over inherited styles, in CSS terms.

Array order is resolution order: EARLIER elements are more specific and are consulted first. Entries pinned via memory_entry_id behave as single-entry layers at their position.

System-managed layers (e.g., episodic) cannot be referenced here; they attach themselves automatically based on the episodic key.

Size cap: the TOTAL effective cascade (this field + the variation's memory layer assignments) must not exceed 10 entries. A request that would produce a larger cascade is rejected with InvalidArgument.

Returns:



43
44
45
# File 'lib/cadenya/models/objective.rb', line 43

optional :memory_cascade,
-> { Cadenya::Internal::Type::ArrayOf[Cadenya::MemoryReference] },
api_name: :memoryCascade

#metadataCadenya::Models::OperationMetadata

Metadata for ephemeral operations and activities (e.g., objectives, executions, runs)



19
# File 'lib/cadenya/models/objective.rb', line 19

required :metadata, -> { Cadenya::OperationMetadata }

#output::Hash[Symbol, top]? (readonly)

Returns the value of attribute output.

Returns:

  • (::Hash[Symbol, top], nil)


58
59
60
# File 'sig/cadenya/models/objective.rbs', line 58

def output
  @output
end

#parent_objective_idString? (readonly)

Returns the value of attribute parent_objective_id.

Returns:

  • (String, nil)


62
63
64
# File 'sig/cadenya/models/objective.rbs', line 62

def parent_objective_id
  @parent_objective_id
end

#secretsArray<Cadenya::Models::ObjectiveSecret>?

Secrets that can be used in the headers for tool calls using the secret interpolation format.

Returns:



52
# File 'lib/cadenya/models/objective.rb', line 52

optional :secrets, -> { Cadenya::Internal::Type::ArrayOf[Cadenya::ObjectiveSecret] }

#stateCadenya::Models::Objective::state

Returns the value of attribute state.

Returns:

  • (Cadenya::Models::Objective::state)


46
47
48
# File 'sig/cadenya/models/objective.rbs', line 46

def state
  @state
end

#state_messageString? (readonly)

Returns the value of attribute state_message.

Returns:

  • (String, nil)


66
67
68
# File 'sig/cadenya/models/objective.rbs', line 66

def state_message
  @state_message
end

#system_promptString

Returns the value of attribute system_prompt.

Returns:

  • (String)


48
49
50
# File 'sig/cadenya/models/objective.rbs', line 48

def system_prompt
  @system_prompt
end

#system_prompt_data::Hash[Symbol, top]? (readonly)

Returns the value of attribute system_prompt_data.

Returns:

  • (::Hash[Symbol, top], nil)


70
71
72
# File 'sig/cadenya/models/objective.rbs', line 70

def system_prompt_data
  @system_prompt_data
end

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/cadenya/models/objective.rb', line 169

Instance Method Details

#first_user_message_data=::Hash[Symbol, top] (readonly)

Parameters:

  • (::Hash[Symbol, top])

Returns:

  • (::Hash[Symbol, top])


52
# File 'sig/cadenya/models/objective.rbs', line 52

def first_user_message_data=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top]

#info=Cadenya::ObjectiveInfo (readonly)



56
# File 'sig/cadenya/models/objective.rbs', line 56

def info=: (Cadenya::ObjectiveInfo) -> Cadenya::ObjectiveInfo

#output=::Hash[Symbol, top] (readonly)

Parameters:

  • (::Hash[Symbol, top])

Returns:

  • (::Hash[Symbol, top])


60
# File 'sig/cadenya/models/objective.rbs', line 60

def output=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top]

#parent_objective_id=String (readonly)

Parameters:

  • (String)

Returns:

  • (String)


64
# File 'sig/cadenya/models/objective.rbs', line 64

def parent_objective_id=: (String) -> String

#state_message=String (readonly)

Parameters:

  • (String)

Returns:

  • (String)


68
# File 'sig/cadenya/models/objective.rbs', line 68

def state_message=: (String) -> String

#system_prompt_data=::Hash[Symbol, top] (readonly)

Parameters:

  • (::Hash[Symbol, top])

Returns:

  • (::Hash[Symbol, top])


72
# File 'sig/cadenya/models/objective.rbs', line 72

def system_prompt_data=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top]

#to_hash{

Returns:

  • ({)


91
# File 'sig/cadenya/models/objective.rbs', line 91

def to_hash: -> {