cadenya 0.10.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fdbe6be38292a9c2cdb1398a82675a4b9d83e2a633479147843681b820dc21fb
4
- data.tar.gz: 26192932a4a0229f48bcbcb6bc4f1ae119351fd349eabaadafcfe746a8f3a2de
3
+ metadata.gz: eccefbddc3e445e6a54402fc8a5eba71d7cb44baa645cb15177c73fbc52978da
4
+ data.tar.gz: 4e9a538a35dca88e184acac8d92e0db0dd7209346583e193d83bf6753be34ba8
5
5
  SHA512:
6
- metadata.gz: b68888435e7da1c39ecb5a13f8543e8aee96e07cdef1433fe1ce5d4310bfe75f114f2efd1b43f290a278ec307c0697f2ff8dfd41712bf2c080114c1afb4dbed0
7
- data.tar.gz: ab0ea603fe0175091589cb156b96129cc82a88468e627ff2232f5fb7d500b6863372f81c0ce3b12ec02d1c849b49363991334f37b22c725a404e2344ba04f049
6
+ metadata.gz: 10fa27a5fcd86594aa52b339718a896037884aa27323d2d668a598f5058db98930e7a1426d608e5196306946f3184785709ca3bcb0f5df846df3758fd10a4218
7
+ data.tar.gz: e84213d6dd22de862fbb36859443c9eb6da7784ac5a921d3c2c11db603c104710b62aab859d3897e683a31e5ab8e6db57952a3dce3723b01308174eff93eab9c
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.11.0 (2026-06-10)
4
+
5
+ Full Changelog: [v0.10.0...v0.11.0](https://github.com/cadenya/cadenya-ruby/compare/v0.10.0...v0.11.0)
6
+
7
+ ### Features
8
+
9
+ * **api:** api update ([5f00cea](https://github.com/cadenya/cadenya-ruby/commit/5f00ceaef72eb0c4ab66a2489eecb6de7ec35616))
10
+
3
11
  ## 0.10.0 (2026-06-09)
4
12
 
5
13
  Full Changelog: [v0.9.0...v0.10.0](https://github.com/cadenya/cadenya-ruby/compare/v0.9.0...v0.10.0)
data/README.md CHANGED
@@ -17,7 +17,7 @@ To use this gem, install via Bundler by adding the following to your application
17
17
  <!-- x-release-please-start-version -->
18
18
 
19
19
  ```ruby
20
- gem "cadenya", "~> 0.10.0"
20
+ gem "cadenya", "~> 0.11.0"
21
21
  ```
22
22
 
23
23
  <!-- x-release-please-end -->
@@ -4,13 +4,6 @@ module Cadenya
4
4
  module Models
5
5
  module Agents
6
6
  class AgentScheduleSpec < Cadenya::Internal::Type::BaseModel
7
- # @!attribute initial_message
8
- # The initial message passed to CreateObjective on each fire. Becomes the first
9
- # user message in the objective's chat history.
10
- #
11
- # @return [String]
12
- required :initial_message, String, api_name: :initialMessage
13
-
14
7
  # @!attribute schedule
15
8
  # Schedule defines WHEN the schedule fires. Temporal-style structured form: a list
16
9
  # of calendar rules (wall-clock) and/or interval rules (duration), OR'd together.
@@ -26,6 +19,14 @@ module Cadenya
26
19
  # @return [Object, nil]
27
20
  optional :data, Cadenya::Internal::Type::Unknown
28
21
 
22
+ # @!attribute initial_message
23
+ # Optional initial message passed to CreateObjective on each fire. Becomes the
24
+ # first user message in the objective's chat history. When unset, the fired
25
+ # objective defers to the selected variation's user_message_template.
26
+ #
27
+ # @return [String, nil]
28
+ optional :initial_message, String, api_name: :initialMessage
29
+
29
30
  # @!attribute overlap_policy
30
31
  # What to do when the previous run is still in flight. Defaults to SKIP.
31
32
  #
@@ -34,6 +35,14 @@ module Cadenya
34
35
  enum: -> { Cadenya::Agents::AgentScheduleSpec::OverlapPolicy },
35
36
  api_name: :overlapPolicy
36
37
 
38
+ # @!attribute user_data
39
+ # Optional data rendered into the variation's user_message_template when each
40
+ # fired objective is created. Separate from `data`, which renders the system
41
+ # prompt template.
42
+ #
43
+ # @return [Object, nil]
44
+ optional :user_data, Cadenya::Internal::Type::Unknown, api_name: :userData
45
+
37
46
  # @!attribute variation_id
38
47
  # Optional explicit variation. When unset, the agent's variation_selection_mode
39
48
  # chooses per fire.
@@ -41,20 +50,22 @@ module Cadenya
41
50
  # @return [String, nil]
42
51
  optional :variation_id, String, api_name: :variationId
43
52
 
44
- # @!method initialize(initial_message:, schedule:, data: nil, overlap_policy: nil, variation_id: nil)
53
+ # @!method initialize(schedule:, data: nil, initial_message: nil, overlap_policy: nil, user_data: nil, variation_id: nil)
45
54
  # Some parameter documentations has been truncated, see
46
55
  # {Cadenya::Models::Agents::AgentScheduleSpec} for more details.
47
56
  #
48
57
  # AgentScheduleSpec is the user-provided configuration for a schedule.
49
58
  #
50
- # @param initial_message [String] The initial message passed to CreateObjective on each fire. Becomes the
51
- #
52
59
  # @param schedule [Cadenya::Models::Agents::AgentScheduleSpecSchedule] Schedule defines WHEN the schedule fires. Temporal-style structured form:
53
60
  #
54
61
  # @param data [Object] Optional input data passed to the objective. If the agent has an
55
62
  #
63
+ # @param initial_message [String] Optional initial message passed to CreateObjective on each fire. Becomes the
64
+ #
56
65
  # @param overlap_policy [Symbol, Cadenya::Models::Agents::AgentScheduleSpec::OverlapPolicy] What to do when the previous run is still in flight. Defaults to SKIP.
57
66
  #
67
+ # @param user_data [Object] Optional data rendered into the variation's user_message_template when each
68
+ #
58
69
  # @param variation_id [String] Optional explicit variation. When unset, the agent's variation_selection_mode
59
70
 
60
71
  # What to do when the previous run is still in flight. Defaults to SKIP.
@@ -60,11 +60,22 @@ module Cadenya
60
60
  -> { Cadenya::Agents::AgentVariationSpecProgressiveDiscovery },
61
61
  api_name: :progressiveDiscovery
62
62
 
63
- # @!attribute prompt
64
- # The system prompt for this variation
63
+ # @!attribute system_prompt_template
64
+ # Liquid template for the system prompt of objectives using this variation.
65
+ # Rendered with CreateObjectiveRequest.data into Objective.system_prompt.
65
66
  #
66
67
  # @return [String, nil]
67
- optional :prompt, String
68
+ optional :system_prompt_template, String, api_name: :systemPromptTemplate
69
+
70
+ # @!attribute user_message_template
71
+ # Liquid template for the initial user message of objectives using this variation.
72
+ # Rendered with CreateObjectiveRequest.user_data and becomes the first user
73
+ # message in the LLM chat history. CreateObjectiveRequest.initial_message, when
74
+ # set, overrides the rendered result. If neither this template nor initial_message
75
+ # is present, objective creation is rejected with InvalidArgument.
76
+ #
77
+ # @return [String, nil]
78
+ optional :user_message_template, String, api_name: :userMessageTemplate
68
79
 
69
80
  # @!attribute weight
70
81
  # Weight for weighted random selection (>= 0). P(v) = v.weight / sum(all_weights).
@@ -75,7 +86,7 @@ module Cadenya
75
86
  # @return [Integer, nil]
76
87
  optional :weight, Integer
77
88
 
78
- # @!method initialize(compaction_config: nil, constraints: nil, description: nil, enable_episodic_memory: nil, episodic_memory_ttl: nil, model_config: nil, progressive_discovery: nil, prompt: nil, weight: nil)
89
+ # @!method initialize(compaction_config: nil, constraints: nil, description: nil, enable_episodic_memory: nil, episodic_memory_ttl: nil, model_config: nil, progressive_discovery: nil, system_prompt_template: nil, user_message_template: nil, weight: nil)
79
90
  # Some parameter documentations has been truncated, see
80
91
  # {Cadenya::Models::Agents::AgentVariationSpec} for more details.
81
92
  #
@@ -95,7 +106,9 @@ module Cadenya
95
106
  #
96
107
  # @param progressive_discovery [Cadenya::Models::Agents::AgentVariationSpecProgressiveDiscovery] ProgressiveDiscovery is used to indicate that the agent should automatically dis
97
108
  #
98
- # @param prompt [String] The system prompt for this variation
109
+ # @param system_prompt_template [String] Liquid template for the system prompt of objectives using this variation.
110
+ #
111
+ # @param user_message_template [String] Liquid template for the initial user message of objectives using this variation.
99
112
  #
100
113
  # @param weight [Integer] Weight for weighted random selection (>= 0). P(v) = v.weight / sum(all_weights).
101
114
  end
@@ -100,9 +100,17 @@ module Cadenya
100
100
  #
101
101
  # @return [String, nil]
102
102
  optional :state_message, String, api_name: :stateMessage
103
+
104
+ # @!attribute user_data
105
+ # Arbitrary data used to render the variation's user_message_template
106
+ #
107
+ # @return [Hash{Symbol=>Object}, nil]
108
+ optional :user_data,
109
+ Cadenya::Internal::Type::HashOf[Cadenya::Internal::Type::Unknown],
110
+ api_name: :userData
103
111
  end
104
112
 
105
- # @!method 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)
113
+ # @!method 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, user_data: nil)
106
114
  # Some parameter documentations has been truncated, see
107
115
  # {Cadenya::Models::Objective} for more details.
108
116
  #
@@ -133,6 +141,8 @@ module Cadenya
133
141
  # @param secrets [Array<Cadenya::Models::ObjectiveSecret>] Secrets that can be used in the headers for tool calls using the secret interpol
134
142
  #
135
143
  # @param state_message [String] Optional human-readable detail about the current state (e.g. a failure reason).
144
+ #
145
+ # @param user_data [Hash{Symbol=>Object}] Arbitrary data used to render the variation's user_message_template
136
146
 
137
147
  # The current lifecycle state of the objective.
138
148
  #
@@ -25,9 +25,11 @@ module Cadenya
25
25
  required :data, Cadenya::Internal::Type::HashOf[Cadenya::Internal::Type::Unknown]
26
26
 
27
27
  # @!attribute initial_message
28
- # Optional override for initial message sent to the agent. This becomes the first
29
- # user message in the LLM chat history. The agent variation is used to set this if
30
- # not present.
28
+ # Optional override for the initial message sent to the agent. This becomes the
29
+ # first user message in the LLM chat history. When not set, the selected
30
+ # variation's user_message_template is rendered with user_data instead. If neither
31
+ # this field nor a user_message_template is present, the request is rejected with
32
+ # InvalidArgument.
31
33
  #
32
34
  # @return [String, nil]
33
35
  optional :initial_message, String, api_name: :initialMessage
@@ -69,6 +71,16 @@ module Cadenya
69
71
  # @return [Array<Cadenya::Models::ObjectiveCreateParams::Secret>, nil]
70
72
  optional :secrets, -> { Cadenya::Internal::Type::ArrayOf[Cadenya::ObjectiveCreateParams::Secret] }
71
73
 
74
+ # @!attribute user_data
75
+ # Arbitrary data rendered into the selected variation's user_message_template
76
+ # (liquid) to produce the initial user message. Separate from `data`, which
77
+ # renders the system prompt template.
78
+ #
79
+ # @return [Hash{Symbol=>Object}, nil]
80
+ optional :user_data,
81
+ Cadenya::Internal::Type::HashOf[Cadenya::Internal::Type::Unknown],
82
+ api_name: :userData
83
+
72
84
  # @!attribute variation_id
73
85
  # Optional explicit variation selection. Overrides the agent's
74
86
  # variation_selection_mode.
@@ -76,7 +88,7 @@ module Cadenya
76
88
  # @return [String, nil]
77
89
  optional :variation_id, String, api_name: :variationId
78
90
 
79
- # @!method initialize(workspace_id:, agent_id:, data:, initial_message: nil, memory_stack: nil, metadata: nil, secrets: nil, variation_id: nil, request_options: {})
91
+ # @!method initialize(workspace_id:, agent_id:, data:, initial_message: nil, memory_stack: nil, metadata: nil, secrets: nil, user_data: nil, variation_id: nil, request_options: {})
80
92
  # Some parameter documentations has been truncated, see
81
93
  # {Cadenya::Models::ObjectiveCreateParams} for more details.
82
94
  #
@@ -86,7 +98,7 @@ module Cadenya
86
98
  #
87
99
  # @param data [Hash{Symbol=>Object}] Arbitrary data for the objective. May be used in liquid templates for prompts co
88
100
  #
89
- # @param initial_message [String] Optional override for initial message sent to the agent. This becomes the first
101
+ # @param initial_message [String] Optional override for the initial message sent to the agent. This becomes the fi
90
102
  #
91
103
  # @param memory_stack [Array<Cadenya::Models::MemoryReference>] Memory layers/entries to push onto this objective's memory stack on
92
104
  #
@@ -94,6 +106,8 @@ module Cadenya
94
106
  #
95
107
  # @param secrets [Array<Cadenya::Models::ObjectiveCreateParams::Secret>] Secrets that can be used in the headers for tool calls using the secret interpol
96
108
  #
109
+ # @param user_data [Hash{Symbol=>Object}] Arbitrary data rendered into the selected variation's user_message_template
110
+ #
97
111
  # @param variation_id [String] Optional explicit variation selection. Overrides the agent's variation_selection
98
112
  #
99
113
  # @param request_options [Cadenya::RequestOptions, Hash{Symbol=>Object}]
@@ -20,7 +20,7 @@ module Cadenya
20
20
  #
21
21
  # Creates a new objective in the workspace
22
22
  #
23
- # @overload create(workspace_id, agent_id:, data:, initial_message: nil, memory_stack: nil, metadata: nil, secrets: nil, variation_id: nil, request_options: {})
23
+ # @overload create(workspace_id, agent_id:, data:, initial_message: nil, memory_stack: nil, metadata: nil, secrets: nil, user_data: nil, variation_id: nil, request_options: {})
24
24
  #
25
25
  # @param workspace_id [String]
26
26
  #
@@ -28,7 +28,7 @@ module Cadenya
28
28
  #
29
29
  # @param data [Hash{Symbol=>Object}] Arbitrary data for the objective. May be used in liquid templates for prompts co
30
30
  #
31
- # @param initial_message [String] Optional override for initial message sent to the agent. This becomes the first
31
+ # @param initial_message [String] Optional override for the initial message sent to the agent. This becomes the fi
32
32
  #
33
33
  # @param memory_stack [Array<Cadenya::Models::MemoryReference>] Memory layers/entries to push onto this objective's memory stack on
34
34
  #
@@ -36,6 +36,8 @@ module Cadenya
36
36
  #
37
37
  # @param secrets [Array<Cadenya::Models::ObjectiveCreateParams::Secret>] Secrets that can be used in the headers for tool calls using the secret interpol
38
38
  #
39
+ # @param user_data [Hash{Symbol=>Object}] Arbitrary data rendered into the selected variation's user_message_template
40
+ #
39
41
  # @param variation_id [String] Optional explicit variation selection. Overrides the agent's variation_selection
40
42
  #
41
43
  # @param request_options [Cadenya::RequestOptions, Hash{Symbol=>Object}, nil]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Cadenya
4
- VERSION = "0.10.0"
4
+ VERSION = "0.11.0"
5
5
  end
@@ -14,11 +14,6 @@ module Cadenya
14
14
  )
15
15
  end
16
16
 
17
- # The initial message passed to CreateObjective on each fire. Becomes the first
18
- # user message in the objective's chat history.
19
- sig { returns(String) }
20
- attr_accessor :initial_message
21
-
22
17
  # Schedule defines WHEN the schedule fires. Temporal-style structured form: a list
23
18
  # of calendar rules (wall-clock) and/or interval rules (duration), OR'd together.
24
19
  # At least one rule is required.
@@ -40,6 +35,15 @@ module Cadenya
40
35
  sig { params(data: T.anything).void }
41
36
  attr_writer :data
42
37
 
38
+ # Optional initial message passed to CreateObjective on each fire. Becomes the
39
+ # first user message in the objective's chat history. When unset, the fired
40
+ # objective defers to the selected variation's user_message_template.
41
+ sig { returns(T.nilable(String)) }
42
+ attr_reader :initial_message
43
+
44
+ sig { params(initial_message: String).void }
45
+ attr_writer :initial_message
46
+
43
47
  # What to do when the previous run is still in flight. Defaults to SKIP.
44
48
  sig do
45
49
  returns(
@@ -58,6 +62,15 @@ module Cadenya
58
62
  end
59
63
  attr_writer :overlap_policy
60
64
 
65
+ # Optional data rendered into the variation's user_message_template when each
66
+ # fired objective is created. Separate from `data`, which renders the system
67
+ # prompt template.
68
+ sig { returns(T.nilable(T.anything)) }
69
+ attr_reader :user_data
70
+
71
+ sig { params(user_data: T.anything).void }
72
+ attr_writer :user_data
73
+
61
74
  # Optional explicit variation. When unset, the agent's variation_selection_mode
62
75
  # chooses per fire.
63
76
  sig { returns(T.nilable(String)) }
@@ -69,18 +82,16 @@ module Cadenya
69
82
  # AgentScheduleSpec is the user-provided configuration for a schedule.
70
83
  sig do
71
84
  params(
72
- initial_message: String,
73
85
  schedule: Cadenya::Agents::AgentScheduleSpecSchedule::OrHash,
74
86
  data: T.anything,
87
+ initial_message: String,
75
88
  overlap_policy:
76
89
  Cadenya::Agents::AgentScheduleSpec::OverlapPolicy::OrSymbol,
90
+ user_data: T.anything,
77
91
  variation_id: String
78
92
  ).returns(T.attached_class)
79
93
  end
80
94
  def self.new(
81
- # The initial message passed to CreateObjective on each fire. Becomes the first
82
- # user message in the objective's chat history.
83
- initial_message:,
84
95
  # Schedule defines WHEN the schedule fires. Temporal-style structured form: a list
85
96
  # of calendar rules (wall-clock) and/or interval rules (duration), OR'd together.
86
97
  # At least one rule is required.
@@ -88,8 +99,16 @@ module Cadenya
88
99
  # Optional input data passed to the objective. If the agent has an
89
100
  # input_data_schema, this must satisfy it.
90
101
  data: nil,
102
+ # Optional initial message passed to CreateObjective on each fire. Becomes the
103
+ # first user message in the objective's chat history. When unset, the fired
104
+ # objective defers to the selected variation's user_message_template.
105
+ initial_message: nil,
91
106
  # What to do when the previous run is still in flight. Defaults to SKIP.
92
107
  overlap_policy: nil,
108
+ # Optional data rendered into the variation's user_message_template when each
109
+ # fired objective is created. Separate from `data`, which renders the system
110
+ # prompt template.
111
+ user_data: nil,
93
112
  # Optional explicit variation. When unset, the agent's variation_selection_mode
94
113
  # chooses per fire.
95
114
  variation_id: nil
@@ -99,11 +118,12 @@ module Cadenya
99
118
  sig do
100
119
  override.returns(
101
120
  {
102
- initial_message: String,
103
121
  schedule: Cadenya::Agents::AgentScheduleSpecSchedule,
104
122
  data: T.anything,
123
+ initial_message: String,
105
124
  overlap_policy:
106
125
  Cadenya::Agents::AgentScheduleSpec::OverlapPolicy::OrSymbol,
126
+ user_data: T.anything,
107
127
  variation_id: String
108
128
  }
109
129
  )
@@ -103,12 +103,24 @@ module Cadenya
103
103
  end
104
104
  attr_writer :progressive_discovery
105
105
 
106
- # The system prompt for this variation
106
+ # Liquid template for the system prompt of objectives using this variation.
107
+ # Rendered with CreateObjectiveRequest.data into Objective.system_prompt.
107
108
  sig { returns(T.nilable(String)) }
108
- attr_reader :prompt
109
+ attr_reader :system_prompt_template
109
110
 
110
- sig { params(prompt: String).void }
111
- attr_writer :prompt
111
+ sig { params(system_prompt_template: String).void }
112
+ attr_writer :system_prompt_template
113
+
114
+ # Liquid template for the initial user message of objectives using this variation.
115
+ # Rendered with CreateObjectiveRequest.user_data and becomes the first user
116
+ # message in the LLM chat history. CreateObjectiveRequest.initial_message, when
117
+ # set, overrides the rendered result. If neither this template nor initial_message
118
+ # is present, objective creation is rejected with InvalidArgument.
119
+ sig { returns(T.nilable(String)) }
120
+ attr_reader :user_message_template
121
+
122
+ sig { params(user_message_template: String).void }
123
+ attr_writer :user_message_template
112
124
 
113
125
  # Weight for weighted random selection (>= 0). P(v) = v.weight / sum(all_weights).
114
126
  # Only used when the agent's variation_selection_mode is WEIGHTED. A weight of 0
@@ -133,7 +145,8 @@ module Cadenya
133
145
  Cadenya::Agents::AgentVariationSpecModelConfig::OrHash,
134
146
  progressive_discovery:
135
147
  Cadenya::Agents::AgentVariationSpecProgressiveDiscovery::OrHash,
136
- prompt: String,
148
+ system_prompt_template: String,
149
+ user_message_template: String,
137
150
  weight: Integer
138
151
  ).returns(T.attached_class)
139
152
  end
@@ -162,8 +175,15 @@ module Cadenya
162
175
  # tool search. These are used in conjunction with the context-aware tool search
163
176
  # and can help select the best tools for the task.
164
177
  progressive_discovery: nil,
165
- # The system prompt for this variation
166
- prompt: nil,
178
+ # Liquid template for the system prompt of objectives using this variation.
179
+ # Rendered with CreateObjectiveRequest.data into Objective.system_prompt.
180
+ system_prompt_template: nil,
181
+ # Liquid template for the initial user message of objectives using this variation.
182
+ # Rendered with CreateObjectiveRequest.user_data and becomes the first user
183
+ # message in the LLM chat history. CreateObjectiveRequest.initial_message, when
184
+ # set, overrides the rendered result. If neither this template nor initial_message
185
+ # is present, objective creation is rejected with InvalidArgument.
186
+ user_message_template: nil,
167
187
  # Weight for weighted random selection (>= 0). P(v) = v.weight / sum(all_weights).
168
188
  # Only used when the agent's variation_selection_mode is WEIGHTED. A weight of 0
169
189
  # means never auto-selected, but can still be chosen explicitly via variation_id
@@ -184,7 +204,8 @@ module Cadenya
184
204
  model_config: Cadenya::Agents::AgentVariationSpecModelConfig,
185
205
  progressive_discovery:
186
206
  Cadenya::Agents::AgentVariationSpecProgressiveDiscovery,
187
- prompt: String,
207
+ system_prompt_template: String,
208
+ user_message_template: String,
188
209
  weight: Integer
189
210
  }
190
211
  )
@@ -107,6 +107,13 @@ module Cadenya
107
107
  sig { params(state_message: String).void }
108
108
  attr_writer :state_message
109
109
 
110
+ # Arbitrary data used to render the variation's user_message_template
111
+ sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
112
+ attr_reader :user_data
113
+
114
+ sig { params(user_data: T::Hash[Symbol, T.anything]).void }
115
+ attr_writer :user_data
116
+
110
117
  # Objective is the data for an objective. It contains the snapshotted fields for
111
118
  # the selected agent and variation. Secrets are returned only with their names,
112
119
  # and the output definition is copied from the agent's configuration.
@@ -123,7 +130,8 @@ module Cadenya
123
130
  output: T::Hash[Symbol, T.anything],
124
131
  parent_objective_id: String,
125
132
  secrets: T::Array[Cadenya::ObjectiveSecret::OrHash],
126
- state_message: String
133
+ state_message: String,
134
+ user_data: T::Hash[Symbol, T.anything]
127
135
  ).returns(T.attached_class)
128
136
  end
129
137
  def self.new(
@@ -172,7 +180,9 @@ module Cadenya
172
180
  # interpolation format.
173
181
  secrets: nil,
174
182
  # Optional human-readable detail about the current state (e.g. a failure reason).
175
- state_message: nil
183
+ state_message: nil,
184
+ # Arbitrary data used to render the variation's user_message_template
185
+ user_data: nil
176
186
  )
177
187
  end
178
188
 
@@ -190,7 +200,8 @@ module Cadenya
190
200
  output: T::Hash[Symbol, T.anything],
191
201
  parent_objective_id: String,
192
202
  secrets: T::Array[Cadenya::ObjectiveSecret],
193
- state_message: String
203
+ state_message: String,
204
+ user_data: T::Hash[Symbol, T.anything]
194
205
  }
