cadenya 0.27.0 → 0.29.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.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +16 -0
  3. data/README.md +1 -1
  4. data/lib/cadenya/models/agent_spec.rb +16 -15
  5. data/lib/cadenya/models/agents/agent_schedule_spec.rb +21 -20
  6. data/lib/cadenya/models/agents/agent_variation_spec.rb +16 -14
  7. data/lib/cadenya/models/context_lengths.rb +87 -0
  8. data/lib/cadenya/models/objective.rb +18 -16
  9. data/lib/cadenya/models/objective_create_params.rb +28 -25
  10. data/lib/cadenya/models/objective_diagnostics.rb +50 -0
  11. data/lib/cadenya/models/objective_retrieve_diagnostics_params.rb +26 -0
  12. data/lib/cadenya/models/objective_retrieve_diagnostics_response.rb +25 -0
  13. data/lib/cadenya/models.rb +6 -0
  14. data/lib/cadenya/resources/objectives.rb +35 -5
  15. data/lib/cadenya/version.rb +1 -1
  16. data/lib/cadenya.rb +4 -0
  17. data/rbi/cadenya/models/agent_spec.rbi +23 -19
  18. data/rbi/cadenya/models/agents/agent_schedule_spec.rbi +38 -36
  19. data/rbi/cadenya/models/agents/agent_variation_spec.rbi +25 -21
  20. data/rbi/cadenya/models/context_lengths.rbi +103 -0
  21. data/rbi/cadenya/models/objective.rbi +24 -24
  22. data/rbi/cadenya/models/objective_create_params.rbi +39 -37
  23. data/rbi/cadenya/models/objective_diagnostics.rbi +76 -0
  24. data/rbi/cadenya/models/objective_retrieve_diagnostics_params.rbi +46 -0
  25. data/rbi/cadenya/models/objective_retrieve_diagnostics_response.rbi +43 -0
  26. data/rbi/cadenya/models.rbi +7 -0
  27. data/rbi/cadenya/resources/objectives.rbi +35 -15
  28. data/sig/cadenya/models/agent_spec.rbs +9 -7
  29. data/sig/cadenya/models/agents/agent_schedule_spec.rbs +15 -15
  30. data/sig/cadenya/models/agents/agent_variation_spec.rbs +7 -7
  31. data/sig/cadenya/models/context_lengths.rbs +55 -0
  32. data/sig/cadenya/models/objective.rbs +14 -14
  33. data/sig/cadenya/models/objective_create_params.rbs +16 -16
  34. data/sig/cadenya/models/objective_diagnostics.rbs +30 -0
  35. data/sig/cadenya/models/objective_retrieve_diagnostics_params.rbs +28 -0
  36. data/sig/cadenya/models/objective_retrieve_diagnostics_response.rbs +14 -0
  37. data/sig/cadenya/models.rbs +6 -0
  38. data/sig/cadenya/resources/objectives.rbs +9 -3
  39. metadata +14 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c6eb50e3dd9cd1e5abf056602489f69eb105ade97ee895cc3317800037f7fc38
4
- data.tar.gz: e09e1f78f5785eb72204bf9f386bcab14a520860c398976ad0924c687104ae7d
3
+ metadata.gz: d00d248c33699a4a01039ddd4d6123e9648ff8bc367c20a8e65e4885851cb60e
4
+ data.tar.gz: 81189360913ae6f04eb92b83ffdad219dade81eeb6eccb400318d39e89bc8e47
5
5
  SHA512:
