cadenya 0.28.0 → 0.30.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 (66) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +16 -0
  3. data/README.md +1 -1
  4. data/lib/cadenya/models/context_lengths.rb +87 -0
  5. data/lib/cadenya/models/objective_diagnostics.rb +50 -0
  6. data/lib/cadenya/models/objective_retrieve_diagnostics_params.rb +26 -0
  7. data/lib/cadenya/models/objective_retrieve_diagnostics_response.rb +25 -0
  8. data/lib/cadenya/models/objectives/objective_tool_call.rb +1 -0
  9. data/lib/cadenya/models/objectives/objective_tool_call_with_result.rb +1 -0
  10. data/lib/cadenya/models/objectives/set_tool_call_content_request_audio_block.rb +26 -0
  11. data/lib/cadenya/models/objectives/set_tool_call_content_request_content_block.rb +32 -0
  12. data/lib/cadenya/models/objectives/set_tool_call_content_request_image_block.rb +26 -0
  13. data/lib/cadenya/models/objectives/set_tool_call_content_request_text_block.rb +17 -0
  14. data/lib/cadenya/models/objectives/tool_call_list_params.rb +31 -1
  15. data/lib/cadenya/models/objectives/tool_call_set_content_params.rb +51 -0
  16. data/lib/cadenya/models/tool_called.rb +33 -1
  17. data/lib/cadenya/models/tool_set_adapter.rb +18 -1
  18. data/lib/cadenya/models/tool_set_adapter_bare.rb +26 -0
  19. data/lib/cadenya/models/tool_sets/config_bare.rb +14 -0
  20. data/lib/cadenya/models/tool_sets/tool_spec_config.rb +16 -1
  21. data/lib/cadenya/models.rb +8 -0
  22. data/lib/cadenya/resources/objectives/tool_calls.rb +53 -2
  23. data/lib/cadenya/resources/objectives.rb +30 -0
  24. data/lib/cadenya/version.rb +1 -1
  25. data/lib/cadenya.rb +11 -0
  26. data/rbi/cadenya/models/context_lengths.rbi +103 -0
  27. data/rbi/cadenya/models/objective_diagnostics.rbi +76 -0
  28. data/rbi/cadenya/models/objective_retrieve_diagnostics_params.rbi +46 -0
  29. data/rbi/cadenya/models/objective_retrieve_diagnostics_response.rbi +43 -0
  30. data/rbi/cadenya/models/objectives/objective_tool_call.rbi +5 -0
  31. data/rbi/cadenya/models/objectives/objective_tool_call_with_result.rbi +5 -0
  32. data/rbi/cadenya/models/objectives/set_tool_call_content_request_audio_block.rbi +40 -0
  33. data/rbi/cadenya/models/objectives/set_tool_call_content_request_content_block.rbi +89 -0
  34. data/rbi/cadenya/models/objectives/set_tool_call_content_request_image_block.rbi +40 -0
  35. data/rbi/cadenya/models/objectives/set_tool_call_content_request_text_block.rbi +28 -0
  36. data/rbi/cadenya/models/objectives/tool_call_list_params.rbi +85 -0
  37. data/rbi/cadenya/models/objectives/tool_call_set_content_params.rbi +80 -0
  38. data/rbi/cadenya/models/tool_called.rbi +55 -2
  39. data/rbi/cadenya/models/tool_set_adapter.rbi +24 -1
  40. data/rbi/cadenya/models/tool_set_adapter_bare.rbi +37 -0
  41. data/rbi/cadenya/models/tool_sets/config_bare.rbi +25 -0
  42. data/rbi/cadenya/models/tool_sets/tool_spec_config.rbi +20 -1
  43. data/rbi/cadenya/models.rbi +9 -0
  44. data/rbi/cadenya/resources/objectives/tool_calls.rbi +37 -0
  45. data/rbi/cadenya/resources/objectives.rbi +19 -0
  46. data/sig/cadenya/models/context_lengths.rbs +55 -0
  47. data/sig/cadenya/models/objective_diagnostics.rbs +30 -0
  48. data/sig/cadenya/models/objective_retrieve_diagnostics_params.rbs +28 -0
  49. data/sig/cadenya/models/objective_retrieve_diagnostics_response.rbs +14 -0
  50. data/sig/cadenya/models/objectives/objective_tool_call.rbs +2 -0
  51. data/sig/cadenya/models/objectives/objective_tool_call_with_result.rbs +2 -0
  52. data/sig/cadenya/models/objectives/set_tool_call_content_request_audio_block.rbs +18 -0
  53. data/sig/cadenya/models/objectives/set_tool_call_content_request_content_block.rbs +44 -0
  54. data/sig/cadenya/models/objectives/set_tool_call_content_request_image_block.rbs +18 -0
  55. data/sig/cadenya/models/objectives/set_tool_call_content_request_text_block.rbs +15 -0
  56. data/sig/cadenya/models/objectives/tool_call_list_params.rbs +30 -0
  57. data/sig/cadenya/models/objectives/tool_call_set_content_params.rbs +43 -0
  58. data/sig/cadenya/models/tool_called.rbs +33 -3
  59. data/sig/cadenya/models/tool_set_adapter.rbs +7 -0
  60. data/sig/cadenya/models/tool_set_adapter_bare.rbs +15 -0
  61. data/sig/cadenya/models/tool_sets/config_bare.rbs +13 -0
  62. data/sig/cadenya/models/tool_sets/tool_spec_config.rbs +9 -0
  63. data/sig/cadenya/models.rbs +8 -0
  64. data/sig/cadenya/resources/objectives/tool_calls.rbs +9 -0
  65. data/sig/cadenya/resources/objectives.rbs +6 -0
  66. metadata +35 -2