195
206
  )
196
207
  end
@@ -22,9 +22,11 @@ module Cadenya
22
22
  sig { returns(T::Hash[Symbol, T.anything]) }
23
23
  attr_accessor :data
24
24
 
25
- # Optional override for initial message sent to the agent. This becomes the first
26
- # user message in the LLM chat history. The agent variation is used to set this if
27
- # not present.
25
+ # Optional override for the initial message sent to the agent. This becomes the
26
+ # first user message in the LLM chat history. When not set, the selected
27
+ # variation's user_message_template is rendered with user_data instead. If neither
28
+ # this field nor a user_message_template is present, the request is rejected with
29
+ # InvalidArgument.
28
30
  sig { returns(T.nilable(String)) }
29
31
  attr_reader :initial_message
30
32
 
@@ -77,6 +79,15 @@ module Cadenya
77
79
  end
78
80
  attr_writer :secrets
79
81
 
82
+ # Arbitrary data rendered into the selected variation's user_message_template
83
+ # (liquid) to produce the initial user message. Separate from `data`, which
84
+ # renders the system prompt template.
85
+ sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
86
+ attr_reader :user_data
87
+
88
+ sig { params(user_data: T::Hash[Symbol, T.anything]).void }
89
+ attr_writer :user_data
90
+
80
91
  # Optional explicit variation selection. Overrides the agent's
