cadenya 0.11.0 → 0.13.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 (60) 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 +23 -1
  5. data/lib/cadenya/models/agents/agent_variation_spec.rb +1 -22
  6. data/lib/cadenya/models/memory_layer_list_params.rb +22 -1
  7. data/lib/cadenya/models/memory_layer_spec.rb +19 -1
  8. data/lib/cadenya/models/objective.rb +38 -1
  9. data/lib/cadenya/models/objective_create_params.rb +28 -1
  10. data/lib/cadenya/models/objectives/objective_tool_call_data.rb +1 -9
  11. data/lib/cadenya/models/objectives/objective_tool_call_result.rb +27 -0
  12. data/lib/cadenya/models/objectives/objective_tool_call_result_audio_block.rb +46 -0
  13. data/lib/cadenya/models/objectives/objective_tool_call_result_content_block.rb +34 -0
  14. data/lib/cadenya/models/objectives/objective_tool_call_result_image_block.rb +46 -0
  15. data/lib/cadenya/models/objectives/objective_tool_call_result_text_block.rb +21 -0
  16. data/lib/cadenya/models/objectives/objective_tool_call_with_result.rb +102 -0
  17. data/lib/cadenya/models/objectives/tool_call_retrieve_params.rb +34 -0
  18. data/lib/cadenya/models/tool_result.rb +15 -7
  19. data/lib/cadenya/resources/memory_layers.rb +10 -1
  20. data/lib/cadenya/resources/objectives/tool_calls.rb +39 -0
  21. data/lib/cadenya/resources/objectives.rb +3 -1
  22. data/lib/cadenya/version.rb +1 -1
  23. data/lib/cadenya.rb +7 -0
  24. data/rbi/cadenya/models/agent_spec.rbi +34 -0
  25. data/rbi/cadenya/models/agents/agent_variation_spec.rbi +0 -32
  26. data/rbi/cadenya/models/memory_layer_list_params.rbi +26 -0
  27. data/rbi/cadenya/models/memory_layer_spec.rbi +26 -0
  28. data/rbi/cadenya/models/objective.rbi +57 -0
  29. data/rbi/cadenya/models/objective_create_params.rbi +48 -0
  30. data/rbi/cadenya/models/objectives/objective_tool_call_data.rbi +0 -11
  31. data/rbi/cadenya/models/objectives/objective_tool_call_result.rbi +54 -0
  32. data/rbi/cadenya/models/objectives/objective_tool_call_result_audio_block.rbi +69 -0
  33. data/rbi/cadenya/models/objectives/objective_tool_call_result_content_block.rbi +90 -0
  34. data/rbi/cadenya/models/objectives/objective_tool_call_result_image_block.rbi +69 -0
  35. data/rbi/cadenya/models/objectives/objective_tool_call_result_text_block.rbi +31 -0
  36. data/rbi/cadenya/models/objectives/objective_tool_call_with_result.rbi +219 -0
  37. data/rbi/cadenya/models/objectives/tool_call_retrieve_params.rbi +58 -0
  38. data/rbi/cadenya/models/tool_result.rbi +34 -12
  39. data/rbi/cadenya/resources/memory_layers.rbi +8 -0
  40. data/rbi/cadenya/resources/objectives/tool_calls.rbi +20 -0
  41. data/rbi/cadenya/resources/objectives.rbi +4 -0
  42. data/sig/cadenya/models/agent_spec.rbs +14 -0
  43. data/sig/cadenya/models/agents/agent_variation_spec.rbs +0 -14
  44. data/sig/cadenya/models/memory_layer_list_params.rbs +14 -0
  45. data/sig/cadenya/models/memory_layer_spec.rbs +14 -0
  46. data/sig/cadenya/models/objective.rbs +25 -0
  47. data/sig/cadenya/models/objective_create_params.rbs +21 -0
  48. data/sig/cadenya/models/objectives/objective_tool_call_data.rbs +0 -7
  49. data/sig/cadenya/models/objectives/objective_tool_call_result.rbs +24 -0
  50. data/sig/cadenya/models/objectives/objective_tool_call_result_audio_block.rbs +34 -0
  51. data/sig/cadenya/models/objectives/objective_tool_call_result_content_block.rbs +46 -0
  52. data/sig/cadenya/models/objectives/objective_tool_call_result_image_block.rbs +34 -0
  53. data/sig/cadenya/models/objectives/objective_tool_call_result_text_block.rbs +17 -0
  54. data/sig/cadenya/models/objectives/objective_tool_call_with_result.rbs +91 -0
  55. data/sig/cadenya/models/objectives/tool_call_retrieve_params.rbs +34 -0
  56. data/sig/cadenya/models/tool_result.rbs +15 -9
  57. data/sig/cadenya/resources/memory_layers.rbs +2 -0
  58. data/sig/cadenya/resources/objectives/tool_calls.rbs +7 -0
  59. data/sig/cadenya/resources/objectives.rbs +1 -0
  60. metadata +23 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: eccefbddc3e445e6a54402fc8a5eba71d7cb44baa645cb15177c73fbc52978da
