Class: Cadenya::Models::Objective

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

Overview

Defined Under Namespace

Modules: State

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(config_snapshot:, initial_message:, metadata:, state:, system_prompt:, data: nil, info: nil, memory_stack: nil, output: nil, parent_objective_id: nil, secrets: nil, state_message: 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

  • initial_message (String)

    The initial message sent to the agent. This becomes the first user message in th

  • 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

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

    Arbitrary data for the objective

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

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

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

    Memory layers/entries to push onto this objective’s memory stack on

  • 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).



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

Instance Attribute Details

#initial_messageString

The initial message sent to the agent. This becomes the first user message in the LLM chat history.

Returns:

  • (String)


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

required :initial_message, String, api_name: :initialMessage

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

Memory layers/entries to push onto this objective’s memory stack on top of the baseline stack inherited from the selected variation.

Array order is push order: the first element sits lower in the objective’s contribution to the stack; the LAST element ends up on top of the effective stack. 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 episodic_key.

Stack size cap: the TOTAL effective stack (variation’s memory layers

  • this field) must not exceed 10 entries. A request that would produce an effective stack larger than 10 is rejected with InvalidArgument.

Returns:



39
40
41
# File 'lib/cadenya/models/objective.rb', line 39

optional :memory_stack,
-> { Cadenya::Internal::Type::ArrayOf[Cadenya::MemoryReference] },
api_name: :memoryStack

#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 }

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

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

Returns:



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

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