81
92
  # variation_selection_mode.
82
93
  sig { returns(T.nilable(String)) }
@@ -94,6 +105,7 @@ module Cadenya
94
105
  memory_stack: T::Array[Cadenya::MemoryReference::OrHash],
95
106
  metadata: Cadenya::CreateOperationMetadata::OrHash,
96
107
  secrets: T::Array[Cadenya::ObjectiveCreateParams::Secret::OrHash],
108
+ user_data: T::Hash[Symbol, T.anything],
97
109
  variation_id: String,
98
110
  request_options: Cadenya::RequestOptions::OrHash
99
111
  ).returns(T.attached_class)
@@ -104,9 +116,11 @@ module Cadenya
104
116
  # Arbitrary data for the objective. May be used in liquid templates for prompts
105
117
  # configured on the agent variation
106
118
  data:,
107
- # Optional override for initial message sent to the agent. This becomes the first
108
- # user message in the LLM chat history. The agent variation is used to set this if
109
- # not present.
119
+ # Optional override for the initial message sent to the agent. This becomes the
120
+ # first user message in the LLM chat history. When not set, the selected
121
+ # variation's user_message_template is rendered with user_data instead. If neither
122
+ # this field nor a user_message_template is present, the request is rejected with
123
+ # InvalidArgument.
110
124
  initial_message: nil,