6
- metadata.gz: d04c3cecc0ff18faf6f7ed78f3534212d31dc3cc232810b2d3f27e479f9c2e25cc4dc2f14cabce32bdc2e1937e00043032608400d67c2d30cde27ce315230967
7
- data.tar.gz: 52851b33c7aa1d0fcceaf8f82807900525f38074b0437c951f193ee1c0de8baadcb2624e80b840f970d0ec5220fb989b8d7c4eec07bc2a516c18e994a539ad69
6
+ metadata.gz: c276b5b5f6499525a452490dc7df6de4ffd9109a666aa712dbcbc201420a9de9ef0cfbffae86174836e055bc31272a72303de43aa6c0ceb4c1de9123f4531ab3
7
+ data.tar.gz: c2f2abd24fa38008337bda2931e8c27e9e39ca1412a9a523ae3d678766e62f58a855de3373a533e4c9733b327ae40286764161dd2e7ef823cf65fa99cc7b820f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.29.0 (2026-07-05)
4
+
5
+ Full Changelog: [v0.28.0...v0.29.0](https://github.com/cadenya/cadenya-ruby/compare/v0.28.0...v0.29.0)
6
+
7
+ ### Features
8
+
9
+ * **api:** api update ([e14c0d7](https://github.com/cadenya/cadenya-ruby/commit/e14c0d7509075b97bf655215eb5f266e8903b3a6))
10
+
11
+ ## 0.28.0 (2026-07-04)
12
+
13
+ Full Changelog: [v0.27.0...v0.28.0](https://github.com/cadenya/cadenya-ruby/compare/v0.27.0...v0.28.0)
14
+
15
+ ### Features
16
+
17
+ * **api:** api update ([c9dc7c5](https://github.com/cadenya/cadenya-ruby/commit/c9dc7c5f0fc9da27463add06430456abdaaa7163))
18
+
3
19
  ## 0.27.0 (2026-07-03)
4
20
 
5
21
  Full Changelog: [v0.26.0...v0.27.0](https://github.com/cadenya/cadenya-ruby/compare/v0.26.0...v0.27.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.27.0"
20
+ gem "cadenya", "~> 0.29.0"
21
21
  ```
22
22
 
23
23
  <!-- x-release-please-end -->
@@ -36,18 +36,6 @@ module Cadenya
36
36
  # @return [Integer, nil]
37
37
  optional :episodic_memory_ttl, Integer, api_name: :episodicMemoryTtl
38
38
 
39
- # @!attribute input_data_schema
40
- # InputDataSchema is used for enforcing a data input when objectives are created.
41
- # This is valuable when using liquid formatting in agent variation prompts. Input
42
- # data schema is also valuable when using an agent as a sub-agent, as the schema
43
- # is used as the tool's input parameter schema. If omitted, the sub-agent schema
44
- # will be loaded with a simple "prompt" free text string as its schema.
45
- #
46
- # @return [Hash{Symbol=>Object}, nil]
47
- optional :input_data_schema,
48
- Cadenya::Internal::Type::HashOf[Cadenya::Internal::Type::Unknown],
49
- api_name: :inputDataSchema
50
-
51
39
  # @!attribute output_definition
52
40
  # Optional output definition for objectives created for this agent. When provided,
53
41
  # Cadenya will append a tool to that will be called by the LLM in use by the
@@ -59,13 +47,26 @@ module Cadenya
59
47
  Cadenya::Internal::Type::HashOf[Cadenya::Internal::Type::Unknown],
60
48
  api_name: :outputDefinition
61
49
 
50
+ # @!attribute system_prompt_data_schema
51
+ # SystemPromptDataSchema enforces the shape of system_prompt_data when objectives
52
+ # are created. This is valuable when using liquid formatting in agent variation
53
+ # system prompt templates. The schema is also used when the agent is attached as a
54
+ # sub-agent, as it becomes the tool's input parameter schema. If omitted, the
55
+ # sub-agent schema will be loaded with a simple "prompt" free text string as its
56
+ # schema.
57
+ #
58
+ # @return [Hash{Symbol=>Object}, nil]
59
+ optional :system_prompt_data_schema,
60
+ Cadenya::Internal::Type::HashOf[Cadenya::Internal::Type::Unknown],
61
+ api_name: :systemPromptDataSchema
62
+
62
63
  # @!attribute webhook_events_url
63
64
  # The URL that Cadenya will send events for any objective assigned to the agent.
64
65
  #
65
66
  # @return [String, nil]
66
67
  optional :webhook_events_url, String, api_name: :webhookEventsUrl
67
68
 
68
- # @!method initialize(variation_selection_mode:, description: nil, enable_episodic_memory: nil, episodic_memory_ttl: nil, input_data_schema: nil, output_definition: nil, webhook_events_url: nil)
69
+ # @!method initialize(variation_selection_mode:, description: nil, enable_episodic_memory: nil, episodic_memory_ttl: nil, output_definition: nil, system_prompt_data_schema: nil, webhook_events_url: nil)
69
70
  # Some parameter documentations has been truncated, see
70
71
  # {Cadenya::Models::AgentSpec} for more details.
71
72
  #
@@ -79,10 +80,10 @@ module Cadenya
79
80
  #
80
81
  # @param episodic_memory_ttl [Integer] How long episodic memories should be retained.
81
82
  #
82
- # @param input_data_schema [Hash{Symbol=>Object}] InputDataSchema is used for enforcing a data input when objectives are created.
83
- #
84
83
  # @param output_definition [Hash{Symbol=>Object}] Optional output definition for objectives created for this agent.
85
84
  #
85
+ # @param system_prompt_data_schema [Hash{Symbol=>Object}] SystemPromptDataSchema enforces the shape of system_prompt_data when objectives
86
+ #
86
87
  # @param webhook_events_url [String] The URL that Cadenya will send events for any objective assigned to the agent.
87
88
 
88
89
  # Controls how variations are automatically selected when creating objectives
@@ -12,20 +12,21 @@ module Cadenya
12
12
  # @return [Cadenya::Models::Agents::AgentScheduleSpecSchedule]
13
13
  required :schedule, -> { Cadenya::Agents::AgentScheduleSpecSchedule }
14
14
 
15
- # @!attribute data
16
- # Optional input data passed to the objective. If the agent has an
17
- # input_data_schema, this must satisfy it.
15
+ # @!attribute first_user_message
16
+ # Optional explicit first user message passed to CreateObjective on each fire.
17
+ # Becomes the first user message in the objective's chat history. When unset, the
18
+ # fired objective defers to the selected variation's first_user_message_template.
18
19
  #
19
- # @return [Object, nil]
20
- optional :data, Cadenya::Internal::Type::Unknown
20
+ # @return [String, nil]
21
+ optional :first_user_message, String, api_name: :firstUserMessage
21
22
 
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.
23
+ # @!attribute first_user_message_data
24
+ # Optional data rendered into the variation's first_user_message_template when
25
+ # each fired objective is created. Separate from `system_prompt_data`, which
26
+ # renders the system prompt template.
26
27
  #
27
- # @return [String, nil]
28
- optional :initial_message, String, api_name: :initialMessage
28
+ # @return [Object, nil]
29
+ optional :first_user_message_data, Cadenya::Internal::Type::Unknown, api_name: :firstUserMessageData
29
30
 
30
31
  # @!attribute overlap_policy
31
32
  # What to do when the previous run is still in flight. Defaults to SKIP.
@@ -35,13 +36,13 @@ module Cadenya
35
36
  enum: -> { Cadenya::Agents::AgentScheduleSpec::OverlapPolicy },
36
37
  api_name: :overlapPolicy
37
38
 
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.
39
+ # @!attribute system_prompt_data
40
+ # Optional data rendered into the variation's system_prompt_template when each
41
+ # fired objective is created. If the agent has a system_prompt_data_schema, this
42
+ # must satisfy it.
42
43
  #
43
44
  # @return [Object, nil]
44
- optional :user_data, Cadenya::Internal::Type::Unknown, api_name: :userData
45
+ optional :system_prompt_data, Cadenya::Internal::Type::Unknown, api_name: :systemPromptData
45
46
 
46
47
  # @!attribute variation_id
47
48
  # Optional explicit variation. When unset, the agent's variation_selection_mode
@@ -50,7 +51,7 @@ module Cadenya
50
51
  # @return [String, nil]
51
52
  optional :variation_id, String, api_name: :variationId
52
53
 
53
- # @!method initialize(schedule:, data: nil, initial_message: nil, overlap_policy: nil, user_data: nil, variation_id: nil)
54
+ # @!method initialize(schedule:, first_user_message: nil, first_user_message_data: nil, overlap_policy: nil, system_prompt_data: nil, variation_id: nil)
54
55
  # Some parameter documentations has been truncated, see
55
56
  # {Cadenya::Models::Agents::AgentScheduleSpec} for more details.
56
57
  #
@@ -58,13 +59,13 @@ module Cadenya
58
59
  #
59
60
  # @param schedule [Cadenya::Models::Agents::AgentScheduleSpecSchedule] Schedule defines WHEN the schedule fires. Temporal-style structured form:
60
61
  #
61
- # @param data [Object] Optional input data passed to the objective. If the agent has an
62
+ # @param first_user_message [String] Optional explicit first user message passed to CreateObjective on each fire.
62
63
  #
63
- # @param initial_message [String] Optional initial message passed to CreateObjective on each fire. Becomes the
64
+ # @param first_user_message_data [Object] Optional data rendered into the variation's first_user_message_template when
64
65
  #
65
66
  # @param overlap_policy [Symbol, Cadenya::Models::Agents::AgentScheduleSpec::OverlapPolicy] What to do when the previous run is still in flight. Defaults to SKIP.
66
67
  #
67
- # @param user_data [Object] Optional data rendered into the variation's user_message_template when each
68
+ # @param system_prompt_data [Object] Optional data rendered into the variation's system_prompt_template when each
68
69
  #
69
70
  # @param variation_id [String] Optional explicit variation. When unset, the agent's variation_selection_mode
70
71
 
@@ -25,6 +25,17 @@ module Cadenya
25
25
  # @return [String, nil]
26
26
  optional :description, String
27
27
 
28
+ # @!attribute first_user_message_template
29
+ # Liquid template for the first user message of objectives using this variation.
30
+ # Rendered with CreateObjectiveRequest.first_user_message_data into
31
+ # Objective.first_user_message, the first user message in the LLM chat history.
32
+ # CreateObjectiveRequest.first_user_message, when set, overrides the rendered
33
+ # result. If neither this template nor first_user_message is present, objective
34
+ # creation is rejected with InvalidArgument.
35
+ #
36
+ # @return [String, nil]
37
+ optional :first_user_message_template, String, api_name: :firstUserMessageTemplate
38
+
28
39
  # @!attribute model_config
29
40
  # ModelConfig defines the model configuration for a variation
30
41
  #
@@ -45,21 +56,12 @@ module Cadenya
45
56
 
46
57
  # @!attribute system_prompt_template
47
58
  # Liquid template for the system prompt of objectives using this variation.
48
- # Rendered with CreateObjectiveRequest.data into Objective.system_prompt.
59
+ # Rendered with CreateObjectiveRequest.system_prompt_data into
60
+ # Objective.system_prompt.
49
61
  #
50
62
  # @return [String, nil]
51
63
  optional :system_prompt_template, String, api_name: :systemPromptTemplate
52
64
 
53
- # @!attribute user_message_template
54
- # Liquid template for the initial user message of objectives using this variation.
55
- # Rendered with CreateObjectiveRequest.user_data and becomes the first user
56
- # message in the LLM chat history. CreateObjectiveRequest.initial_message, when
57
- # set, overrides the rendered result. If neither this template nor initial_message
58
- # is present, objective creation is rejected with InvalidArgument.
59
- #
60
- # @return [String, nil]
61
- optional :user_message_template, String, api_name: :userMessageTemplate
62
-
63
65
  # @!attribute weight
64
66
  # Weight for weighted random selection (>= 0). P(v) = v.weight / sum(all_weights).
65
67
  # Only used when the agent's variation_selection_mode is WEIGHTED. A weight of 0
@@ -69,7 +71,7 @@ module Cadenya
69
71
  # @return [Integer, nil]
70
72
  optional :weight, Integer
71
73
 
72
- # @!method initialize(compaction_config: nil, constraints: nil, description: nil, model_config: nil, progressive_discovery: nil, system_prompt_template: nil, user_message_template: nil, weight: nil)
74
+ # @!method initialize(compaction_config: nil, constraints: nil, description: nil, first_user_message_template: nil, model_config: nil, progressive_discovery: nil, system_prompt_template: nil, weight: nil)
73
75
  # Some parameter documentations has been truncated, see
74
76
  # {Cadenya::Models::Agents::AgentVariationSpec} for more details.
75
77
  #
@@ -81,14 +83,14 @@ module Cadenya
81
83
  #
82
84
  # @param description [String] Human-readable description of what this variation does or when it should be used
83
85
  #
86
+ # @param first_user_message_template [String] Liquid template for the first user message of objectives using this variation.
87
+ #
84
88
  # @param model_config [Cadenya::Models::Agents::AgentVariationSpecModelConfig] ModelConfig defines the model configuration for a variation
85
89
  #
86
90
  # @param progressive_discovery [Cadenya::Models::Agents::AgentVariationSpecProgressiveDiscovery] ProgressiveDiscovery is used to indicate that the agent should automatically dis
87
91
  #
88
92
  # @param system_prompt_template [String] Liquid template for the system prompt of objectives using this variation.
89
93
  #
90
- # @param user_message_template [String] Liquid template for the initial user message of objectives using this variation.
91
- #
92
94
  # @param weight [Integer] Weight for weighted random selection (>= 0). P(v) = v.weight / sum(all_weights).
93
95
  end
94
96
  end
@@ -0,0 +1,87 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cadenya
4
+ module Models
5
+ class ContextLengths < Cadenya::Internal::Type::BaseModel
6
+ response_only do
7
+ # @!attribute assistant_messages
8
+ # Chat history messages with the assistant role.
9
+ #
10
+ # @return [Integer]
11
+ required :assistant_messages, Integer, api_name: :assistantMessages
12
+
13
+ # @!attribute available_tools
14
+ # The discoverable/available-tools appendix attached to the system prompt.
15
+ #
16
+ # @return [Integer]
17
+ required :available_tools, Integer, api_name: :availableTools
18
+
19
+ # @!attribute episodic_memory
20
+ # The episodic memory appendix attached to the system prompt.
21
+ #
22
+ # @return [Integer]
23
+ required :episodic_memory, Integer, api_name: :episodicMemory
24
+
25
+ # @!attribute skills_memory
26
+ # The skills memory appendix attached to the system prompt.
27
+ #
28
+ # @return [Integer]
29
+ required :skills_memory, Integer, api_name: :skillsMemory
30
+
31
+ # @!attribute system_prompt
32
+ # The objective's base system prompt (rendered variation template).
33
+ #
34
+ # @return [Integer]
35
+ required :system_prompt, Integer, api_name: :systemPrompt
36
+
37
+ # @!attribute tool_definitions
38
+ # Serialized tool definitions sent with the completion request (names,
39
+ # descriptions, and JSON-schema parameters).
40
+ #
41
+ # @return [Integer]
42
+ required :tool_definitions, Integer, api_name: :toolDefinitions
43
+
44
+ # @!attribute tool_results
45
+ # Tool results present in the chat history.
46
+ #
47
+ # @return [Integer]
48
+ required :tool_results, Integer, api_name: :toolResults
49
+
50
+ # @!attribute user_messages
51
+ # Chat history messages with the user role.
52
+ #
53
+ # @return [Integer]
54
+ required :user_messages, Integer, api_name: :userMessages
55
+ end
56
+
57
+ # @!method initialize(assistant_messages:, available_tools:, episodic_memory:, skills_memory:, system_prompt:, tool_definitions:, tool_results:, user_messages:)
58
+ # Some parameter documentations has been truncated, see
59
+ # {Cadenya::Models::ContextLengths} for more details.
60
+ #
61
+ # ContextLengths is the measured character length of each distinct component of an
62
+ # iteration's assembled context window. Values are raw character lengths of the
63
+ # component as assembled into the request — token estimates are derived by the
64
+ # client against input_tokens (component share = component length / sum of all
65
+ # lengths).
66
+ #
67
+ # New components are added as new fields — wire-compatible; absent components read
68
+ # as 0.
69
+ #
70
+ # @param assistant_messages [Integer] Chat history messages with the assistant role.
71
+ #
72
+ # @param available_tools [Integer] The discoverable/available-tools appendix attached to the system prompt.
73
+ #
74
+ # @param episodic_memory [Integer] The episodic memory appendix attached to the system prompt.
75
+ #
76
+ # @param skills_memory [Integer] The skills memory appendix attached to the system prompt.
77
+ #
78
+ # @param system_prompt [Integer] The objective's base system prompt (rendered variation template).
79
+ #
80
+ # @param tool_definitions [Integer] Serialized tool definitions sent with the completion request
81
+ #
82
+ # @param tool_results [Integer] Tool results present in the chat history.
83
+ #
84
+ # @param user_messages [Integer] Chat history messages with the user role.
85
+ end
86
+ end
87
+ end
@@ -4,12 +4,12 @@ module Cadenya
4
4
  module Models
5
5
  # @see Cadenya::Resources::Objectives#create
6
6
  class Objective < Cadenya::Internal::Type::BaseModel
7
- # @!attribute initial_message
8
- # The initial message sent to the agent. This becomes the first user message in
9
- # the LLM chat history.
7
+ # @!attribute first_user_message
8
+ # The first user message in the LLM chat history, either provided explicitly at
9
+ # creation or rendered from the variation's first_user_message_template.
10
10
  #
11
11
  # @return [String]
12
- required :initial_message, String, api_name: :initialMessage
12
+ required :first_user_message, String, api_name: :firstUserMessage
13
13
 
14
14
  # @!attribute metadata
15
15
  # Metadata for ephemeral operations and activities (e.g., objectives, executions,
@@ -71,11 +71,13 @@ module Cadenya
71
71
  # @return [String]
72
72
  required :system_prompt, String, api_name: :systemPrompt
73
73
 
74
- # @!attribute data
75
- # Arbitrary data for the objective
74
+ # @!attribute first_user_message_data
75
+ # Arbitrary data rendered into the variation's first_user_message_template
76
76
  #
77
77
  # @return [Hash{Symbol=>Object}, nil]
78
- optional :data, Cadenya::Internal::Type::HashOf[Cadenya::Internal::Type::Unknown]
78
+ optional :first_user_message_data,
79
+ Cadenya::Internal::Type::HashOf[Cadenya::Internal::Type::Unknown],
80
+ api_name: :firstUserMessageData
79
81
 
80
82
  # @!attribute info
81
83
  # ObjectiveInfo provides read-only aggregated statistics about an objective's
@@ -105,16 +107,16 @@ module Cadenya
105
107
  # @return [String, nil]
106
108
  optional :state_message, String, api_name: :stateMessage
107
109
 
108
- # @!attribute user_data
109
- # Arbitrary data used to render the variation's user_message_template
110
+ # @!attribute system_prompt_data
111
+ # Arbitrary data rendered into the variation's system_prompt_template
110
112
  #
111
113
  # @return [Hash{Symbol=>Object}, nil]
112
- optional :user_data,
114
+ optional :system_prompt_data,
113
115
  Cadenya::Internal::Type::HashOf[Cadenya::Internal::Type::Unknown],
114
- api_name: :userData
116
+ api_name: :systemPromptData
115
117
  end
116
118
 
117
- # @!method initialize(config_snapshot:, initial_message:, metadata:, state:, system_prompt:, data: nil, episodic_memory: nil, info: nil, memory_cascade: nil, output: nil, parent_objective_id: nil, secrets: nil, state_message: nil, user_data: nil)
119
+ # @!method 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)
118
120
  # Some parameter documentations has been truncated, see
119
121
  # {Cadenya::Models::Objective} for more details.
120
122
  #
@@ -124,7 +126,7 @@ module Cadenya
124
126
  #
125
127
  # @param config_snapshot [Cadenya::Models::ObjectiveConfigSnapshot] ObjectiveConfigSnapshot is the point-in-time snapshot of the agent, variation, a
126
128
  #
127
- # @param initial_message [String] The initial message sent to the agent. This becomes the first user message in th
129
+ # @param first_user_message [String] The first user message in the LLM chat history, either provided explicitly at
128
130
  #
129
131
  # @param metadata [Cadenya::Models::OperationMetadata] Metadata for ephemeral operations and activities (e.g., objectives, executions,
130
132
  #
@@ -132,10 +134,10 @@ module Cadenya
132
134
  #
133
135
  # @param system_prompt [String] system_prompt is read-only, derived from the selected variation's prompt
134
136
  #
135
- # @param data [Hash{Symbol=>Object}] Arbitrary data for the objective
136
- #
137
137
  # @param episodic_memory [Cadenya::Models::Objective::EpisodicMemory] Episodic is used to configure the episodic memory for the objective
138
138
  #
139
+ # @param first_user_message_data [Hash{Symbol=>Object}] Arbitrary data rendered into the variation's first_user_message_template
140
+ #
139
141
  # @param info [Cadenya::Models::ObjectiveInfo] ObjectiveInfo provides read-only aggregated statistics about an objective's exec
140
142
  #
141
143
  # @param memory_cascade [Array<Cadenya::Models::MemoryReference>] Memory layers/entries layered over the baseline cascade inherited
@@ -148,7 +150,7 @@ module Cadenya
148
150
  #
149
151
  # @param state_message [String] Optional human-readable detail about the current state (e.g. a failure reason).
150
152
  #
151
- # @param user_data [Hash{Symbol=>Object}] Arbitrary data used to render the variation's user_message_template
153
+ # @param system_prompt_data [Hash{Symbol=>Object}] Arbitrary data rendered into the variation's system_prompt_template
152
154
 
153
155
  # The current lifecycle state of the objective.
154
156
  #
@@ -17,12 +17,15 @@ module Cadenya
17
17
  # @return [String]
18
18
  required :agent_id, String, api_name: :agentId
19
19
 
20
- # @!attribute data
21
- # Arbitrary data for the objective. May be used in liquid templates for prompts
22
- # configured on the agent variation
20
+ # @!attribute system_prompt_data
21
+ # Arbitrary data rendered into the selected variation's system_prompt_template
22
+ # (liquid) to produce the objective's system prompt. If the agent has a
23
+ # system_prompt_data_schema, this must satisfy it.
23
24
  #
24
25
  # @return [Hash{Symbol=>Object}]
25
- required :data, Cadenya::Internal::Type::HashOf[Cadenya::Internal::Type::Unknown]
26
+ required :system_prompt_data,
27
+ Cadenya::Internal::Type::HashOf[Cadenya::Internal::Type::Unknown],
28
+ api_name: :systemPromptData
26
29
 
27
30
  # @!attribute episodic_memory
28
31
  # Episodic is used to configure the episodic memory for the objective
@@ -32,15 +35,25 @@ module Cadenya
32
35
  -> { Cadenya::ObjectiveCreateParams::EpisodicMemory },
33
36
  api_name: :episodicMemory
34
37
 
35
- # @!attribute initial_message
36
- # Optional override for the initial message sent to the agent. This becomes the
37
- # first user message in the LLM chat history. When not set, the selected
38
- # variation's user_message_template is rendered with user_data instead. If neither
39
- # this field nor a user_message_template is present, the request is rejected with
38
+ # @!attribute first_user_message
39
+ # Optional explicit first user message for the LLM chat history. When not set, the
40
+ # selected variation's first_user_message_template is rendered with
41
+ # first_user_message_data instead. If neither this field nor a
42
+ # first_user_message_template is present, the request is rejected with
40
43
  # InvalidArgument.
41
44
  #
42
45
  # @return [String, nil]
43
- optional :initial_message, String, api_name: :initialMessage
46
+ optional :first_user_message, String, api_name: :firstUserMessage
47
+
48
+ # @!attribute first_user_message_data
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
+ #
53
+ # @return [Hash{Symbol=>Object}, nil]
54
+ optional :first_user_message_data,
55
+ Cadenya::Internal::Type::HashOf[Cadenya::Internal::Type::Unknown],
56
+ api_name: :firstUserMessageData
44
57
 
45
58
  # @!attribute memory_cascade
46
59
  # Memory layers/entries layered over the baseline cascade inherited from the
@@ -77,16 +90,6 @@ module Cadenya
77
90
  # @return [Array<Cadenya::Models::ObjectiveCreateParams::Secret>, nil]
78
91
  optional :secrets, -> { Cadenya::Internal::Type::ArrayOf[Cadenya::ObjectiveCreateParams::Secret] }
79
92
 
80
- # @!attribute user_data
81
- # Arbitrary data rendered into the selected variation's user_message_template
82
- # (liquid) to produce the initial user message. Separate from `data`, which
83
- # renders the system prompt template.
84
- #
85
- # @return [Hash{Symbol=>Object}, nil]
86
- optional :user_data,
87
- Cadenya::Internal::Type::HashOf[Cadenya::Internal::Type::Unknown],
88
- api_name: :userData
89
-
90
93
  # @!attribute variation_id
91
94
  # Optional explicit variation selection. Overrides the agent's
92
95
  # variation_selection_mode.
@@ -94,7 +97,7 @@ module Cadenya
94
97
  # @return [String, nil]
95
98
  optional :variation_id, String, api_name: :variationId
96
99
 
97
- # @!method initialize(workspace_id:, agent_id:, data:, episodic_memory: nil, initial_message: nil, memory_cascade: nil, metadata: nil, secrets: nil, user_data: nil, variation_id: nil, request_options: {})
100
+ # @!method initialize(workspace_id:, agent_id:, system_prompt_data:, episodic_memory: nil, first_user_message: nil, first_user_message_data: nil, memory_cascade: nil, metadata: nil, secrets: nil, variation_id: nil, request_options: {})
98
101
  # Some parameter documentations has been truncated, see
99
102
  # {Cadenya::Models::ObjectiveCreateParams} for more details.
100
103
  #
@@ -102,11 +105,13 @@ module Cadenya
102
105
  #
103
106
  # @param agent_id [String]
104
107
  #
105
- # @param data [Hash{Symbol=>Object}] Arbitrary data for the objective. May be used in liquid templates for prompts co
108
+ # @param system_prompt_data [Hash{Symbol=>Object}] Arbitrary data rendered into the selected variation's system_prompt_template
106
109
  #
107
110
  # @param episodic_memory [Cadenya::Models::ObjectiveCreateParams::EpisodicMemory] Episodic is used to configure the episodic memory for the objective
108
111
  #
109
- # @param initial_message [String] Optional override for the initial message sent to the agent. This becomes the fi
112
+ # @param first_user_message [String] Optional explicit first user message for the LLM chat history. When not set,
113
+ #
114
+ # @param first_user_message_data [Hash{Symbol=>Object}] Arbitrary data rendered into the selected variation's first_user_message_templat
110
115
  #
111
116
  # @param memory_cascade [Array<Cadenya::Models::MemoryReference>] Memory layers/entries layered over the baseline cascade inherited
112
117
  #
@@ -114,8 +119,6 @@ module Cadenya
114
119
  #
115
120
  # @param secrets [Array<Cadenya::Models::ObjectiveCreateParams::Secret>] Secrets that can be used in the headers for tool calls using the secret interpol
116
121
  #
117
- # @param user_data [Hash{Symbol=>Object}] Arbitrary data rendered into the selected variation's user_message_template
118
- #
119
122
  # @param variation_id [String] Optional explicit variation selection. Overrides the agent's variation_selection
120
123
  #
121
124
  # @param request_options [Cadenya::RequestOptions, Hash{Symbol=>Object}]
@@ -0,0 +1,50 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cadenya
4
+ module Models
5
+ class ObjectiveDiagnostics < Cadenya::Internal::Type::BaseModel
6
+ response_only do
7
+ # @!attribute cached_input_tokens
8
+ # The portion of input_tokens served from the provider's prompt cache. Lets
9
+ # clients distinguish "big but cached" from "big and paid fresh every iteration".
10
+ #
11
+ # @return [Integer]
12
+ required :cached_input_tokens, Integer, api_name: :cachedInputTokens
13
+
14
+ # @!attribute context_lengths
15
+ # ContextLengths is the measured character length of each distinct component of an
16
+ # iteration's assembled context window. Values are raw character lengths of the
17
+ # component as assembled into the request — token estimates are derived by the
18
+ # client against input_tokens (component share = component length / sum of all
19
+ # lengths).
20
+ #
21
+ # New components are added as new fields — wire-compatible; absent components read
22
+ # as 0.
23
+ #
24
+ # @return [Cadenya::Models::ContextLengths]
25
+ required :context_lengths, -> { Cadenya::ContextLengths }, api_name: :contextLengths
26
+
27
+ # @!attribute input_tokens
28
+ # Input tokens reported by the LLM provider for the iteration's completion.
29
+ #
30
+ # @return [Integer]
31
+ required :input_tokens, Integer, api_name: :inputTokens
32
+ end
33
+
34
+ # @!method initialize(cached_input_tokens:, context_lengths:, input_tokens:)
35
+ # Some parameter documentations has been truncated, see
36
+ # {Cadenya::Models::ObjectiveDiagnostics} for more details.
37
+ #
38
+ # ObjectiveDiagnostics is the context-usage breakdown measured for a single
39
+ # iteration at request-assembly time. It reports how much of the context window
40
+ # each component occupies so tool parameters, memory cascades, and prompts can be
41
+ # tuned against real token usage.
42
+ #
43
+ # @param cached_input_tokens [Integer] The portion of input_tokens served from the provider's prompt cache.
44
+ #
45
+ # @param context_lengths [Cadenya::Models::ContextLengths] ContextLengths is the measured character length of each distinct component
46
+ #
47
+ # @param input_tokens [Integer] Input tokens reported by the LLM provider for the iteration's completion.
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cadenya
4
+ module Models
5
+ # @see Cadenya::Resources::Objectives#retrieve_diagnostics
6
+ class ObjectiveRetrieveDiagnosticsParams < Cadenya::Internal::Type::BaseModel
7
+ extend Cadenya::Internal::Type::RequestParameters::Converter
8
+ include Cadenya::Internal::Type::RequestParameters
9
+
10
+ # @!attribute workspace_id
11
+ #
12
+ # @return [String]
13
+ required :workspace_id, String
14
+
15
+ # @!attribute objective_id
16
+ #
17
+ # @return [String]
18
+ required :objective_id, String
19
+
20
+ # @!method initialize(workspace_id:, objective_id:, request_options: {})
21
+ # @param workspace_id [String]
22
+ # @param objective_id [String]
23
+ # @param request_options [Cadenya::RequestOptions, Hash{Symbol=>Object}]
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cadenya
4
+ module Models
5
+ # @see Cadenya::Resources::Objectives#retrieve_diagnostics
6
+ class ObjectiveRetrieveDiagnosticsResponse < Cadenya::Internal::Type::BaseModel
7
+ response_only do
8
+ # @!attribute diagnostics
9
+ # ObjectiveDiagnostics is the context-usage breakdown measured for a single
10
+ # iteration at request-assembly time. It reports how much of the context window
11
+ # each component occupies so tool parameters, memory cascades, and prompts can be
12
+ # tuned against real token usage.
13
+ #
14
+ # @return [Cadenya::Models::ObjectiveDiagnostics]
15
+ required :diagnostics, -> { Cadenya::ObjectiveDiagnostics }
16
+ end
17
+
18
+ # @!method initialize(diagnostics:)
19
+ # Some parameter documentations has been truncated, see
20
+ # {Cadenya::Models::ObjectiveRetrieveDiagnosticsResponse} for more details.
21
+ #
22
+ # @param diagnostics [Cadenya::Models::ObjectiveDiagnostics] ObjectiveDiagnostics is the context-usage breakdown measured for a single
23
+ end
24
+ end
25
+ end