@@ -43,9 +43,12 @@ module Cadenya
43
43
  )
44
44
  end
45
45
 
46
+ # Some parameter documentations has been truncated, see
47
+ # {Cadenya::Models::Objectives::ToolCallListParams} for more details.
48
+ #
46
49
  # Lists all tool calls for an objective
47
50
  #
48
- # @overload list(objective_id, workspace_id:, cursor: nil, include_info: nil, limit: nil, status: nil, request_options: {})
51
+ # @overload list(objective_id, workspace_id:, cursor: nil, execution_status: nil, include_info: nil, limit: nil, status: nil, request_options: {})
49
52
  #
50
53
  # @param objective_id [String] Path param: The objective ID to return tool calls for
51
54
  #
@@ -53,6 +56,8 @@ module Cadenya
53
56
  #
54
57
  # @param cursor [String] Query param: Pagination cursor from previous response
55
58
  #
59
+ # @param execution_status [Symbol, Cadenya::Models::Objectives::ToolCallListParams::ExecutionStatus] Query param: Filter by tool call execution status. Useful for reverse-harness
60
+ #
56
61
  # @param include_info [Boolean] Query param: When set to true you may use more of your alloted API rate-limit
57
62
  #
58
63
  # @param limit [Integer] Query param: Maximum number of results to return
@@ -74,7 +79,7 @@ module Cadenya
74
79
  @client.request(
75
80
  method: :get,
76
81
  path: ["v1/workspaces/%1$s/objectives/%2$s/tool_calls", workspace_id, objective_id],
77
- query: query.transform_keys(include_info: "includeInfo"),
82
+ query: query.transform_keys(execution_status: "executionStatus", include_info: "includeInfo"),
78
83
  page: Cadenya::Internal::CursorPagination,
79
84
  model: Cadenya::Objectives::ObjectiveToolCall,
80
85
  options: options
@@ -166,6 +171,52 @@ module Cadenya
166
171
  )
167
172
  end
168
173
 