111
125
  # Memory layers/entries to push onto this objective's memory stack on top of the
112
126
  # baseline stack inherited from the selected variation.
@@ -131,6 +145,10 @@ module Cadenya
131
145
  # Secrets that can be used in the headers for tool calls using the secret
132
146
  # interpolation format.
133
147
  secrets: nil,
148
+ # Arbitrary data rendered into the selected variation's user_message_template
149
+ # (liquid) to produce the initial user message. Separate from `data`, which
150
+ # renders the system prompt template.
151
+ user_data: nil,
134
152
  # Optional explicit variation selection. Overrides the agent's
135
153
  # variation_selection_mode.
136
154
  variation_id: nil,
@@ -148,6 +166,7 @@ module Cadenya
148
166
  memory_stack: T::Array[Cadenya::MemoryReference],
149
167
  metadata: Cadenya::CreateOperationMetadata,
150
168
  secrets: T::Array[Cadenya::ObjectiveCreateParams::Secret],
169
+ user_data: T::Hash[Symbol, T.anything],
151
170
  variation_id: String,
152
171
  request_options: Cadenya::RequestOptions
153
172
  }
@@ -25,6 +25,7 @@ module Cadenya
25
25
  memory_stack: T::Array[Cadenya::MemoryReference::OrHash],
