cadenya 0.27.0 → 0.28.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 +4 -4
- data/CHANGELOG.md +8 -0
- data/README.md +1 -1
- data/lib/cadenya/models/agent_spec.rb +16 -15
- data/lib/cadenya/models/agents/agent_schedule_spec.rb +21 -20
- data/lib/cadenya/models/agents/agent_variation_spec.rb +16 -14
- data/lib/cadenya/models/objective.rb +18 -16
- data/lib/cadenya/models/objective_create_params.rb +28 -25
- data/lib/cadenya/resources/objectives.rb +5 -5
- data/lib/cadenya/version.rb +1 -1
- data/rbi/cadenya/models/agent_spec.rbi +23 -19
- data/rbi/cadenya/models/agents/agent_schedule_spec.rbi +38 -36
- data/rbi/cadenya/models/agents/agent_variation_spec.rbi +25 -21
- data/rbi/cadenya/models/objective.rbi +24 -24
- data/rbi/cadenya/models/objective_create_params.rbi +39 -37
- data/rbi/cadenya/resources/objectives.rbi +16 -15
- data/sig/cadenya/models/agent_spec.rbs +9 -7
- data/sig/cadenya/models/agents/agent_schedule_spec.rbs +15 -15
- data/sig/cadenya/models/agents/agent_variation_spec.rbs +7 -7
- data/sig/cadenya/models/objective.rbs +14 -14
- data/sig/cadenya/models/objective_create_params.rbs +16 -16
- data/sig/cadenya/resources/objectives.rbs +3 -3
- metadata +2 -2
|
@@ -27,22 +27,23 @@ module Cadenya
|
|
|
27
27
|
end
|
|
28
28
|
attr_writer :schedule
|
|
29
29
|
|
|
30
|
-
# Optional
|
|
31
|
-
#
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
# Optional explicit first user message passed to CreateObjective on each fire.
|
|
31
|
+
# Becomes the first user message in the objective's chat history. When unset, the
|
|
32
|
+
# fired objective defers to the selected variation's first_user_message_template.
|
|
33
|
+
sig { returns(T.nilable(String)) }
|
|
34
|
+
attr_reader :first_user_message
|
|
34
35
|
|
|
35
|
-
sig { params(
|
|
36
|
-
attr_writer :
|
|
36
|
+
sig { params(first_user_message: String).void }
|
|
37
|
+
attr_writer :first_user_message
|
|
37
38
|
|
|
38
|
-
# Optional
|
|
39
|
-
#
|
|
40
|
-
#
|
|
41
|
-
sig { returns(T.nilable(
|
|
42
|
-
attr_reader :
|
|
39
|
+
# Optional data rendered into the variation's first_user_message_template when
|
|
40
|
+
# each fired objective is created. Separate from `system_prompt_data`, which
|
|
41
|
+
# renders the system prompt template.
|
|
42
|
+
sig { returns(T.nilable(T.anything)) }
|
|
43
|
+
attr_reader :first_user_message_data
|
|
43
44
|
|
|
44
|
-
sig { params(
|
|
45
|
-
attr_writer :
|
|
45
|
+
sig { params(first_user_message_data: T.anything).void }
|
|
46
|
+
attr_writer :first_user_message_data
|
|
46
47
|
|
|
47
48
|
# What to do when the previous run is still in flight. Defaults to SKIP.
|
|
48
49
|
sig do
|
|
@@ -62,14 +63,14 @@ module Cadenya
|
|
|
62
63
|
end
|
|
63
64
|
attr_writer :overlap_policy
|
|
64
65
|
|
|
65
|
-
# Optional data rendered into the variation's
|
|
66
|
-
# fired objective is created.
|
|
67
|
-
#
|
|
66
|
+
# Optional data rendered into the variation's system_prompt_template when each
|
|
67
|
+
# fired objective is created. If the agent has a system_prompt_data_schema, this
|
|
68
|
+
# must satisfy it.
|
|
68
69
|
sig { returns(T.nilable(T.anything)) }
|
|
69
|
-
attr_reader :
|
|
70
|
+
attr_reader :system_prompt_data
|
|
70
71
|
|
|
71
|
-
sig { params(
|
|
72
|
-
attr_writer :
|
|
72
|
+
sig { params(system_prompt_data: T.anything).void }
|
|
73
|
+
attr_writer :system_prompt_data
|
|
73
74
|
|
|
74
75
|
# Optional explicit variation. When unset, the agent's variation_selection_mode
|
|
75
76
|
# chooses per fire.
|
|
@@ -83,11 +84,11 @@ module Cadenya
|
|
|
83
84
|
sig do
|
|
84
85
|
params(
|
|
85
86
|
schedule: Cadenya::Agents::AgentScheduleSpecSchedule::OrHash,
|
|
86
|
-
|
|
87
|
-
|
|
87
|
+
first_user_message: String,
|
|
88
|
+
first_user_message_data: T.anything,
|
|
88
89
|
overlap_policy:
|
|
89
90
|
Cadenya::Agents::AgentScheduleSpec::OverlapPolicy::OrSymbol,
|
|
90
|
-
|
|
91
|
+
system_prompt_data: T.anything,
|
|
91
92
|
variation_id: String
|
|
92
93
|
).returns(T.attached_class)
|
|
93
94
|
end
|
|
@@ -96,19 +97,20 @@ module Cadenya
|
|
|
96
97
|
# of calendar rules (wall-clock) and/or interval rules (duration), OR'd together.
|
|
97
98
|
# At least one rule is required.
|
|
98
99
|
schedule:,
|
|
99
|
-
# Optional
|
|
100
|
-
#
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
#
|
|
104
|
-
# objective
|
|
105
|
-
|
|
100
|
+
# Optional explicit first user message passed to CreateObjective on each fire.
|
|
101
|
+
# Becomes the first user message in the objective's chat history. When unset, the
|
|
102
|
+
# fired objective defers to the selected variation's first_user_message_template.
|
|
103
|
+
first_user_message: nil,
|
|
104
|
+
# Optional data rendered into the variation's first_user_message_template when
|
|
105
|
+
# each fired objective is created. Separate from `system_prompt_data`, which
|
|
106
|
+
# renders the system prompt template.
|
|
107
|
+
first_user_message_data: nil,
|
|
106
108
|
# What to do when the previous run is still in flight. Defaults to SKIP.
|
|
107
109
|
overlap_policy: nil,
|
|
108
|
-
# Optional data rendered into the variation's
|
|
109
|
-
# fired objective is created.
|
|
110
|
-
#
|
|
111
|
-
|
|
110
|
+
# Optional data rendered into the variation's system_prompt_template when each
|
|
111
|
+
# fired objective is created. If the agent has a system_prompt_data_schema, this
|
|
112
|
+
# must satisfy it.
|
|
113
|
+
system_prompt_data: nil,
|
|
112
114
|
# Optional explicit variation. When unset, the agent's variation_selection_mode
|
|
113
115
|
# chooses per fire.
|
|
114
116
|
variation_id: nil
|
|
@@ -119,11 +121,11 @@ module Cadenya
|
|
|
119
121
|
override.returns(
|
|
120
122
|
{
|
|
121
123
|
schedule: Cadenya::Agents::AgentScheduleSpecSchedule,
|
|
122
|
-
|
|
123
|
-
|
|
124
|
+
first_user_message: String,
|
|
125
|
+
first_user_message_data: T.anything,
|
|
124
126
|
overlap_policy:
|
|
125
127
|
Cadenya::Agents::AgentScheduleSpec::OverlapPolicy::OrSymbol,
|
|
126
|
-
|
|
128
|
+
system_prompt_data: T.anything,
|
|
127
129
|
variation_id: String
|
|
128
130
|
}
|
|
129
131
|
)
|
|
@@ -51,6 +51,18 @@ module Cadenya
|
|
|
51
51
|
sig { params(description: String).void }
|
|
52
52
|
attr_writer :description
|
|
53
53
|
|
|
54
|
+
# Liquid template for the first user message of objectives using this variation.
|
|
55
|
+
# Rendered with CreateObjectiveRequest.first_user_message_data into
|
|
56
|
+
# Objective.first_user_message, the first user message in the LLM chat history.
|
|
57
|
+
# CreateObjectiveRequest.first_user_message, when set, overrides the rendered
|
|
58
|
+
# result. If neither this template nor first_user_message is present, objective
|
|
59
|
+
# creation is rejected with InvalidArgument.
|
|
60
|
+
sig { returns(T.nilable(String)) }
|
|
61
|
+
attr_reader :first_user_message_template
|
|
62
|
+
|
|
63
|
+
sig { params(first_user_message_template: String).void }
|
|
64
|
+
attr_writer :first_user_message_template
|
|
65
|
+
|
|
54
66
|
# ModelConfig defines the model configuration for a variation
|
|
55
67
|
sig do
|
|
56
68
|
returns(T.nilable(Cadenya::Agents::AgentVariationSpecModelConfig))
|
|
@@ -85,24 +97,14 @@ module Cadenya
|
|
|
85
97
|
attr_writer :progressive_discovery
|
|
86
98
|
|
|
87
99
|
# Liquid template for the system prompt of objectives using this variation.
|
|
88
|
-
# Rendered with CreateObjectiveRequest.
|
|
100
|
+
# Rendered with CreateObjectiveRequest.system_prompt_data into
|
|
101
|
+
# Objective.system_prompt.
|
|
89
102
|
sig { returns(T.nilable(String)) }
|
|
90
103
|
attr_reader :system_prompt_template
|
|
91
104
|
|
|
92
105
|
sig { params(system_prompt_template: String).void }
|
|
93
106
|
attr_writer :system_prompt_template
|
|
94
107
|
|
|
95
|
-
# Liquid template for the initial user message of objectives using this variation.
|
|
96
|
-
# Rendered with CreateObjectiveRequest.user_data and becomes the first user
|
|
97
|
-
# message in the LLM chat history. CreateObjectiveRequest.initial_message, when
|
|
98
|
-
# set, overrides the rendered result. If neither this template nor initial_message
|
|
99
|
-
# is present, objective creation is rejected with InvalidArgument.
|
|
100
|
-
sig { returns(T.nilable(String)) }
|
|
101
|
-
attr_reader :user_message_template
|
|
102
|
-
|
|
103
|
-
sig { params(user_message_template: String).void }
|
|
104
|
-
attr_writer :user_message_template
|
|
105
|
-
|
|
106
108
|
# Weight for weighted random selection (>= 0). P(v) = v.weight / sum(all_weights).
|
|
107
109
|
# Only used when the agent's variation_selection_mode is WEIGHTED. A weight of 0
|
|
108
110
|
# means never auto-selected, but can still be chosen explicitly via variation_id
|
|
@@ -120,12 +122,12 @@ module Cadenya
|
|
|
120
122
|
Cadenya::Agents::AgentVariationSpecCompactionConfig::OrHash,
|
|
121
123
|
constraints: Cadenya::Agents::AgentVariationSpecConstraints::OrHash,
|
|
122
124
|
description: String,
|
|
125
|
+
first_user_message_template: String,
|
|
123
126
|
model_config:
|
|
124
127
|
Cadenya::Agents::AgentVariationSpecModelConfig::OrHash,
|
|
125
128
|
progressive_discovery:
|
|
126
129
|
Cadenya::Agents::AgentVariationSpecProgressiveDiscovery::OrHash,
|
|
127
130
|
system_prompt_template: String,
|
|
128
|
-
user_message_template: String,
|
|
129
131
|
weight: Integer
|
|
130
132
|
).returns(T.attached_class)
|
|
131
133
|
end
|
|
@@ -137,6 +139,13 @@ module Cadenya
|
|
|
137
139
|
constraints: nil,
|
|
138
140
|
# Human-readable description of what this variation does or when it should be used
|
|
139
141
|
description: nil,
|
|
142
|
+
# Liquid template for the first user message of objectives using this variation.
|
|
143
|
+
# Rendered with CreateObjectiveRequest.first_user_message_data into
|
|
144
|
+
# Objective.first_user_message, the first user message in the LLM chat history.
|
|
145
|
+
# CreateObjectiveRequest.first_user_message, when set, overrides the rendered
|
|
146
|
+
# result. If neither this template nor first_user_message is present, objective
|
|
147
|
+
# creation is rejected with InvalidArgument.
|
|
148
|
+
first_user_message_template: nil,
|
|
140
149
|
# ModelConfig defines the model configuration for a variation
|
|
141
150
|
model_config: nil,
|
|
142
151
|
# ProgressiveDiscovery is used to indicate that the agent should automatically
|
|
@@ -146,14 +155,9 @@ module Cadenya
|
|
|
146
155
|
# and can help select the best tools for the task.
|
|
147
156
|
progressive_discovery: nil,
|
|
148
157
|
# Liquid template for the system prompt of objectives using this variation.
|
|
149
|
-
# Rendered with CreateObjectiveRequest.
|
|
158
|
+
# Rendered with CreateObjectiveRequest.system_prompt_data into
|
|
159
|
+
# Objective.system_prompt.
|
|
150
160
|
system_prompt_template: nil,
|
|
151
|
-
# Liquid template for the initial user message of objectives using this variation.
|
|
152
|
-
# Rendered with CreateObjectiveRequest.user_data and becomes the first user
|
|
153
|
-
# message in the LLM chat history. CreateObjectiveRequest.initial_message, when
|
|
154
|
-
# set, overrides the rendered result. If neither this template nor initial_message
|
|
155
|
-
# is present, objective creation is rejected with InvalidArgument.
|
|
156
|
-
user_message_template: nil,
|
|
157
161
|
# Weight for weighted random selection (>= 0). P(v) = v.weight / sum(all_weights).
|
|
158
162
|
# Only used when the agent's variation_selection_mode is WEIGHTED. A weight of 0
|
|
159
163
|
# means never auto-selected, but can still be chosen explicitly via variation_id
|
|
@@ -169,11 +173,11 @@ module Cadenya
|
|
|
169
173
|
Cadenya::Agents::AgentVariationSpecCompactionConfig,
|
|
170
174
|
constraints: Cadenya::Agents::AgentVariationSpecConstraints,
|
|
171
175
|
description: String,
|
|
176
|
+
first_user_message_template: String,
|
|
172
177
|
model_config: Cadenya::Agents::AgentVariationSpecModelConfig,
|
|
173
178
|
progressive_discovery:
|
|
174
179
|
Cadenya::Agents::AgentVariationSpecProgressiveDiscovery,
|
|
175
180
|
system_prompt_template: String,
|
|
176
|
-
user_message_template: String,
|
|
177
181
|
weight: Integer
|
|
178
182
|
}
|
|
179
183
|
)
|
|
@@ -6,10 +6,10 @@ module Cadenya
|
|
|
6
6
|
OrHash =
|
|
7
7
|
T.type_alias { T.any(Cadenya::Objective, Cadenya::Internal::AnyHash) }
|
|
8
8
|
|
|
9
|
-
# The
|
|
10
|
-
# the
|
|
9
|
+
# The first user message in the LLM chat history, either provided explicitly at
|
|
10
|
+
# creation or rendered from the variation's first_user_message_template.
|
|
11
11
|
sig { returns(String) }
|
|
12
|
-
attr_accessor :
|
|
12
|
+
attr_accessor :first_user_message
|
|
13
13
|
|
|
14
14
|
# Metadata for ephemeral operations and activities (e.g., objectives, executions,
|
|
15
15
|
# runs)
|
|
@@ -75,12 +75,12 @@ module Cadenya
|
|
|
75
75
|
sig { returns(String) }
|
|
76
76
|
attr_accessor :system_prompt
|
|
77
77
|
|
|
78
|
-
# Arbitrary data
|
|
78
|
+
# Arbitrary data rendered into the variation's first_user_message_template
|
|
79
79
|
sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
|
|
80
|
-
attr_reader :
|
|
80
|
+
attr_reader :first_user_message_data
|
|
81
81
|
|
|
82
|
-
sig { params(
|
|
83
|
-
attr_writer :
|
|
82
|
+
sig { params(first_user_message_data: T::Hash[Symbol, T.anything]).void }
|
|
83
|
+
attr_writer :first_user_message_data
|
|
84
84
|
|
|
85
85
|
# ObjectiveInfo provides read-only aggregated statistics about an objective's
|
|
86
86
|
# execution
|
|
@@ -114,12 +114,12 @@ module Cadenya
|
|
|
114
114
|
sig { params(state_message: String).void }
|
|
115
115
|
attr_writer :state_message
|
|
116
116
|
|
|
117
|
-
# Arbitrary data
|
|
117
|
+
# Arbitrary data rendered into the variation's system_prompt_template
|
|
118
118
|
sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
|
|
119
|
-
attr_reader :
|
|
119
|
+
attr_reader :system_prompt_data
|
|
120
120
|
|
|
121
|
-
sig { params(
|
|
122
|
-
attr_writer :
|
|
121
|
+
sig { params(system_prompt_data: T::Hash[Symbol, T.anything]).void }
|
|
122
|
+
attr_writer :system_prompt_data
|
|
123
123
|
|
|
124
124
|
# Objective is the data for an objective. It contains the snapshotted fields for
|
|
125
125
|
# the selected agent and variation. Secrets are returned only with their names,
|
|
@@ -127,28 +127,28 @@ module Cadenya
|
|
|
127
127
|
sig do
|
|
128
128
|
params(
|
|
129
129
|
config_snapshot: Cadenya::ObjectiveConfigSnapshot::OrHash,
|
|
130
|
-
|
|
130
|
+
first_user_message: String,
|
|
131
131
|
metadata: Cadenya::OperationMetadata::OrHash,
|
|
132
132
|
state: Cadenya::Objective::State::OrSymbol,
|
|
133
133
|
system_prompt: String,
|
|
134
|
-
data: T::Hash[Symbol, T.anything],
|
|
135
134
|
episodic_memory: Cadenya::Objective::EpisodicMemory::OrHash,
|
|
135
|
+
first_user_message_data: T::Hash[Symbol, T.anything],
|
|
136
136
|
info: Cadenya::ObjectiveInfo::OrHash,
|
|
137
137
|
memory_cascade: T::Array[Cadenya::MemoryReference::OrHash],
|
|
138
138
|
output: T::Hash[Symbol, T.anything],
|
|
139
139
|
parent_objective_id: String,
|
|
140
140
|
secrets: T::Array[Cadenya::ObjectiveSecret::OrHash],
|
|
141
141
|
state_message: String,
|
|
142
|
-
|
|
142
|
+
system_prompt_data: T::Hash[Symbol, T.anything]
|
|
143
143
|
).returns(T.attached_class)
|
|
144
144
|
end
|
|
145
145
|
def self.new(
|
|
146
146
|
# ObjectiveConfigSnapshot is the point-in-time snapshot of the agent, variation,
|
|
147
147
|
# and (when applicable) schedule that an objective was started with.
|
|
148
148
|
config_snapshot:,
|
|
149
|
-
# The
|
|
150
|
-
# the
|
|
151
|
-
|
|
149
|
+
# The first user message in the LLM chat history, either provided explicitly at
|
|
150
|
+
# creation or rendered from the variation's first_user_message_template.
|
|
151
|
+
first_user_message:,
|
|
152
152
|
# Metadata for ephemeral operations and activities (e.g., objectives, executions,
|
|
153
153
|
# runs)
|
|
154
154
|
metadata:,
|
|
@@ -156,10 +156,10 @@ module Cadenya
|
|
|
156
156
|
state:,
|
|
157
157
|
# system_prompt is read-only, derived from the selected variation's prompt
|
|
158
158
|
system_prompt:,
|
|
159
|
-
# Arbitrary data for the objective
|
|
160
|
-
data: nil,
|
|
161
159
|
# Episodic is used to configure the episodic memory for the objective
|
|
162
160
|
episodic_memory: nil,
|
|
161
|
+
# Arbitrary data rendered into the variation's first_user_message_template
|
|
162
|
+
first_user_message_data: nil,
|
|
163
163
|
# ObjectiveInfo provides read-only aggregated statistics about an objective's
|
|
164
164
|
# execution
|
|
165
165
|
info: nil,
|
|
@@ -189,8 +189,8 @@ module Cadenya
|
|
|
189
189
|
secrets: nil,
|
|
190
190
|
# Optional human-readable detail about the current state (e.g. a failure reason).
|
|
191
191
|
state_message: nil,
|
|
192
|
-
# Arbitrary data
|
|
193
|
-
|
|
192
|
+
# Arbitrary data rendered into the variation's system_prompt_template
|
|
193
|
+
system_prompt_data: nil
|
|
194
194
|
)
|
|
195
195
|
end
|
|
196
196
|
|
|
@@ -198,19 +198,19 @@ module Cadenya
|
|
|
198
198
|
override.returns(
|
|
199
199
|
{
|
|
200
200
|
config_snapshot: Cadenya::ObjectiveConfigSnapshot,
|
|
201
|
-
|
|
201
|
+
first_user_message: String,
|
|
202
202
|
metadata: Cadenya::OperationMetadata,
|
|
203
203
|
state: Cadenya::Objective::State::TaggedSymbol,
|
|
204
204
|
system_prompt: String,
|
|
205
|
-
data: T::Hash[Symbol, T.anything],
|
|
206
205
|
episodic_memory: Cadenya::Objective::EpisodicMemory,
|
|
206
|
+
first_user_message_data: T::Hash[Symbol, T.anything],
|
|
207
207
|
info: Cadenya::ObjectiveInfo,
|
|
208
208
|
memory_cascade: T::Array[Cadenya::MemoryReference],
|
|
209
209
|
output: T::Hash[Symbol, T.anything],
|
|
210
210
|
parent_objective_id: String,
|
|
211
211
|
secrets: T::Array[Cadenya::ObjectiveSecret],
|
|
212
212
|
state_message: String,
|
|
213
|
-
|
|
213
|
+
system_prompt_data: T::Hash[Symbol, T.anything]
|
|
214
214
|
}
|
|
215
215
|
)
|
|
216
216
|
end
|
|
@@ -17,10 +17,11 @@ module Cadenya
|
|
|
17
17
|
sig { returns(String) }
|
|
18
18
|
attr_accessor :agent_id
|
|
19
19
|
|
|
20
|
-
# Arbitrary data
|
|
21
|
-
#
|
|
20
|
+
# Arbitrary data rendered into the selected variation's system_prompt_template
|
|
21
|
+
# (liquid) to produce the objective's system prompt. If the agent has a
|
|
22
|
+
# system_prompt_data_schema, this must satisfy it.
|
|
22
23
|
sig { returns(T::Hash[Symbol, T.anything]) }
|
|
23
|
-
attr_accessor :
|
|
24
|
+
attr_accessor :system_prompt_data
|
|
24
25
|
|
|
25
26
|
# Episodic is used to configure the episodic memory for the objective
|
|
26
27
|
sig { returns(T.nilable(Cadenya::ObjectiveCreateParams::EpisodicMemory)) }
|
|
@@ -34,16 +35,25 @@ module Cadenya
|
|
|
34
35
|
end
|
|
35
36
|
attr_writer :episodic_memory
|
|
36
37
|
|
|
37
|
-
# Optional
|
|
38
|
-
#
|
|
39
|
-
#
|
|
40
|
-
#
|
|
38
|
+
# Optional explicit first user message for the LLM chat history. When not set, the
|
|
39
|
+
# selected variation's first_user_message_template is rendered with
|
|
40
|
+
# first_user_message_data instead. If neither this field nor a
|
|
41
|
+
# first_user_message_template is present, the request is rejected with
|
|
41
42
|
# InvalidArgument.
|
|
42
43
|
sig { returns(T.nilable(String)) }
|
|
43
|
-
attr_reader :
|
|
44
|
+
attr_reader :first_user_message
|
|
44
45
|
|
|
45
|
-
sig { params(
|
|
46
|
-
attr_writer :
|
|
46
|
+
sig { params(first_user_message: String).void }
|
|
47
|
+
attr_writer :first_user_message
|
|
48
|
+
|
|
49
|
+
# Arbitrary data rendered into the selected variation's
|
|
50
|
+
# first_user_message_template (liquid) to produce the first user message. Separate
|
|
51
|
+
# from `system_prompt_data`, which renders the system prompt template.
|
|
52
|
+
sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
|
|
53
|
+
attr_reader :first_user_message_data
|
|
54
|
+
|
|
55
|
+
sig { params(first_user_message_data: T::Hash[Symbol, T.anything]).void }
|
|
56
|
+
attr_writer :first_user_message_data
|
|
47
57
|
|
|
48
58
|
# Memory layers/entries layered over the baseline cascade inherited from the
|
|
49
59
|
# selected variation — element-level rules over inherited styles, in CSS terms.
|
|
@@ -89,15 +99,6 @@ module Cadenya
|
|
|
89
99
|
end
|
|
90
100
|
attr_writer :secrets
|
|
91
101
|
|
|
92
|
-
# Arbitrary data rendered into the selected variation's user_message_template
|
|
93
|
-
# (liquid) to produce the initial user message. Separate from `data`, which
|
|
94
|
-
# renders the system prompt template.
|
|
95
|
-
sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
|
|
96
|
-
attr_reader :user_data
|
|
97
|
-
|
|
98
|
-
sig { params(user_data: T::Hash[Symbol, T.anything]).void }
|
|
99
|
-
attr_writer :user_data
|
|
100
|
-
|
|
101
102
|
# Optional explicit variation selection. Overrides the agent's
|
|
102
103
|
# variation_selection_mode.
|
|
103
104
|
sig { returns(T.nilable(String)) }
|
|
@@ -110,14 +111,14 @@ module Cadenya
|
|
|
110
111
|
params(
|
|
111
112
|
workspace_id: String,
|
|
112
113
|
agent_id: String,
|
|
113
|
-
|
|
114
|
+
system_prompt_data: T::Hash[Symbol, T.anything],
|
|
114
115
|
episodic_memory:
|
|
115
116
|
Cadenya::ObjectiveCreateParams::EpisodicMemory::OrHash,
|
|
116
|
-
|
|
117
|
+
first_user_message: String,
|
|
118
|
+
first_user_message_data: T::Hash[Symbol, T.anything],
|
|
117
119
|
memory_cascade: T::Array[Cadenya::MemoryReference::OrHash],
|
|
118
120
|
metadata: Cadenya::CreateOperationMetadata::OrHash,
|
|
119
121
|
secrets: T::Array[Cadenya::ObjectiveCreateParams::Secret::OrHash],
|
|
120
|
-
user_data: T::Hash[Symbol, T.anything],
|
|
121
122
|
variation_id: String,
|
|
122
123
|
request_options: Cadenya::RequestOptions::OrHash
|
|
123
124
|
).returns(T.attached_class)
|
|
@@ -125,17 +126,22 @@ module Cadenya
|
|
|
125
126
|
def self.new(
|
|
126
127
|
workspace_id:,
|
|
127
128
|
agent_id:,
|
|
128
|
-
# Arbitrary data
|
|
129
|
-
#
|
|
130
|
-
|
|
129
|
+
# Arbitrary data rendered into the selected variation's system_prompt_template
|
|
130
|
+
# (liquid) to produce the objective's system prompt. If the agent has a
|
|
131
|
+
# system_prompt_data_schema, this must satisfy it.
|
|
132
|
+
system_prompt_data:,
|
|
131
133
|
# Episodic is used to configure the episodic memory for the objective
|
|
132
134
|
episodic_memory: nil,
|
|
133
|
-
# Optional
|
|
134
|
-
#
|
|
135
|
-
#
|
|
136
|
-
#
|
|
135
|
+
# Optional explicit first user message for the LLM chat history. When not set, the
|
|
136
|
+
# selected variation's first_user_message_template is rendered with
|
|
137
|
+
# first_user_message_data instead. If neither this field nor a
|
|
138
|
+
# first_user_message_template is present, the request is rejected with
|
|
137
139
|
# InvalidArgument.
|
|
138
|
-
|
|
140
|
+
first_user_message: nil,
|
|
141
|
+
# Arbitrary data rendered into the selected variation's
|
|
142
|
+
# first_user_message_template (liquid) to produce the first user message. Separate
|
|
143
|
+
# from `system_prompt_data`, which renders the system prompt template.
|
|
144
|
+
first_user_message_data: nil,
|
|
139
145
|
# Memory layers/entries layered over the baseline cascade inherited from the
|
|
140
146
|
# selected variation — element-level rules over inherited styles, in CSS terms.
|
|
141
147
|
#
|
|
@@ -157,10 +163,6 @@ module Cadenya
|
|
|
157
163
|
# Secrets that can be used in the headers for tool calls using the secret
|
|
158
164
|
# interpolation format.
|
|
159
165
|
secrets: nil,
|
|
160
|
-
# Arbitrary data rendered into the selected variation's user_message_template
|
|
161
|
-
# (liquid) to produce the initial user message. Separate from `data`, which
|
|
162
|
-
# renders the system prompt template.
|
|
163
|
-
user_data: nil,
|
|
164
166
|
# Optional explicit variation selection. Overrides the agent's
|
|
165
167
|
# variation_selection_mode.
|
|
166
168
|
variation_id: nil,
|
|
@@ -173,13 +175,13 @@ module Cadenya
|
|
|
173
175
|
{
|
|
174
176
|
workspace_id: String,
|
|
175
177
|
agent_id: String,
|
|
176
|
-
|
|
178
|
+
system_prompt_data: T::Hash[Symbol, T.anything],
|
|
177
179
|
episodic_memory: Cadenya::ObjectiveCreateParams::EpisodicMemory,
|
|
178
|
-
|
|
180
|
+
first_user_message: String,
|
|
181
|
+
first_user_message_data: T::Hash[Symbol, T.anything],
|
|
179
182
|
memory_cascade: T::Array[Cadenya::MemoryReference],
|
|
180
183
|
metadata: Cadenya::CreateOperationMetadata,
|
|
181
184
|
secrets: T::Array[Cadenya::ObjectiveCreateParams::Secret],
|
|
182
|
-
user_data: T::Hash[Symbol, T.anything],
|
|
183
185
|
variation_id: String,
|
|
184
186
|
request_options: Cadenya::RequestOptions
|
|
185
187
|
}
|
|
@@ -20,14 +20,14 @@ module Cadenya
|
|
|
20
20
|
params(
|
|
21
21
|
workspace_id: String,
|
|
22
22
|
agent_id: String,
|
|
23
|
-
|
|
23
|
+
system_prompt_data: T::Hash[Symbol, T.anything],
|
|
24
24
|
episodic_memory:
|
|
25
25
|
Cadenya::ObjectiveCreateParams::EpisodicMemory::OrHash,
|
|
26
|
-
|
|
26
|
+
first_user_message: String,
|
|
27
|
+
first_user_message_data: T::Hash[Symbol, T.anything],
|
|
27
28
|
memory_cascade: T::Array[Cadenya::MemoryReference::OrHash],
|
|
28
29
|
metadata: Cadenya::CreateOperationMetadata::OrHash,
|
|
29
30
|
secrets: T::Array[Cadenya::ObjectiveCreateParams::Secret::OrHash],
|
|
30
|
-
user_data: T::Hash[Symbol, T.anything],
|
|
31
31
|
variation_id: String,
|
|
32
32
|
request_options: Cadenya::RequestOptions::OrHash
|
|
33
33
|
).returns(Cadenya::Objective)
|
|
@@ -35,17 +35,22 @@ module Cadenya
|
|
|
35
35
|
def create(
|
|
36
36
|
workspace_id,
|
|
37
37
|
agent_id:,
|
|
38
|
-
# Arbitrary data
|
|
39
|
-
#
|
|
40
|
-
|
|
38
|
+
# Arbitrary data rendered into the selected variation's system_prompt_template
|
|
39
|
+
# (liquid) to produce the objective's system prompt. If the agent has a
|
|
40
|
+
# system_prompt_data_schema, this must satisfy it.
|
|
41
|
+
system_prompt_data:,
|
|
41
42
|
# Episodic is used to configure the episodic memory for the objective
|
|
42
43
|
episodic_memory: nil,
|
|
43
|
-
# Optional
|
|
44
|
-
#
|
|
45
|
-
#
|
|
46
|
-
#
|
|
44
|
+
# Optional explicit first user message for the LLM chat history. When not set, the
|
|
45
|
+
# selected variation's first_user_message_template is rendered with
|
|
46
|
+
# first_user_message_data instead. If neither this field nor a
|
|
47
|
+
# first_user_message_template is present, the request is rejected with
|
|
47
48
|
# InvalidArgument.
|
|
48
|
-
|
|
49
|
+
first_user_message: nil,
|
|
50
|
+
# Arbitrary data rendered into the selected variation's
|
|
51
|
+
# first_user_message_template (liquid) to produce the first user message. Separate
|
|
52
|
+
# from `system_prompt_data`, which renders the system prompt template.
|
|
53
|
+
first_user_message_data: nil,
|
|
49
54
|
# Memory layers/entries layered over the baseline cascade inherited from the
|
|
50
55
|
# selected variation — element-level rules over inherited styles, in CSS terms.
|
|
51
56
|
#
|
|
@@ -67,10 +72,6 @@ module Cadenya
|
|
|
67
72
|
# Secrets that can be used in the headers for tool calls using the secret
|
|
68
73
|
# interpolation format.
|
|
69
74
|
secrets: nil,
|
|
70
|
-
# Arbitrary data rendered into the selected variation's user_message_template
|
|
71
|
-
# (liquid) to produce the initial user message. Separate from `data`, which
|
|
72
|
-
# renders the system prompt template.
|
|
73
|
-
user_data: nil,
|
|
74
75
|
# Optional explicit variation selection. Overrides the agent's
|
|
75
76
|
# variation_selection_mode.
|
|
76
77
|
variation_id: nil,
|
|
@@ -6,8 +6,8 @@ module Cadenya
|
|
|
6
6
|
description: String,
|
|
7
7
|
enable_episodic_memory: bool,
|
|
8
8
|
episodic_memory_ttl: Integer,
|
|
9
|
-
input_data_schema: ::Hash[Symbol, top],
|
|
10
9
|
output_definition: ::Hash[Symbol, top],
|
|
10
|
+
system_prompt_data_schema: ::Hash[Symbol, top],
|
|
11
11
|
webhook_events_url: String
|
|
12
12
|
}
|
|
13
13
|
|
|
@@ -26,14 +26,16 @@ module Cadenya
|
|
|
26
26
|
|
|
27
27
|
def episodic_memory_ttl=: (Integer) -> Integer
|
|
28
28
|
|
|
29
|
-
attr_reader input_data_schema: ::Hash[Symbol, top]?
|
|
30
|
-
|
|
31
|
-
def input_data_schema=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top]
|
|
32
|
-
|
|
33
29
|
attr_reader output_definition: ::Hash[Symbol, top]?
|
|
34
30
|
|
|
35
31
|
def output_definition=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top]
|
|
36
32
|
|
|
33
|
+
attr_reader system_prompt_data_schema: ::Hash[Symbol, top]?
|
|
34
|
+
|
|
35
|
+
def system_prompt_data_schema=: (
|
|
36
|
+
::Hash[Symbol, top]
|
|
37
|
+
) -> ::Hash[Symbol, top]
|
|
38
|
+
|
|
37
39
|
attr_reader webhook_events_url: String?
|
|
38
40
|
|
|
39
41
|
def webhook_events_url=: (String) -> String
|
|
@@ -43,8 +45,8 @@ module Cadenya
|
|
|
43
45
|
?description: String,
|
|
44
46
|
?enable_episodic_memory: bool,
|
|
45
47
|
?episodic_memory_ttl: Integer,
|
|
46
|
-
?input_data_schema: ::Hash[Symbol, top],
|
|
47
48
|
?output_definition: ::Hash[Symbol, top],
|
|
49
|
+
?system_prompt_data_schema: ::Hash[Symbol, top],
|
|
48
50
|
?webhook_events_url: String
|
|
49
51
|
) -> void
|
|
50
52
|
|
|
@@ -53,8 +55,8 @@ module Cadenya
|
|
|
53
55
|
description: String,
|
|
54
56
|
enable_episodic_memory: bool,
|
|
55
57
|
episodic_memory_ttl: Integer,
|
|
56
|
-
input_data_schema: ::Hash[Symbol, top],
|
|
57
58
|
output_definition: ::Hash[Symbol, top],
|
|
59
|
+
system_prompt_data_schema: ::Hash[Symbol, top],
|
|
58
60
|
webhook_events_url: String
|
|
59
61
|
}
|
|
60
62
|
|