174
+ # Some parameter documentations has been truncated, see
175
+ # {Cadenya::Models::Objectives::ToolCallSetContentParams} for more details.
176
+ #
177
+ # For bare tool calls (tool sets with no execution adapter), sets the content an
178
+ # external API consumer supplies for the call — used for human-in-the-loop tools
179
+ # and reverse harnesses that execute tools locally and report results back.
180
+ #
181
+ # @overload set_content(tool_call_id, workspace_id:, objective_id:, content:, request_options: {})
182
+ #
183
+ # @param tool_call_id [String] Path param: The ID of the tool call to set content for
184
+ #
185
+ # @param workspace_id [String] Path param
186
+ #
187
+ # @param objective_id [String] Path param: The ID of the objective. Supports "external_id:" prefix for external
188
+ #
189
+ # @param content [Array<Cadenya::Models::Objectives::SetToolCallContentRequestContentBlock>] Body param: The content to set on the tool call. Mirrors
190
+ #
191
+ # @param request_options [Cadenya::RequestOptions, Hash{Symbol=>Object}, nil]
192
+ #
193
+ # @return [Cadenya::Models::Objectives::ObjectiveToolCall]
194
+ #
195
+ # @see Cadenya::Models::Objectives::ToolCallSetContentParams
196
+ def set_content(tool_call_id, params)
197
+ parsed, options = Cadenya::Objectives::ToolCallSetContentParams.dump_request(params)
198
+ workspace_id =
199
+ parsed.delete(:workspace_id) do
200
+ raise ArgumentError.new("missing required path argument #{_1}")
201
+ end
202
+ objective_id =
203
+ parsed.delete(:objective_id) do
204
+ raise ArgumentError.new("missing required path argument #{_1}")
205
+ end
206
+ @client.request(
207
+ method: :post,
208
+ path: [
209
+ "v1/workspaces/%1$s/objectives/%2$s/tool_calls/%3$s:setContent",
210
+ workspace_id,
211
+ objective_id,
212
+ tool_call_id
213
+ ],
214
+ body: parsed,
215
+ model: Cadenya::Objectives::ObjectiveToolCall,
216
+ options: options
217
+ )
218
+ end
219
+
169
220
  # @api private
170
221
  #
171
222
  # @param client [Cadenya::Client]
@@ -322,6 +322,36 @@ module Cadenya
322
322
  )
323
323
  end
324
324
 
325
+ # Returns the context-usage breakdown measured for the objective's most recent
326
+ # iteration: character lengths per context component (system prompt, memory
327
+ # appendices, tool definitions, messages by role) alongside the iteration's input
328
+ # token counts.
329
+ #
330
+ # @overload retrieve_diagnostics(objective_id, workspace_id:, request_options: {})
331
+ #
332
+ # @param objective_id [String] The ID of the objective. Supports "external_id:" prefix for external IDs.
333
+ #
334
+ # @param workspace_id [String]
335
+ #
336
+ # @param request_options [Cadenya::RequestOptions, Hash{Symbol=>Object}, nil]
337
+ #
338
+ # @return [Cadenya::Models::ObjectiveRetrieveDiagnosticsResponse]
339
+ #
340
+ # @see Cadenya::Models::ObjectiveRetrieveDiagnosticsParams
341
+ def retrieve_diagnostics(objective_id, params)
342
+ parsed, options = Cadenya::ObjectiveRetrieveDiagnosticsParams.dump_request(params)
343
+ workspace_id =
344
+ parsed.delete(:workspace_id) do
345
+ raise ArgumentError.new("missing required path argument #{_1}")
346
+ end
347
+ @client.request(
348
+ method: :get,
349
+ path: ["v1/workspaces/%1$s/objectives/%2$s/diagnostics", workspace_id, objective_id],
350
+ model: Cadenya::Models::ObjectiveRetrieveDiagnosticsResponse,
351
+ options: options
352
+ )
353
+ end
354
+
325
355
  # Streams events for an objective in real-time using server-sent events (SSE)
326
356
  #
327
357
  # @overload stream_events_streaming(objective_id, workspace_id:, request_options: {})
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Cadenya
4
- VERSION = "0.28.0"
4
+ VERSION = "0.30.0"
5
5
  end
data/lib/cadenya.rb CHANGED
@@ -140,6 +140,7 @@ require_relative "cadenya/models/assistant_tool_call"
140
140
  require_relative "cadenya/models/attribute_filter"
141
141
  require_relative "cadenya/models/bare_metadata"
142
142
  require_relative "cadenya/models/callable_tool"
143
+ require_relative "cadenya/models/context_lengths"
143
144
  require_relative "cadenya/models/context_window_compacted"
144
145
  require_relative "cadenya/models/create_operation_metadata"
145
146
  require_relative "cadenya/models/create_resource_metadata"