26
26
  metadata: Cadenya::CreateOperationMetadata::OrHash,
27
27
  secrets: T::Array[Cadenya::ObjectiveCreateParams::Secret::OrHash],
28
+ user_data: T::Hash[Symbol, T.anything],
28
29
  variation_id: String,
29
30
  request_options: Cadenya::RequestOptions::OrHash
30
31
  ).returns(Cadenya::Objective)
@@ -35,9 +36,11 @@ module Cadenya
35
36
  # Arbitrary data for the objective. May be used in liquid templates for prompts
36
37
  # configured on the agent variation
37
38
  data:,
38
- # Optional override for initial message sent to the agent. This becomes the first
39
- # user message in the LLM chat history. The agent variation is used to set this if
40
- # not present.
39
+ # Optional override for the initial message sent to the agent. This becomes the
40
+ # first user message in the LLM chat history. When not set, the selected
41
+ # variation's user_message_template is rendered with user_data instead. If neither
42
+ # this field nor a user_message_template is present, the request is rejected with
43
+ # InvalidArgument.
41
44
  initial_message: nil,
42
45
  # Memory layers/entries to push onto this objective's memory stack on top of the
43
46
  # baseline stack inherited from the selected variation.
@@ -62,6 +65,10 @@ module Cadenya
62
65
  # Secrets that can be used in the headers for tool calls using the secret