4
- data.tar.gz: 4e9a538a35dca88e184acac8d92e0db0dd7209346583e193d83bf6753be34ba8
3
+ metadata.gz: 9d745ee46b5834e75465c12e027582ba88c12d3ec89e31546dba9fbb952a52ae
4
+ data.tar.gz: 14109f1c53873b94aac6562a48669211f8845299f19ec8d10ff89968f2f5e862
5
5
  SHA512:
6
- metadata.gz: 10fa27a5fcd86594aa52b339718a896037884aa27323d2d668a598f5058db98930e7a1426d608e5196306946f3184785709ca3bcb0f5df846df3758fd10a4218
7
- data.tar.gz: e84213d6dd22de862fbb36859443c9eb6da7784ac5a921d3c2c11db603c104710b62aab859d3897e683a31e5ab8e6db57952a3dce3723b01308174eff93eab9c
6
+ metadata.gz: 0ee1346f5e40ac85863bfe7ea5181159a810e92a1f68c0f83e357887caa589c711aa167a03061483b82ef8d2856c7497466817b09794379fb47b3cf534be5786
7
+ data.tar.gz: 36de46a6cd4079c7f527c33c71126c54c6f74db804452e2ba90838b4bfa6a0fc03e65654b8360944653f38d05bc7da357d2f86383284f058cc74b3e490f5b90e
data/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.13.0 (2026-06-11)
4
+
5
+ Full Changelog: [v0.12.0...v0.13.0](https://github.com/cadenya/cadenya-ruby/compare/v0.12.0...v0.13.0)
6
+
7
+ ### Features
8
+
9
+ * **api:** api update ([9a5ddd6](https://github.com/cadenya/cadenya-ruby/commit/9a5ddd6a2e2628aa7a73894216112b252ca8b0ba))
10
+
11
+ ## 0.12.0 (2026-06-10)
12
+
13
+ Full Changelog: [v0.11.0...v0.12.0](https://github.com/cadenya/cadenya-ruby/compare/v0.11.0...v0.12.0)
14
+
15
+ ### Features
16
+
17
+ * **api:** api update ([8359495](https://github.com/cadenya/cadenya-ruby/commit/83594951a99af87c376c9fd775b06e65f07d3323))
18
+
3
19
  ## 0.11.0 (2026-06-10)
4
20
 
5
21
  Full Changelog: [v0.10.0...v0.11.0](https://github.com/cadenya/cadenya-ruby/compare/v0.10.0...v0.11.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.11.0"
20
+ gem "cadenya", "~> 0.13.0"
21
21
  ```
22
22
 
23
23
  <!-- x-release-please-end -->
@@ -18,6 +18,24 @@ module Cadenya
18
18
  # @return [String, nil]
19
19
  optional :description, String
20
20
 
21
+ # @!attribute enable_episodic_memory
22
+ # Enable episodic memory for objectives created for this agent. When true,
23
+ # objective creation requires an episodic_memory key and the system finds or
24
+ # creates a memory layer for that (agent, key) pair, letting the agent store and
25
+ # retrieve memories across objectives that share the key. Memory is agent-level so
26
+ # all variations of the agent share the same layers.
27
+ #
28
+ # @return [Boolean, nil]
29
+ optional :enable_episodic_memory, Cadenya::Internal::Type::Boolean, api_name: :enableEpisodicMemory
30
+
31
+ # @!attribute episodic_memory_ttl
32
+ # How long episodic memories should be retained. Each new objective slides the
33
+ # layer's expiry forward by this duration, and stored entries expire this long
34
+ # after they are written. If not set, episodic memories are retained indefinitely.
35
+ #
36
+ # @return [Integer, nil]
37
+ optional :episodic_memory_ttl, Integer, api_name: :episodicMemoryTtl
38
+
21
39
  # @!attribute input_data_schema
22
40
  # InputDataSchema is used for enforcing a data input when objectives are created.
23
41
  # This is valuable when using liquid formatting in agent variation prompts. Input
@@ -47,7 +65,7 @@ module Cadenya
47
65
  # @return [String, nil]
48
66
  optional :webhook_events_url, String, api_name: :webhookEventsUrl
49
67
 
50
- # @!method initialize(variation_selection_mode:, description: nil, input_data_schema: nil, output_definition: nil, webhook_events_url: nil)
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)
51
69
  # Some parameter documentations has been truncated, see
52
70
  # {Cadenya::Models::AgentSpec} for more details.
53
71
  #
@@ -57,6 +75,10 @@ module Cadenya
57
75
  #
58
76
  # @param description [String] Description of the agent's purpose
59
77
  #
78
+ # @param enable_episodic_memory [Boolean] Enable episodic memory for objectives created for this agent.
79
+ #
80
+ # @param episodic_memory_ttl [Integer] How long episodic memories should be retained.
81
+ #
60
82
  # @param input_data_schema [Hash{Symbol=>Object}] InputDataSchema is used for enforcing a data input when objectives are created.
61
83
  #
62
84
  # @param output_definition [Hash{Symbol=>Object}] Optional output definition for objectives created for this agent.
@@ -25,23 +25,6 @@ module Cadenya
25
25
  # @return [String, nil]
26
26
  optional :description, String
27
27
 
28
- # @!attribute enable_episodic_memory
29
- # Enable episodic memory for objectives using this variation. When true, the
30
- # system automatically creates a document namespace for each objective using the
31
- # objective's episodic_key as the external_id, allowing the agent to store and
32
- # retrieve documents specific to that episode.
33
- #
34
- # @return [Boolean, nil]
35
- optional :enable_episodic_memory, Cadenya::Internal::Type::Boolean, api_name: :enableEpisodicMemory
36
-
37
- # @!attribute episodic_memory_ttl
38
- # How long episodic memories should be retained. After this duration, episodic
39
- # document namespaces can be automatically cleaned up. If not set, episodic
40
- # memories are retained indefinitely.
41
- #
42
- # @return [Integer, nil]
43
- optional :episodic_memory_ttl, Integer, api_name: :episodicMemoryTtl
44
-
45
28
  # @!attribute model_config
46
29
  # ModelConfig defines the model configuration for a variation
47
30
  #
@@ -86,7 +69,7 @@ module Cadenya
86
69
  # @return [Integer, nil]
87
70
  optional :weight, Integer
88
71
 
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)
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)
90
73
  # Some parameter documentations has been truncated, see
91
74
  # {Cadenya::Models::Agents::AgentVariationSpec} for more details.
92
75
  #
@@ -98,10 +81,6 @@ module Cadenya
98
81
  #
99
82
  # @param description [String] Human-readable description of what this variation does or when it should be used
100
83
  #
101
- # @param enable_episodic_memory [Boolean] Enable episodic memory for objectives using this variation.
102
- #
103
- # @param episodic_memory_ttl [Integer] How long episodic memories should be retained.
104
- #
105
84
  # @param model_config [Cadenya::Models::Agents::AgentVariationSpecModelConfig] ModelConfig defines the model configuration for a variation
106
85
  #
107
86
  # @param progressive_discovery [Cadenya::Models::Agents::AgentVariationSpecProgressiveDiscovery] ProgressiveDiscovery is used to indicate that the agent should automatically dis
@@ -12,6 +12,12 @@ module Cadenya
12
12
  # @return [String]
13
13
  required :workspace_id, String
14
14
 
15
+ # @!attribute agent_id
16
+ # Filter to episodic layers belonging to this agent.
17
+ #
18
+ # @return [String, nil]
19
+ optional :agent_id, String
20
+
15
21
  # @!attribute bundle_key
16
22
  # Filter by bundle_key — return only resources owned by this bundle.
17
23
  #
@@ -24,6 +30,14 @@ module Cadenya
24
30
  # @return [String, nil]
25
31
  optional :cursor, String
26
32
 
33
+ # @!attribute episodic_key_prefix
34
+ # Filter to episodic layers whose episodic key starts with this prefix (e.g.
35
+ # "customer/" matches "customer/42" and "customer/43"). Useful for namespaced
36
+ # keys, similar to a redis key scan.
37
+ #
38
+ # @return [String, nil]
39
+ optional :episodic_key_prefix, String
40
+
27
41
  # @!attribute include_info
28
42
  # When set to true you may use more of your alloted API rate-limit
29
43
  #
@@ -60,13 +74,20 @@ module Cadenya
60
74
  # @return [Symbol, Cadenya::Models::MemoryLayerListParams::Type, nil]
61
75
  optional :type, enum: -> { Cadenya::MemoryLayerListParams::Type }
62
76
 
63
- # @!method initialize(workspace_id:, bundle_key: nil, cursor: nil, include_info: nil, limit: nil, prefix: nil, query: nil, sort_order: nil, type: nil, request_options: {})
77
+ # @!method initialize(workspace_id:, agent_id: nil, bundle_key: nil, cursor: nil, episodic_key_prefix: nil, include_info: nil, limit: nil, prefix: nil, query: nil, sort_order: nil, type: nil, request_options: {})
78
+ # Some parameter documentations has been truncated, see
79
+ # {Cadenya::Models::MemoryLayerListParams} for more details.
80
+ #
64
81
  # @param workspace_id [String]
65
82
  #
83
+ # @param agent_id [String] Filter to episodic layers belonging to this agent.
84
+ #
66
85
  # @param bundle_key [String] Filter by bundle_key — return only resources owned by this bundle.
67
86
  #
68
87
  # @param cursor [String] Pagination cursor from previous response
69
88
  #
89
+ # @param episodic_key_prefix [String] Filter to episodic layers whose episodic key starts with this prefix
90
+ #
70
91
  # @param include_info [Boolean] When set to true you may use more of your alloted API rate-limit
71
92
  #
72
93
  # @param limit [Integer] Maximum number of results to return
@@ -16,6 +16,20 @@ module Cadenya
16
16
  optional :description, String
17
17
 
18
18
  response_only do
19
+ # @!attribute agent_id
20
+ # Server-set on episodic layers: the agent this layer belongs to. Unset for
21
+ # non-episodic layers.
22
+ #
23
+ # @return [String, nil]
24
+ optional :agent_id, String, api_name: :agentId
25
+
26
+ # @!attribute episodic_key
27
+ # Server-set on episodic layers: the caller-supplied episodic key the layer was
28
+ # created for. Unset for non-episodic layers.
29
+ #
30
+ # @return [String, nil]
31
+ optional :episodic_key, String, api_name: :episodicKey
32
+
19
33
  # @!attribute expires_at
20
34
  # For layers with a finite lifetime (e.g., episodic), the time at which the layer
21
35
  # becomes eligible for cleanup. Set by the system; unset for persistent layers.
@@ -33,14 +47,18 @@ module Cadenya
33
47
  optional :system_managed, Cadenya::Internal::Type::Boolean, api_name: :systemManaged
34
48
  end
35
49
 
36
- # @!method initialize(type:, description: nil, expires_at: nil, system_managed: nil)
50
+ # @!method initialize(type:, agent_id: nil, description: nil, episodic_key: nil, expires_at: nil, system_managed: nil)
37
51
  # Some parameter documentations has been truncated, see
38
52
  # {Cadenya::Models::MemoryLayerSpec} for more details.
39
53
  #
40
54
  # @param type [Symbol, Cadenya::Models::MemoryLayerSpec::Type]
41
55
  #
56
+ # @param agent_id [String] Server-set on episodic layers: the agent this layer belongs to. Unset for
57
+ #
42
58
  # @param description [String] Human-readable description of the layer's purpose. Encouraged for
43
59
  #
60
+ # @param episodic_key [String] Server-set on episodic layers: the caller-supplied episodic key the layer
61
+ #
44
62
  # @param expires_at [Time] For layers with a finite lifetime (e.g., episodic), the time at which the
45
63
  #
46
64
  # @param system_managed [Boolean] Server-set. True for layers managed by the system (e.g., episodic layers
@@ -18,6 +18,12 @@ module Cadenya
18
18
  # @return [Cadenya::Models::OperationMetadata]
19
19
  required :metadata, -> { Cadenya::OperationMetadata }
20
20
 
21
+ # @!attribute episodic_memory
22
+ # Episodic is used to configure the episodic memory for the objective
23
+ #
24
+ # @return [Cadenya::Models::Objective::EpisodicMemory, nil]
25
+ optional :episodic_memory, -> { Cadenya::Objective::EpisodicMemory }, api_name: :episodicMemory
26
+
21
27
  # @!attribute memory_stack
22
28
  # Memory layers/entries to push onto this objective's memory stack on top of the
23
29
  # baseline stack inherited from the selected variation.
@@ -110,7 +116,7 @@ module Cadenya
110
116
  api_name: :userData
111
117
  end
112
118
 
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)
119
+ # @!method initialize(config_snapshot:, initial_message:, metadata:, state:, system_prompt:, data: nil, episodic_memory: nil, info: nil, memory_stack: nil, output: nil, parent_objective_id: nil, secrets: nil, state_message: nil, user_data: nil)
114
120
  # Some parameter documentations has been truncated, see
115
121
  # {Cadenya::Models::Objective} for more details.
116
122
  #
@@ -130,6 +136,8 @@ module Cadenya
130
136
  #
131
137
  # @param data [Hash{Symbol=>Object}] Arbitrary data for the objective
132
138
  #
139
+ # @param episodic_memory [Cadenya::Models::Objective::EpisodicMemory] Episodic is used to configure the episodic memory for the objective
140
+ #
133
141
  # @param info [Cadenya::Models::ObjectiveInfo] ObjectiveInfo provides read-only aggregated statistics about an objective's exec
134
142
  #
135
143
  # @param memory_stack [Array<Cadenya::Models::MemoryReference>] Memory layers/entries to push onto this objective's memory stack on
@@ -161,6 +169,35 @@ module Cadenya
161
169
  # @!method self.values
162
170
  # @return [Array<Symbol>]
163
171
  end
172
+
173
+ # @see Cadenya::Models::Objective#episodic_memory
174
+ class EpisodicMemory < Cadenya::Internal::Type::BaseModel
175
+ # @!attribute key
176
+ # The caller-supplied episodic key. Objectives created with the same key (for the
177
+ # same agent) share one episodic memory layer.
178
+ #
179
+ # @return [String, nil]
180
+ optional :key, String
181
+
182
+ response_only do
183
+ # @!attribute memory_layer_id
184
+ # The episodic memory layer resolved (created or reused) for this objective's key.
185
+ # Populated by the system at objective creation.
186
+ #
187
+ # @return [String, nil]
188
+ optional :memory_layer_id, String, api_name: :memoryLayerId
189
+ end
190
+
191
+ # @!method initialize(key: nil, memory_layer_id: nil)
192
+ # Some parameter documentations has been truncated, see
193
+ # {Cadenya::Models::Objective::EpisodicMemory} for more details.
194
+ #
195
+ # Episodic is used to configure the episodic memory for the objective
196
+ #
197
+ # @param key [String] The caller-supplied episodic key. Objectives created with the same key
198
+ #
199
+ # @param memory_layer_id [String] The episodic memory layer resolved (created or reused) for this
200
+ end
164
201
  end
165
202
  end
166
203
  end
@@ -24,6 +24,14 @@ module Cadenya
24
24
  # @return [Hash{Symbol=>Object}]
25
25
  required :data, Cadenya::Internal::Type::HashOf[Cadenya::Internal::Type::Unknown]
26
26
 
27
+ # @!attribute episodic_memory
28
+ # Episodic is used to configure the episodic memory for the objective
29
+ #
30
+ # @return [Cadenya::Models::ObjectiveCreateParams::EpisodicMemory, nil]
31
+ optional :episodic_memory,
32
+ -> { Cadenya::ObjectiveCreateParams::EpisodicMemory },
33
+ api_name: :episodicMemory
34
+
27
35
  # @!attribute initial_message
28
36
  # Optional override for the initial message sent to the agent. This becomes the
29
37
  # first user message in the LLM chat history. When not set, the selected
@@ -88,7 +96,7 @@ module Cadenya
88
96
  # @return [String, nil]
89
97
  optional :variation_id, String, api_name: :variationId
90
98
 
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: {})
99
+ # @!method initialize(workspace_id:, agent_id:, data:, episodic_memory: nil, initial_message: nil, memory_stack: nil, metadata: nil, secrets: nil, user_data: nil, variation_id: nil, request_options: {})
92
100
  # Some parameter documentations has been truncated, see
93
101
  # {Cadenya::Models::ObjectiveCreateParams} for more details.
94
102
  #
@@ -98,6 +106,8 @@ module Cadenya
98
106
  #
99
107
  # @param data [Hash{Symbol=>Object}] Arbitrary data for the objective. May be used in liquid templates for prompts co
100
108
  #
109
+ # @param episodic_memory [Cadenya::Models::ObjectiveCreateParams::EpisodicMemory] Episodic is used to configure the episodic memory for the objective
110
+ #
101
111
  # @param initial_message [String] Optional override for the initial message sent to the agent. This becomes the fi
102
112
  #
103
113
  # @param memory_stack [Array<Cadenya::Models::MemoryReference>] Memory layers/entries to push onto this objective's memory stack on
@@ -112,6 +122,23 @@ module Cadenya
112
122
  #
113
123
  # @param request_options [Cadenya::RequestOptions, Hash{Symbol=>Object}]
114
124
 
125
+ class EpisodicMemory < Cadenya::Internal::Type::BaseModel
126
+ # @!attribute key
127
+ # The caller-supplied episodic key. Objectives created with the same key (for the
128
+ # same agent) share one episodic memory layer.
129
+ #
130
+ # @return [String, nil]
131
+ optional :key, String
132
+
133
+ # @!method initialize(key: nil)
134
+ # Some parameter documentations has been truncated, see
135
+ # {Cadenya::Models::ObjectiveCreateParams::EpisodicMemory} for more details.
136
+ #
137
+ # Episodic is used to configure the episodic memory for the objective
138
+ #
139
+ # @param key [String] The caller-supplied episodic key. Objectives created with the same key
140
+ end
141
+
115
142
  class Secret < Cadenya::Internal::Type::BaseModel
116
143
  # @!attribute name
117
144
  #
@@ -26,12 +26,6 @@ module Cadenya
26
26
  optional :memo, String
27
27
 
28
28
  response_only do
29
- # @!attribute result
30
- # The result content returned by the tool after execution
31
- #
32
- # @return [String, nil]
33
- optional :result, String
34
-
35
29
  # @!attribute status_changed_by
36
30
  # A profile identifies a user or non-human principal (such as an API key) at the
37
31
  # account level. Profiles are account-scoped and can be granted access to multiple
@@ -41,7 +35,7 @@ module Cadenya
41
35
  optional :status_changed_by, -> { Cadenya::Profile }, api_name: :statusChangedBy
42
36
  end
43
37
 
44
- # @!method initialize(callable:, arguments: nil, memo: nil, result: nil, status_changed_by: nil)
38
+ # @!method initialize(callable:, arguments: nil, memo: nil, status_changed_by: nil)
45
39
  # Some parameter documentations has been truncated, see
46
40
  # {Cadenya::Models::Objectives::ObjectiveToolCallData} for more details.
47
41
  #
@@ -51,8 +45,6 @@ module Cadenya
51
45
  #
52
46
  # @param memo [String] A memo supplied by the reviewer when denying the tool call
53
47
  #
54
- # @param result [String] The result content returned by the tool after execution
55
- #
56
48
  # @param status_changed_by [Cadenya::Models::Profile] A profile identifies a user or non-human principal (such as an API key)
57
49
  end
58
50
  end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cadenya
4
+ module Models
5
+ module Objectives
6
+ class ObjectiveToolCallResult < Cadenya::Internal::Type::BaseModel
7
+ response_only do
8
+ # @!attribute content
9
+ #
10
+ # @return [Array<Cadenya::Models::Objectives::ObjectiveToolCallResultContentBlock>]
11
+ required :content,
12
+ -> { Cadenya::Internal::Type::ArrayOf[Cadenya::Objectives::ObjectiveToolCallResultContentBlock] }
13
+ end
14
+
15
+ # @!method initialize(content:)
16
+ # ObjectiveToolCallResult is the content a tool returned after execution. Tools
17
+ # can return multiple content blocks, and blocks can be multi-modal (text, image,
18
+ # audio). Media blocks are stored by Cadenya and served as short-lived signed URLs
19
+ # rather than inline bytes.
20
+ #
21
+ # @param content [Array<Cadenya::Models::Objectives::ObjectiveToolCallResultContentBlock>]
22
+ end
23
+ end
24
+
25
+ ObjectiveToolCallResult = Objectives::ObjectiveToolCallResult
26
+ end
27
+ end
@@ -0,0 +1,46 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cadenya
4
+ module Models
5
+ module Objectives
6
+ class ObjectiveToolCallResultAudioBlock < Cadenya::Internal::Type::BaseModel
7
+ response_only do
8
+ # @!attribute expires_at
9
+ # When the signed URL expires.
10
+ #
11
+ # @return [Time]
12
+ required :expires_at, Time, api_name: :expiresAt
13
+
14
+ # @!attribute mime_type
15
+ # IANA media type of the stored audio, e.g. audio/wav.
16
+ #
17
+ # @return [String]
18
+ required :mime_type, String, api_name: :mimeType
19
+
20
+ # @!attribute size_bytes
21
+ # Size of the stored audio in bytes.
22
+ #
23
+ # @return [String]
24
+ required :size_bytes, String, api_name: :sizeBytes
25
+
26
+ # @!attribute url
27
+ # Short-lived signed URL to download the stored audio.
28
+ #
29
+ # @return [String]
30
+ required :url, String
31
+ end
32
+
33
+ # @!method initialize(expires_at:, mime_type:, size_bytes:, url:)
34
+ # @param expires_at [Time] When the signed URL expires.
35
+ #
36
+ # @param mime_type [String] IANA media type of the stored audio, e.g. audio/wav.
37
+ #
38
+ # @param size_bytes [String] Size of the stored audio in bytes.
39
+ #
40
+ # @param url [String] Short-lived signed URL to download the stored audio.
41
+ end
42
+ end
43
+
44
+ ObjectiveToolCallResultAudioBlock = Objectives::ObjectiveToolCallResultAudioBlock
45
+ end
46
+ end
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cadenya
4
+ module Models
5
+ module Objectives
6
+ class ObjectiveToolCallResultContentBlock < Cadenya::Internal::Type::BaseModel
7
+ # @!attribute audio
8
+ #
9
+ # @return [Cadenya::Models::Objectives::ObjectiveToolCallResultAudioBlock, nil]
10
+ optional :audio, -> { Cadenya::Objectives::ObjectiveToolCallResultAudioBlock }
11
+
12
+ # @!attribute image
13
+ #
14
+ # @return [Cadenya::Models::Objectives::ObjectiveToolCallResultImageBlock, nil]
15
+ optional :image, -> { Cadenya::Objectives::ObjectiveToolCallResultImageBlock }
16
+
17
+ # @!attribute text
18
+ #
19
+ # @return [Cadenya::Models::Objectives::ObjectiveToolCallResultTextBlock, nil]
20
+ optional :text, -> { Cadenya::Objectives::ObjectiveToolCallResultTextBlock }
21
+
22
+ # @!method initialize(audio: nil, image: nil, text: nil)
23
+ # ContentBlock is a single block of tool result content. Exactly one of the
24
+ # variants is set.
25
+ #
26
+ # @param audio [Cadenya::Models::Objectives::ObjectiveToolCallResultAudioBlock]
27
+ # @param image [Cadenya::Models::Objectives::ObjectiveToolCallResultImageBlock]
28
+ # @param text [Cadenya::Models::Objectives::ObjectiveToolCallResultTextBlock]
29
+ end
30
+ end
31
+
32
+ ObjectiveToolCallResultContentBlock = Objectives::ObjectiveToolCallResultContentBlock
33
+ end
34
+ end
@@ -0,0 +1,46 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cadenya
4
+ module Models
5
+ module Objectives
6
+ class ObjectiveToolCallResultImageBlock < Cadenya::Internal::Type::BaseModel
7
+ response_only do
8
+ # @!attribute expires_at
9
+ # When the signed URL expires.
10
+ #
11
+ # @return [Time]
12
+ required :expires_at, Time, api_name: :expiresAt
13
+
14
+ # @!attribute mime_type
15
+ # IANA media type of the stored image, e.g. image/png.
16
+ #
17
+ # @return [String]
18
+ required :mime_type, String, api_name: :mimeType
19
+
20
+ # @!attribute size_bytes
21
+ # Size of the stored image in bytes.
22
+ #
23
+ # @return [String]
24
+ required :size_bytes, String, api_name: :sizeBytes
25
+
26
+ # @!attribute url
27
+ # Short-lived signed URL to download the stored image.
28
+ #
29
+ # @return [String]
30
+ required :url, String
31
+ end
32
+
33
+ # @!method initialize(expires_at:, mime_type:, size_bytes:, url:)
34
+ # @param expires_at [Time] When the signed URL expires.
35
+ #
36
+ # @param mime_type [String] IANA media type of the stored image, e.g. image/png.
37
+ #
38
+ # @param size_bytes [String] Size of the stored image in bytes.
39
+ #
40
+ # @param url [String] Short-lived signed URL to download the stored image.
41
+ end
42
+ end
43
+
44
+ ObjectiveToolCallResultImageBlock = Objectives::ObjectiveToolCallResultImageBlock
45
+ end
46
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cadenya
4
+ module Models
5
+ module Objectives
6
+ class ObjectiveToolCallResultTextBlock < Cadenya::Internal::Type::BaseModel
7
+ response_only do
8
+ # @!attribute text
9
+ #
10
+ # @return [String]
11
+ required :text, String
12
+ end
13
+
14
+ # @!method initialize(text:)
15
+ # @param text [String]
16
+ end
17
+ end
18
+
19
+ ObjectiveToolCallResultTextBlock = Objectives::ObjectiveToolCallResultTextBlock
20
+ end
21
+ end
@@ -0,0 +1,102 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cadenya
4
+ module Models
5
+ module Objectives
6
+ # @see Cadenya::Resources::Objectives::ToolCalls#retrieve
7
+ class ObjectiveToolCallWithResult < Cadenya::Internal::Type::BaseModel
8
+ # @!attribute data
9
+ #
10
+ # @return [Cadenya::Models::Objectives::ObjectiveToolCallData]
11
+ required :data, -> { Cadenya::Objectives::ObjectiveToolCallData }
12
+
13
+ # @!attribute info
14
+ #
15
+ # @return [Cadenya::Models::Objectives::ObjectiveToolCallInfo]
16
+ required :info, -> { Cadenya::Objectives::ObjectiveToolCallInfo }
17
+
18
+ # @!attribute metadata
19
+ # Metadata for ephemeral operations and activities (e.g., objectives, executions,
20
+ # runs)
21
+ #
22
+ # @return [Cadenya::Models::OperationMetadata]
23
+ required :metadata, -> { Cadenya::OperationMetadata }
24
+
25
+ # @!attribute status
26
+ # Current status of the tool call
27
+ #
28
+ # @return [Symbol, Cadenya::Models::Objectives::ObjectiveToolCallWithResult::Status]
29
+ required :status, enum: -> { Cadenya::Objectives::ObjectiveToolCallWithResult::Status }
30
+
31
+ response_only do
32
+ # @!attribute execution_status
33
+ #
34
+ # @return [Symbol, Cadenya::Models::Objectives::ObjectiveToolCallWithResult::ExecutionStatus]
35
+ required :execution_status,
36
+ enum: -> { Cadenya::Objectives::ObjectiveToolCallWithResult::ExecutionStatus },
37
+ api_name: :executionStatus
38
+
39
+ # @!attribute result
40
+ # ObjectiveToolCallResult is the content a tool returned after execution. Tools
41
+ # can return multiple content blocks, and blocks can be multi-modal (text, image,
42
+ # audio). Media blocks are stored by Cadenya and served as short-lived signed URLs
43
+ # rather than inline bytes.
44
+ #
45
+ # @return [Cadenya::Models::Objectives::ObjectiveToolCallResult, nil]
46
+ optional :result, -> { Cadenya::Objectives::ObjectiveToolCallResult }
47
+ end
48
+
49
+ # @!method initialize(data:, execution_status:, info:, metadata:, status:, result: nil)
50
+ # Some parameter documentations has been truncated, see
51
+ # {Cadenya::Models::Objectives::ObjectiveToolCallWithResult} for more details.
52
+ #
53
+ # ObjectiveToolCallWithResult is an ObjectiveToolCall plus the content the tool
54
+ # returned. Returned by GetObjectiveToolCall.
55
+ #
56
+ # @param data [Cadenya::Models::Objectives::ObjectiveToolCallData]
57
+ #
58
+ # @param execution_status [Symbol, Cadenya::Models::Objectives::ObjectiveToolCallWithResult::ExecutionStatus]
59
+ #
60
+ # @param info [Cadenya::Models::Objectives::ObjectiveToolCallInfo]
61
+ #
62
+ # @param metadata [Cadenya::Models::OperationMetadata] Metadata for ephemeral operations and activities (e.g., objectives, executions,
63
+ #
64
+ # @param status [Symbol, Cadenya::Models::Objectives::ObjectiveToolCallWithResult::Status] Current status of the tool call
65
+ #
66
+ # @param result [Cadenya::Models::Objectives::ObjectiveToolCallResult] ObjectiveToolCallResult is the content a tool returned after execution.
67
+
68
+ # @see Cadenya::Models::Objectives::ObjectiveToolCallWithResult#execution_status
69
+ module ExecutionStatus
70
+ extend Cadenya::Internal::Type::Enum
71
+
72
+ TOOL_CALL_EXECUTION_STATUS_UNSPECIFIED = :TOOL_CALL_EXECUTION_STATUS_UNSPECIFIED
73
+ TOOL_CALL_EXECUTION_STATUS_PENDING = :TOOL_CALL_EXECUTION_STATUS_PENDING
74
+ TOOL_CALL_EXECUTION_STATUS_RUNNING = :TOOL_CALL_EXECUTION_STATUS_RUNNING
75
+ TOOL_CALL_EXECUTION_STATUS_COMPLETED = :TOOL_CALL_EXECUTION_STATUS_COMPLETED
76
+ TOOL_CALL_EXECUTION_STATUS_ERRORED = :TOOL_CALL_EXECUTION_STATUS_ERRORED
77
+
78
+ # @!method self.values
79
+ # @return [Array<Symbol>]
80
+ end
81
+
82
+ # Current status of the tool call
83
+ #
84
+ # @see Cadenya::Models::Objectives::ObjectiveToolCallWithResult#status
85
+ module Status
86
+ extend Cadenya::Internal::Type::Enum
87
+
88
+ TOOL_CALL_STATUS_UNSPECIFIED = :TOOL_CALL_STATUS_UNSPECIFIED
89
+ TOOL_CALL_STATUS_AUTO_APPROVED = :TOOL_CALL_STATUS_AUTO_APPROVED
90
+ TOOL_CALL_STATUS_WAITING_FOR_APPROVAL = :TOOL_CALL_STATUS_WAITING_FOR_APPROVAL
91
+ TOOL_CALL_STATUS_APPROVED = :TOOL_CALL_STATUS_APPROVED
92
+ TOOL_CALL_STATUS_DENIED = :TOOL_CALL_STATUS_DENIED
93
+
94
+ # @!method self.values
95
+ # @return [Array<Symbol>]
96
+ end
97
+ end
98
+ end
99
+
100
+ ObjectiveToolCallWithResult = Objectives::ObjectiveToolCallWithResult
101
+ end
102
+ end