@@ -181,6 +182,7 @@ require_relative "cadenya/models/objective_context_window"
181
182
  require_relative "cadenya/models/objective_context_window_data"
182
183
  require_relative "cadenya/models/objective_continue_params"
183
184
  require_relative "cadenya/models/objective_create_params"
185
+ require_relative "cadenya/models/objective_diagnostics"
184
186
  require_relative "cadenya/models/objective_error"
185
187
  require_relative "cadenya/models/objective_event"
186
188
  require_relative "cadenya/models/objective_event_data"
@@ -190,6 +192,8 @@ require_relative "cadenya/models/objective_info"
190
192
  require_relative "cadenya/models/objective_list_context_windows_params"
191
193
  require_relative "cadenya/models/objective_list_events_params"
192
194
  require_relative "cadenya/models/objective_list_params"
195
+ require_relative "cadenya/models/objective_retrieve_diagnostics_params"
196
+ require_relative "cadenya/models/objective_retrieve_diagnostics_response"
193
197
  require_relative "cadenya/models/objective_retrieve_params"
194
198
  require_relative "cadenya/models/objectives/feedback_create_params"
195
199
  require_relative "cadenya/models/objectives/feedback_list_params"
@@ -209,12 +213,17 @@ require_relative "cadenya/models/objectives/objective_tool_call_result_image_blo
209
213
  require_relative "cadenya/models/objectives/objective_tool_call_result_text_block"
210
214
  require_relative "cadenya/models/objectives/objective_tool_call_with_result"
211
215
  require_relative "cadenya/models/objectives/resolved_secret"
216
+ require_relative "cadenya/models/objectives/set_tool_call_content_request_audio_block"
217
+ require_relative "cadenya/models/objectives/set_tool_call_content_request_content_block"
218
+ require_relative "cadenya/models/objectives/set_tool_call_content_request_image_block"
219
+ require_relative "cadenya/models/objectives/set_tool_call_content_request_text_block"
212
220
  require_relative "cadenya/models/objectives/task_list_params"
213
221
  require_relative "cadenya/models/objectives/task_retrieve_params"
214
222
  require_relative "cadenya/models/objectives/tool_call_approve_params"
215
223
  require_relative "cadenya/models/objectives/tool_call_deny_params"
216
224
  require_relative "cadenya/models/objectives/tool_call_list_params"
217
225
  require_relative "cadenya/models/objectives/tool_call_retrieve_params"
226
+ require_relative "cadenya/models/objectives/tool_call_set_content_params"
218
227
  require_relative "cadenya/models/objectives/tool_list_params"
219
228
  require_relative "cadenya/models/objective_secret"
220
229
  require_relative "cadenya/models/objective_stream_events_params"
@@ -243,6 +252,7 @@ require_relative "cadenya/models/tool_filter"
243
252
  require_relative "cadenya/models/tool_result"
244
253
  require_relative "cadenya/models/tool_set"
245
254
  require_relative "cadenya/models/tool_set_adapter"
255
+ require_relative "cadenya/models/tool_set_adapter_bare"
246
256
  require_relative "cadenya/models/tool_set_adapter_http"
247
257
  require_relative "cadenya/models/tool_set_adapter_mcp"
248
258
  require_relative "cadenya/models/tool_set_adapter_openapi"
@@ -257,6 +267,7 @@ require_relative "cadenya/models/tool_set_info"
257
267
  require_relative "cadenya/models/tool_set_list_events_params"
258
268
  require_relative "cadenya/models/tool_set_list_params"
259
269
  require_relative "cadenya/models/tool_set_retrieve_params"
270
+ require_relative "cadenya/models/tool_sets/config_bare"
260
271
  require_relative "cadenya/models/tool_sets/config_http"
261
272
  require_relative "cadenya/models/tool_sets/config_mcp"
262
273
  require_relative "cadenya/models/tool_sets/config_openapi"