63
66
  # interpolation format.
64
67
  secrets: nil,
68
+ # Arbitrary data rendered into the selected variation's user_message_template
69
+ # (liquid) to produce the initial user message. Separate from `data`, which
70
+ # renders the system prompt template.
71
+ user_data: nil,
65
72
  # Optional explicit variation selection. Overrides the agent's
66
73
  # variation_selection_mode.
67
74
  variation_id: nil,
@@ -5,45 +5,54 @@ module Cadenya
5
5
  module Agents
6
6
  type agent_schedule_spec =
7
7
  {
8
- initial_message: String,
9
8
  schedule: Cadenya::Agents::AgentScheduleSpecSchedule,
10
9
  data: top,
10
+ initial_message: String,
11
11
  overlap_policy: Cadenya::Models::Agents::AgentScheduleSpec::overlap_policy,
12
+ user_data: top,
12
13
  variation_id: String
13
14
  }
14
15
 
15
16
  class AgentScheduleSpec < Cadenya::Internal::Type::BaseModel
16
- attr_accessor initial_message: String
17
-
18
17
  attr_accessor schedule: Cadenya::Agents::AgentScheduleSpecSchedule
19
18
 
20
19
  attr_reader data: top?
21
20
 
22
21
  def data=: (top) -> top
23
22
 
23
+ attr_reader initial_message: String?
24
+
25
+ def initial_message=: (String) -> String
26
+
24
27
  attr_reader overlap_policy: Cadenya::Models::Agents::AgentScheduleSpec::overlap_policy?
25
28
 
26
29
  def overlap_policy=: (
27
30
  Cadenya::Models::Agents::AgentScheduleSpec::overlap_policy
28
31
  ) -> Cadenya::Models::Agents::AgentScheduleSpec::overlap_policy
29
32
 
33
+ attr_reader user_data: top?
34
+
35
+ def user_data=: (top) -> top
36
+
30
37
  attr_reader variation_id: String?
31
38
 
32
39
  def variation_id=: (String) -> String
33
40
 
34
41
  def initialize: (
35
- initial_message: String,
36
42
  schedule: Cadenya::Agents::AgentScheduleSpecSchedule,
37
43
  ?data: top,
44
+ ?initial_message: String,
38
45
  ?overlap_policy: Cadenya::Models::Agents::AgentScheduleSpec::overlap_policy,
46
+ ?user_data: top,
39
47
  ?variation_id: String
40
48
  ) -> void
41
49
 
42
50
  def to_hash: -> {
43
- initial_message: String,
44
51
  schedule: Cadenya::Agents::AgentScheduleSpecSchedule,
45
52
  data: top,
53
+ initial_message: String,
46
54
  overlap_policy: Cadenya::Models::Agents::AgentScheduleSpec::overlap_policy,
55
+ user_data: top,
47
56
  variation_id: String
48
57
  }
49
58
 
@@ -12,7 +12,8 @@ module Cadenya
12
12
  episodic_memory_ttl: Integer,
13
13
  model_config: Cadenya::Agents::AgentVariationSpecModelConfig,
14
14
  progressive_discovery: Cadenya::Agents::AgentVariationSpecProgressiveDiscovery,
15
- prompt: String,
15
+ system_prompt_template: String,
16
+ user_message_template: String,
16
17
  weight: Integer
17
18
  }
18
19
 
@@ -53,9 +54,13 @@ module Cadenya
53
54
  Cadenya::Agents::AgentVariationSpecProgressiveDiscovery
54
55
  ) -> Cadenya::Agents::AgentVariationSpecProgressiveDiscovery
55
56
 
56
- attr_reader prompt: String?
57
+ attr_reader system_prompt_template: String?
57
58
 
58
- def prompt=: (String) -> String
59
+ def system_prompt_template=: (String) -> String
60
+
61
+ attr_reader user_message_template: String?
62
+
63
+ def user_message_template=: (String) -> String
59
64
 
60
65
  attr_reader weight: Integer?
61
66
 
@@ -69,7 +74,8 @@ module Cadenya
69
74
  ?episodic_memory_ttl: Integer,