@@ -0,0 +1,103 @@
1
+ # typed: strong
2
+
3
+ module Cadenya
4
+ module Models
5
+ class ContextLengths < Cadenya::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Cadenya::ContextLengths, Cadenya::Internal::AnyHash)
9
+ end
10
+
11
+ # Chat history messages with the assistant role.
12
+ sig { returns(Integer) }
13
+ attr_accessor :assistant_messages
14
+
15
+ # The discoverable/available-tools appendix attached to the system prompt.
16
+ sig { returns(Integer) }
17
+ attr_accessor :available_tools
18
+
19
+ # The episodic memory appendix attached to the system prompt.
20
+ sig { returns(Integer) }
21
+ attr_accessor :episodic_memory
22
+
23
+ # The skills memory appendix attached to the system prompt.
24
+ sig { returns(Integer) }
25
+ attr_accessor :skills_memory
26
+
27
+ # The objective's base system prompt (rendered variation template).
28
+ sig { returns(Integer) }
29
+ attr_accessor :system_prompt
30
+
31
+ # Serialized tool definitions sent with the completion request (names,
32
+ # descriptions, and JSON-schema parameters).
33
+ sig { returns(Integer) }
34
+ attr_accessor :tool_definitions
35
+
36
+ # Tool results present in the chat history.
37
+ sig { returns(Integer) }
38
+ attr_accessor :tool_results
39
+
40
+ # Chat history messages with the user role.
41
+ sig { returns(Integer) }
42
+ attr_accessor :user_messages
43
+
44
+ # ContextLengths is the measured character length of each distinct component of an
45
+ # iteration's assembled context window. Values are raw character lengths of the
46
+ # component as assembled into the request — token estimates are derived by the
47
+ # client against input_tokens (component share = component length / sum of all
48
+ # lengths).
49
+ #
50
+ # New components are added as new fields — wire-compatible; absent components read
51
+ # as 0.
52
+ sig do
53
+ params(
54
+ assistant_messages: Integer,
55
+ available_tools: Integer,
56
+ episodic_memory: Integer,
57
+ skills_memory: Integer,
58
+ system_prompt: Integer,
59
+ tool_definitions: Integer,
60
+ tool_results: Integer,
61
+ user_messages: Integer
62
+ ).returns(T.attached_class)
63
+ end
64
+ def self.new(
65
+ # Chat history messages with the assistant role.
66
+ assistant_messages:,
67
+ # The discoverable/available-tools appendix attached to the system prompt.
68
+ available_tools:,
69
+ # The episodic memory appendix attached to the system prompt.
70
+ episodic_memory:,
71
+ # The skills memory appendix attached to the system prompt.
72
+ skills_memory:,
73
+ # The objective's base system prompt (rendered variation template).
74
+ system_prompt:,
75
+ # Serialized tool definitions sent with the completion request (names,
76
+ # descriptions, and JSON-schema parameters).
77
+ tool_definitions:,
78
+ # Tool results present in the chat history.
79
+ tool_results:,
80
+ # Chat history messages with the user role.
81
+ user_messages:
82
+ )
83
+ end
84
+
85
+ sig do
86
+ override.returns(
87
+ {
88
+ assistant_messages: Integer,
89
+ available_tools: Integer,
90
+ episodic_memory: Integer,
91
+ skills_memory: Integer,
92
+ system_prompt: Integer,
93
+ tool_definitions: Integer,
94
+ tool_results: Integer,
95
+ user_messages: Integer
96
+ }
97
+ )
98
+ end
99
+ def to_hash
100
+ end
101
+ end
102
+ end
103
+ end
@@ -0,0 +1,76 @@
1
+ # typed: strong
2
+
3
+ module Cadenya
4
+ module Models
5
+ class ObjectiveDiagnostics < Cadenya::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Cadenya::ObjectiveDiagnostics, Cadenya::Internal::AnyHash)
9
+ end
10
+
11
+ # The portion of input_tokens served from the provider's prompt cache. Lets
12
+ # clients distinguish "big but cached" from "big and paid fresh every iteration".
13
+ sig { returns(Integer) }
14
+ attr_accessor :cached_input_tokens
15
+
16
+ # ContextLengths is the measured character length of each distinct component of an
17
+ # iteration's assembled context window. Values are raw character lengths of the
18
+ # component as assembled into the request — token estimates are derived by the
19
+ # client against input_tokens (component share = component length / sum of all
20
+ # lengths).
21
+ #
22
+ # New components are added as new fields — wire-compatible; absent components read
23
+ # as 0.
24
+ sig { returns(Cadenya::ContextLengths) }
25
+ attr_reader :context_lengths
26
+
27
+ sig { params(context_lengths: Cadenya::ContextLengths::OrHash).void }
28
+ attr_writer :context_lengths
29
+
30
+ # Input tokens reported by the LLM provider for the iteration's completion.
31
+ sig { returns(Integer) }
32
+ attr_accessor :input_tokens
33
+
34
+ # ObjectiveDiagnostics is the context-usage breakdown measured for a single
35
+ # iteration at request-assembly time. It reports how much of the context window
36
+ # each component occupies so tool parameters, memory cascades, and prompts can be
37
+ # tuned against real token usage.
38
+ sig do
39
+ params(
40
+ cached_input_tokens: Integer,
41
+ context_lengths: Cadenya::ContextLengths::OrHash,
42
+ input_tokens: Integer
43
+ ).returns(T.attached_class)
44
+ end
45
+ def self.new(
46
+ # The portion of input_tokens served from the provider's prompt cache. Lets
47
+ # clients distinguish "big but cached" from "big and paid fresh every iteration".
48
+ cached_input_tokens:,
49
+ # ContextLengths is the measured character length of each distinct component of an
50
+ # iteration's assembled context window. Values are raw character lengths of the
51
+ # component as assembled into the request — token estimates are derived by the
52
+ # client against input_tokens (component share = component length / sum of all
53
+ # lengths).
54
+ #
55
+ # New components are added as new fields — wire-compatible; absent components read
56
+ # as 0.
57
+ context_lengths:,
58
+ # Input tokens reported by the LLM provider for the iteration's completion.
59
+ input_tokens:
60
+ )
61
+ end
62
+
63
+ sig do
64
+ override.returns(
65
+ {
66
+ cached_input_tokens: Integer,
67
+ context_lengths: Cadenya::ContextLengths,
68
+ input_tokens: Integer
69
+ }
70
+ )
71
+ end
72
+ def to_hash
73
+ end
74
+ end
75
+ end
76
+ end
@@ -0,0 +1,46 @@
1
+ # typed: strong
2
+
3
+ module Cadenya
4
+ module Models
5
+ class ObjectiveRetrieveDiagnosticsParams < Cadenya::Internal::Type::BaseModel
6
+ extend Cadenya::Internal::Type::RequestParameters::Converter
7
+ include Cadenya::Internal::Type::RequestParameters
8
+
9
+ OrHash =
10
+ T.type_alias do
11
+ T.any(
12
+ Cadenya::ObjectiveRetrieveDiagnosticsParams,
13
+ Cadenya::Internal::AnyHash
14
+ )
15
+ end
16
+
17
+ sig { returns(String) }
18
+ attr_accessor :workspace_id
19
+
20
+ sig { returns(String) }
21
+ attr_accessor :objective_id
22
+
23
+ sig do
24
+ params(
25
+ workspace_id: String,
26
+ objective_id: String,
27
+ request_options: Cadenya::RequestOptions::OrHash
28
+ ).returns(T.attached_class)
29
+ end
30
+ def self.new(workspace_id:, objective_id:, request_options: {})
31
+ end
32
+
33
+ sig do
34
+ override.returns(
35
+ {
36
+ workspace_id: String,
37
+ objective_id: String,
38
+ request_options: Cadenya::RequestOptions
39
+ }
40
+ )
41
+ end
42
+ def to_hash
43
+ end
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,43 @@
1
+ # typed: strong
2
+
3
+ module Cadenya
4
+ module Models
5
+ class ObjectiveRetrieveDiagnosticsResponse < Cadenya::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(
9
+ Cadenya::Models::ObjectiveRetrieveDiagnosticsResponse,
10
+ Cadenya::Internal::AnyHash
11
+ )
12
+ end
13
+
14
+ # ObjectiveDiagnostics is the context-usage breakdown measured for a single
15
+ # iteration at request-assembly time. It reports how much of the context window
16
+ # each component occupies so tool parameters, memory cascades, and prompts can be
17
+ # tuned against real token usage.
18
+ sig { returns(Cadenya::ObjectiveDiagnostics) }
19
+ attr_reader :diagnostics
20
+
21
+ sig { params(diagnostics: Cadenya::ObjectiveDiagnostics::OrHash).void }
22
+ attr_writer :diagnostics
23
+
24
+ sig do
25
+ params(diagnostics: Cadenya::ObjectiveDiagnostics::OrHash).returns(
26
+ T.attached_class
27
+ )
28
+ end
29
+ def self.new(
30
+ # ObjectiveDiagnostics is the context-usage breakdown measured for a single
31
+ # iteration at request-assembly time. It reports how much of the context window
32
+ # each component occupies so tool parameters, memory cascades, and prompts can be
33
+ # tuned against real token usage.
34
+ diagnostics:
35
+ )
36
+ end
37
+
38
+ sig { override.returns({ diagnostics: Cadenya::ObjectiveDiagnostics }) }
39
+ def to_hash
40
+ end
41
+ end
42
+ end
43
+ end
@@ -129,6 +129,11 @@ module Cadenya
129
129
  :TOOL_CALL_EXECUTION_STATUS_ERRORED,