70
75
  ?model_config: Cadenya::Agents::AgentVariationSpecModelConfig,
71
76
  ?progressive_discovery: Cadenya::Agents::AgentVariationSpecProgressiveDiscovery,
72
- ?prompt: String,
77
+ ?system_prompt_template: String,
78
+ ?user_message_template: String,
73
79
  ?weight: Integer
74
80
  ) -> void
75
81
 
@@ -81,7 +87,8 @@ module Cadenya
81
87
  episodic_memory_ttl: Integer,
82
88
  model_config: Cadenya::Agents::AgentVariationSpecModelConfig,
83
89
  progressive_discovery: Cadenya::Agents::AgentVariationSpecProgressiveDiscovery,
84
- prompt: String,
90
+ system_prompt_template: String,
91
+ user_message_template: String,
85
92
  weight: Integer
86
93
  }
87
94
  end
@@ -13,7 +13,8 @@ module Cadenya
13
13
  output: ::Hash[Symbol, top],
14
14
  parent_objective_id: String,
15
15
  secrets: ::Array[Cadenya::ObjectiveSecret],
16
- state_message: String
16
+ state_message: String,
17
+ user_data: ::Hash[Symbol, top]
17
18
  }
18
19
 
19
20
  class Objective < Cadenya::Internal::Type::BaseModel
@@ -59,6 +60,10 @@ module Cadenya
59
60
 
60
61
  def state_message=: (String) -> String
61
62
 
63
+ attr_reader user_data: ::Hash[Symbol, top]?
64
+
65
+ def user_data=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top]
66
+
62
67
  def initialize: (
63
68
  config_snapshot: Cadenya::ObjectiveConfigSnapshot,
64
69
  initial_message: String,
@@ -71,7 +76,8 @@ module Cadenya
71
76
  ?output: ::Hash[Symbol, top],
72
77
  ?parent_objective_id: String,
73
78
  ?secrets: ::Array[Cadenya::ObjectiveSecret],
74
- ?state_message: String
79
+ ?state_message: String,
80
+ ?user_data: ::Hash[Symbol, top]
75
81
  ) -> void
76
82
 
77
83
  def to_hash: -> {
@@ -86,7 +92,8 @@ module Cadenya
86
92
  output: ::Hash[Symbol, top],
87
93
  parent_objective_id: String,
88
94
  secrets: ::Array[Cadenya::ObjectiveSecret],
89
- state_message: String
95
+ state_message: String,
96
+ user_data: ::Hash[Symbol, top]
90
97
  }
91
98
 
92
99
  type state =
@@ -9,6 +9,7 @@ module Cadenya
9
9
  memory_stack: ::Array[Cadenya::MemoryReference],
10
10
  metadata: Cadenya::CreateOperationMetadata,
11
11
  secrets: ::Array[Cadenya::ObjectiveCreateParams::Secret],
12
+ user_data: ::Hash[Symbol, top],
12
13
  variation_id: String
13
14
  }
14
15
  & Cadenya::Internal::Type::request_parameters
@@ -45,6 +46,10 @@ module Cadenya
45
46
  ::Array[Cadenya::ObjectiveCreateParams::Secret]
46
47
  ) -> ::Array[Cadenya::ObjectiveCreateParams::Secret]
47
48
 
49
+ attr_reader user_data: ::Hash[Symbol, top]?
50
+
51
+ def user_data=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top]
52
+
48
53
  attr_reader variation_id: String?
49
54
 
50
55
  def variation_id=: (String) -> String
@@ -57,6 +62,7 @@ module Cadenya
57
62
  ?memory_stack: ::Array[Cadenya::MemoryReference],
58
63
  ?metadata: Cadenya::CreateOperationMetadata,
59
64
  ?secrets: ::Array[Cadenya::ObjectiveCreateParams::Secret],
65
+ ?user_data: ::Hash[Symbol, top],
60
66
  ?variation_id: String,
61
67
  ?request_options: Cadenya::request_opts
62
68
  ) -> void
@@ -69,6 +75,7 @@ module Cadenya
69
75
  memory_stack: ::Array[Cadenya::MemoryReference],
70
76
  metadata: Cadenya::CreateOperationMetadata,
71
77
  secrets: ::Array[Cadenya::ObjectiveCreateParams::Secret],
78
+ user_data: ::Hash[Symbol, top],
72
79
  variation_id: String,
73
80
  request_options: Cadenya::RequestOptions
74
81
  }
@@ -17,6 +17,7 @@ module Cadenya
17
17
  ?memory_stack: ::Array[Cadenya::MemoryReference],
18
18
  ?metadata: Cadenya::CreateOperationMetadata,
19
19
  ?secrets: ::Array[Cadenya::ObjectiveCreateParams::Secret],
20
+ ?user_data: ::Hash[Symbol, top],
20
21
  ?variation_id: String,
21
22
  ?request_options: Cadenya::request_opts
22
23
  ) -> Cadenya::Objective
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cadenya
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cadenya
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-06-09 00:00:00.000000000 Z
11
+ date: 2026-06-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cgi