130
130
  Cadenya::Objectives::ObjectiveToolCall::ExecutionStatus::TaggedSymbol
131
131
  )
132
+ TOOL_CALL_EXECUTION_STATUS_WAITING_FOR_CONTENT =
133
+ T.let(
134
+ :TOOL_CALL_EXECUTION_STATUS_WAITING_FOR_CONTENT,
135
+ Cadenya::Objectives::ObjectiveToolCall::ExecutionStatus::TaggedSymbol
136
+ )
132
137
 
133
138
  sig do
134
139
  override.returns(
@@ -171,6 +171,11 @@ module Cadenya
171
171
  :TOOL_CALL_EXECUTION_STATUS_ERRORED,
172
172
  Cadenya::Objectives::ObjectiveToolCallWithResult::ExecutionStatus::TaggedSymbol
173
173
  )
174
+ TOOL_CALL_EXECUTION_STATUS_WAITING_FOR_CONTENT =
175
+ T.let(
176
+ :TOOL_CALL_EXECUTION_STATUS_WAITING_FOR_CONTENT,
177
+ Cadenya::Objectives::ObjectiveToolCallWithResult::ExecutionStatus::TaggedSymbol
178
+ )
174
179
 
175
180
  sig do
176
181
  override.returns(
@@ -0,0 +1,40 @@
1
+ # typed: strong
2
+
3
+ module Cadenya
4
+ module Models
5
+ module Objectives
6
+ class SetToolCallContentRequestAudioBlock < Cadenya::Internal::Type::BaseModel
7
+ OrHash =
8
+ T.type_alias do
9
+ T.any(
10
+ Cadenya::Objectives::SetToolCallContentRequestAudioBlock,
11
+ Cadenya::Internal::AnyHash
12
+ )
13
+ end
14
+
15
+ # Base64-encoded audio bytes.
16
+ sig { returns(String) }
17
+ attr_accessor :data
18
+
19
+ # IANA media type of the audio, e.g. audio/wav.
20
+ sig { returns(String) }
21
+ attr_accessor :mime_type
22
+
23
+ sig do
24
+ params(data: String, mime_type: String).returns(T.attached_class)
25
+ end
26
+ def self.new(
27
+ # Base64-encoded audio bytes.
28
+ data:,
29
+ # IANA media type of the audio, e.g. audio/wav.
30
+ mime_type:
31
+ )
32
+ end
33
+
34
+ sig { override.returns({ data: String, mime_type: String }) }
35
+ def to_hash
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,89 @@
1
+ # typed: strong
2
+
3
+ module Cadenya
4
+ module Models
5
+ module Objectives
6
+ class SetToolCallContentRequestContentBlock < Cadenya::Internal::Type::BaseModel
7
+ OrHash =
8
+ T.type_alias do
9
+ T.any(
10
+ Cadenya::Objectives::SetToolCallContentRequestContentBlock,
11
+ Cadenya::Internal::AnyHash
12
+ )
13
+ end
14
+
15
+ sig do
16
+ returns(
17
+ T.nilable(Cadenya::Objectives::SetToolCallContentRequestAudioBlock)
18
+ )
19
+ end
20
+ attr_reader :audio
21
+
22
+ sig do
23
+ params(
24
+ audio:
25
+ Cadenya::Objectives::SetToolCallContentRequestAudioBlock::OrHash
26
+ ).void
27
+ end
28
+ attr_writer :audio
29
+
30
+ sig do
31
+ returns(
32
+ T.nilable(Cadenya::Objectives::SetToolCallContentRequestImageBlock)
33
+ )
34
+ end
35
+ attr_reader :image
36
+
37
+ sig do
38
+ params(
39
+ image:
40
+ Cadenya::Objectives::SetToolCallContentRequestImageBlock::OrHash
41
+ ).void
42
+ end
43
+ attr_writer :image
44
+
45
+ sig do
46
+ returns(
47
+ T.nilable(Cadenya::Objectives::SetToolCallContentRequestTextBlock)
48
+ )
49
+ end
50
+ attr_reader :text
51
+
52
+ sig do
53
+ params(
54
+ text:
55
+ Cadenya::Objectives::SetToolCallContentRequestTextBlock::OrHash
56
+ ).void
57
+ end
58
+ attr_writer :text
59
+
60
+ # ContentBlock is a single block of tool call content supplied on input. Exactly
61
+ # one of the variants is set.
62
+ sig do
63
+ params(
64
+ audio:
65
+ Cadenya::Objectives::SetToolCallContentRequestAudioBlock::OrHash,
66
+ image:
67
+ Cadenya::Objectives::SetToolCallContentRequestImageBlock::OrHash,
68
+ text:
69
+ Cadenya::Objectives::SetToolCallContentRequestTextBlock::OrHash
70
+ ).returns(T.attached_class)
71
+ end
72
+ def self.new(audio: nil, image: nil, text: nil)
73
+ end
74
+
75
+ sig do
76
+ override.returns(
77
+ {
78
+ audio: Cadenya::Objectives::SetToolCallContentRequestAudioBlock,
79
+ image: Cadenya::Objectives::SetToolCallContentRequestImageBlock,
80
+ text: Cadenya::Objectives::SetToolCallContentRequestTextBlock
81
+ }
82
+ )
83
+ end
84
+ def to_hash
85
+ end
86
+ end
87
+ end
88
+ end
89
+ end
@@ -0,0 +1,40 @@
1
+ # typed: strong
2
+
3
+ module Cadenya
4
+ module Models
5
+ module Objectives
6
+ class SetToolCallContentRequestImageBlock < Cadenya::Internal::Type::BaseModel
7
+ OrHash =
8
+ T.type_alias do
9
+ T.any(
10
+ Cadenya::Objectives::SetToolCallContentRequestImageBlock,
11
+ Cadenya::Internal::AnyHash
12
+ )
13
+ end
14
+
15
+ # Base64-encoded image bytes.
16
+ sig { returns(String) }
17
+ attr_accessor :data
18
+
19
+ # IANA media type of the image, e.g. image/png.
20
+ sig { returns(String) }
21
+ attr_accessor :mime_type
22
+
23
+ sig do
24
+ params(data: String, mime_type: String).returns(T.attached_class)
25
+ end
26
+ def self.new(
27
+ # Base64-encoded image bytes.
28
+ data:,
29
+ # IANA media type of the image, e.g. image/png.
30
+ mime_type:
31
+ )
32
+ end
33
+
34
+ sig { override.returns({ data: String, mime_type: String }) }
35
+ def to_hash
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,28 @@
1
+ # typed: strong
2
+
3
+ module Cadenya
4
+ module Models
5
+ module Objectives
6
+ class SetToolCallContentRequestTextBlock < Cadenya::Internal::Type::BaseModel
7
+ OrHash =
8
+ T.type_alias do
9
+ T.any(
10
+ Cadenya::Objectives::SetToolCallContentRequestTextBlock,
11
+ Cadenya::Internal::AnyHash
12
+ )
13
+ end
14
+
15
+ sig { returns(String) }
16
+ attr_accessor :text
17
+
18
+ sig { params(text: String).returns(T.attached_class) }
19
+ def self.new(text:)
20
+ end
21
+
22
+ sig { override.returns({ text: String }) }
23
+ def to_hash
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end