cadenya 0.10.0 → 0.12.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 (51) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +16 -0
  3. data/README.md +1 -1
  4. data/lib/cadenya/models/agents/agent_schedule_spec.rb +21 -10
  5. data/lib/cadenya/models/agents/agent_variation_spec.rb +18 -5
  6. data/lib/cadenya/models/objective.rb +11 -1
  7. data/lib/cadenya/models/objective_create_params.rb +19 -5
  8. data/lib/cadenya/models/objectives/objective_tool_call_data.rb +1 -9
  9. data/lib/cadenya/models/objectives/objective_tool_call_result.rb +27 -0
  10. data/lib/cadenya/models/objectives/objective_tool_call_result_audio_block.rb +46 -0
  11. data/lib/cadenya/models/objectives/objective_tool_call_result_content_block.rb +34 -0
  12. data/lib/cadenya/models/objectives/objective_tool_call_result_image_block.rb +46 -0
  13. data/lib/cadenya/models/objectives/objective_tool_call_result_text_block.rb +21 -0
  14. data/lib/cadenya/models/objectives/objective_tool_call_with_result.rb +102 -0
  15. data/lib/cadenya/models/objectives/tool_call_retrieve_params.rb +34 -0
  16. data/lib/cadenya/models/tool_result.rb +15 -7
  17. data/lib/cadenya/resources/objectives/tool_calls.rb +39 -0
  18. data/lib/cadenya/resources/objectives.rb +4 -2
  19. data/lib/cadenya/version.rb +1 -1
  20. data/lib/cadenya.rb +7 -0
  21. data/rbi/cadenya/models/agents/agent_schedule_spec.rbi +30 -10
  22. data/rbi/cadenya/models/agents/agent_variation_spec.rbi +29 -8
  23. data/rbi/cadenya/models/objective.rbi +14 -3
  24. data/rbi/cadenya/models/objective_create_params.rbi +25 -6
  25. data/rbi/cadenya/models/objectives/objective_tool_call_data.rbi +0 -11
  26. data/rbi/cadenya/models/objectives/objective_tool_call_result.rbi +54 -0
  27. data/rbi/cadenya/models/objectives/objective_tool_call_result_audio_block.rbi +69 -0
  28. data/rbi/cadenya/models/objectives/objective_tool_call_result_content_block.rbi +90 -0
  29. data/rbi/cadenya/models/objectives/objective_tool_call_result_image_block.rbi +69 -0
  30. data/rbi/cadenya/models/objectives/objective_tool_call_result_text_block.rbi +31 -0
  31. data/rbi/cadenya/models/objectives/objective_tool_call_with_result.rbi +219 -0
  32. data/rbi/cadenya/models/objectives/tool_call_retrieve_params.rbi +58 -0
  33. data/rbi/cadenya/models/tool_result.rbi +34 -12
  34. data/rbi/cadenya/resources/objectives/tool_calls.rbi +20 -0
  35. data/rbi/cadenya/resources/objectives.rbi +10 -3
  36. data/sig/cadenya/models/agents/agent_schedule_spec.rbs +14 -5
  37. data/sig/cadenya/models/agents/agent_variation_spec.rbs +12 -5
  38. data/sig/cadenya/models/objective.rbs +10 -3
  39. data/sig/cadenya/models/objective_create_params.rbs +7 -0
  40. data/sig/cadenya/models/objectives/objective_tool_call_data.rbs +0 -7
  41. data/sig/cadenya/models/objectives/objective_tool_call_result.rbs +24 -0
  42. data/sig/cadenya/models/objectives/objective_tool_call_result_audio_block.rbs +34 -0
  43. data/sig/cadenya/models/objectives/objective_tool_call_result_content_block.rbs +46 -0
  44. data/sig/cadenya/models/objectives/objective_tool_call_result_image_block.rbs +34 -0
  45. data/sig/cadenya/models/objectives/objective_tool_call_result_text_block.rbs +17 -0
  46. data/sig/cadenya/models/objectives/objective_tool_call_with_result.rbs +91 -0
  47. data/sig/cadenya/models/objectives/tool_call_retrieve_params.rbs +34 -0
  48. data/sig/cadenya/models/tool_result.rbs +15 -9
  49. data/sig/cadenya/resources/objectives/tool_calls.rbs +7 -0
  50. data/sig/cadenya/resources/objectives.rbs +1 -0
  51. metadata +23 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fdbe6be38292a9c2cdb1398a82675a4b9d83e2a633479147843681b820dc21fb
4
- data.tar.gz: 26192932a4a0229f48bcbcb6bc4f1ae119351fd349eabaadafcfe746a8f3a2de
3
+ metadata.gz: cc33022d12e62f8273e8a7aa25cc2f020c231e6ce29f66775f9b144747d5658f
4
+ data.tar.gz: 619df9b5f16e896b922e1f8a1fa312f175a869154eb78a54c29a641e20f09b6b
5
5
  SHA512:
6
- metadata.gz: b68888435e7da1c39ecb5a13f8543e8aee96e07cdef1433fe1ce5d4310bfe75f114f2efd1b43f290a278ec307c0697f2ff8dfd41712bf2c080114c1afb4dbed0
7
- data.tar.gz: ab0ea603fe0175091589cb156b96129cc82a88468e627ff2232f5fb7d500b6863372f81c0ce3b12ec02d1c849b49363991334f37b22c725a404e2344ba04f049
6
+ metadata.gz: 67d08c0901b15069f74e1a8a071876d9ac7c2871f5d73c2986c28ce4b6c01fe564a3385e6bd932f018a6392094d10e3d0a860f9bcd199435cc4fb99beb3a52d4
7
+ data.tar.gz: e6bd7a52e5e2a517108f7eeb6a3902c4662ed72c4158e06da10fc0862fc9292191d479ede3e87662a6104d9a680fe62d9e05d51be0f3b15ed9015907780415f4
data/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.12.0 (2026-06-10)
4
+
5
+ Full Changelog: [v0.11.0...v0.12.0](https://github.com/cadenya/cadenya-ruby/compare/v0.11.0...v0.12.0)
6
+
7
+ ### Features
8
+
9
+ * **api:** api update ([8359495](https://github.com/cadenya/cadenya-ruby/commit/83594951a99af87c376c9fd775b06e65f07d3323))
10
+
11
+ ## 0.11.0 (2026-06-10)
12
+
13
+ Full Changelog: [v0.10.0...v0.11.0](https://github.com/cadenya/cadenya-ruby/compare/v0.10.0...v0.11.0)
14
+
15
+ ### Features
16
+
17
+ * **api:** api update ([5f00cea](https://github.com/cadenya/cadenya-ruby/commit/5f00ceaef72eb0c4ab66a2489eecb6de7ec35616))
18
+
3
19
  ## 0.10.0 (2026-06-09)
4
20
 
5
21
  Full Changelog: [v0.9.0...v0.10.0](https://github.com/cadenya/cadenya-ruby/compare/v0.9.0...v0.10.0)
data/README.md CHANGED
@@ -17,7 +17,7 @@ To use this gem, install via Bundler by adding the following to your application
17
17
  <!-- x-release-please-start-version -->
18
18
 
19
19
  ```ruby
20
- gem "cadenya", "~> 0.10.0"
20
+ gem "cadenya", "~> 0.12.0"
21
21
  ```
22
22
 
23
23
  <!-- x-release-please-end -->
@@ -4,13 +4,6 @@ module Cadenya
4
4
  module Models
5
5
  module Agents
6
6
  class AgentScheduleSpec < Cadenya::Internal::Type::BaseModel
7
- # @!attribute initial_message
8
- # The initial message passed to CreateObjective on each fire. Becomes the first
9
- # user message in the objective's chat history.
10
- #
11
- # @return [String]
12
- required :initial_message, String, api_name: :initialMessage
13
-
14
7
  # @!attribute schedule
15
8
  # Schedule defines WHEN the schedule fires. Temporal-style structured form: a list
16
9
  # of calendar rules (wall-clock) and/or interval rules (duration), OR'd together.
@@ -26,6 +19,14 @@ module Cadenya
26
19
  # @return [Object, nil]
27
20
  optional :data, Cadenya::Internal::Type::Unknown
28
21
 
22
+ # @!attribute initial_message
23
+ # Optional initial message passed to CreateObjective on each fire. Becomes the
24
+ # first user message in the objective's chat history. When unset, the fired
25
+ # objective defers to the selected variation's user_message_template.
26
+ #
27
+ # @return [String, nil]
28
+ optional :initial_message, String, api_name: :initialMessage
29
+
29
30
  # @!attribute overlap_policy
30
31
  # What to do when the previous run is still in flight. Defaults to SKIP.
31
32
  #
@@ -34,6 +35,14 @@ module Cadenya
34
35
  enum: -> { Cadenya::Agents::AgentScheduleSpec::OverlapPolicy },
35
36
  api_name: :overlapPolicy
36
37
 
38
+ # @!attribute user_data
39
+ # Optional data rendered into the variation's user_message_template when each
40
+ # fired objective is created. Separate from `data`, which renders the system
41
+ # prompt template.
42
+ #
43
+ # @return [Object, nil]
44
+ optional :user_data, Cadenya::Internal::Type::Unknown, api_name: :userData
45
+
37
46
  # @!attribute variation_id
38
47
  # Optional explicit variation. When unset, the agent's variation_selection_mode
39
48
  # chooses per fire.
@@ -41,20 +50,22 @@ module Cadenya
41
50
  # @return [String, nil]
42
51
  optional :variation_id, String, api_name: :variationId
43
52
 
44
- # @!method initialize(initial_message:, schedule:, data: nil, overlap_policy: nil, variation_id: nil)
53
+ # @!method initialize(schedule:, data: nil, initial_message: nil, overlap_policy: nil, user_data: nil, variation_id: nil)
45
54
  # Some parameter documentations has been truncated, see
46
55
  # {Cadenya::Models::Agents::AgentScheduleSpec} for more details.
47
56
  #
48
57
  # AgentScheduleSpec is the user-provided configuration for a schedule.
49
58
  #
50
- # @param initial_message [String] The initial message passed to CreateObjective on each fire. Becomes the
51
- #
52
59
  # @param schedule [Cadenya::Models::Agents::AgentScheduleSpecSchedule] Schedule defines WHEN the schedule fires. Temporal-style structured form:
53
60
  #
54
61
  # @param data [Object] Optional input data passed to the objective. If the agent has an
55
62
  #
63
+ # @param initial_message [String] Optional initial message passed to CreateObjective on each fire. Becomes the
64
+ #
56
65
  # @param overlap_policy [Symbol, Cadenya::Models::Agents::AgentScheduleSpec::OverlapPolicy] What to do when the previous run is still in flight. Defaults to SKIP.
57
66
  #
67
+ # @param user_data [Object] Optional data rendered into the variation's user_message_template when each
68
+ #
58
69
  # @param variation_id [String] Optional explicit variation. When unset, the agent's variation_selection_mode
59
70
 
60
71
  # What to do when the previous run is still in flight. Defaults to SKIP.
@@ -60,11 +60,22 @@ module Cadenya
60
60
  -> { Cadenya::Agents::AgentVariationSpecProgressiveDiscovery },
61
61
  api_name: :progressiveDiscovery
62
62
 
63
- # @!attribute prompt
64
- # The system prompt for this variation
63
+ # @!attribute system_prompt_template
64
+ # Liquid template for the system prompt of objectives using this variation.
65
+ # Rendered with CreateObjectiveRequest.data into Objective.system_prompt.
65
66
  #
66
67
  # @return [String, nil]
67
- optional :prompt, String
68
+ optional :system_prompt_template, String, api_name: :systemPromptTemplate
69
+
70
+ # @!attribute user_message_template
71
+ # Liquid template for the initial user message of objectives using this variation.
72
+ # Rendered with CreateObjectiveRequest.user_data and becomes the first user
73
+ # message in the LLM chat history. CreateObjectiveRequest.initial_message, when
74
+ # set, overrides the rendered result. If neither this template nor initial_message
75
+ # is present, objective creation is rejected with InvalidArgument.
76
+ #
77
+ # @return [String, nil]
78
+ optional :user_message_template, String, api_name: :userMessageTemplate
68
79
 
69
80
  # @!attribute weight
70
81
  # Weight for weighted random selection (>= 0). P(v) = v.weight / sum(all_weights).
@@ -75,7 +86,7 @@ module Cadenya
75
86
  # @return [Integer, nil]
76
87
  optional :weight, Integer
77
88
 
78
- # @!method initialize(compaction_config: nil, constraints: nil, description: nil, enable_episodic_memory: nil, episodic_memory_ttl: nil, model_config: nil, progressive_discovery: nil, prompt: nil, weight: nil)
89
+ # @!method initialize(compaction_config: nil, constraints: nil, description: nil, enable_episodic_memory: nil, episodic_memory_ttl: nil, model_config: nil, progressive_discovery: nil, system_prompt_template: nil, user_message_template: nil, weight: nil)
79
90
  # Some parameter documentations has been truncated, see
80
91
  # {Cadenya::Models::Agents::AgentVariationSpec} for more details.
81
92
  #
@@ -95,7 +106,9 @@ module Cadenya
95
106
  #
96
107
  # @param progressive_discovery [Cadenya::Models::Agents::AgentVariationSpecProgressiveDiscovery] ProgressiveDiscovery is used to indicate that the agent should automatically dis
97
108
  #
98
- # @param prompt [String] The system prompt for this variation
109
+ # @param system_prompt_template [String] Liquid template for the system prompt of objectives using this variation.
110
+ #
111
+ # @param user_message_template [String] Liquid template for the initial user message of objectives using this variation.
99
112
  #
100
113
  # @param weight [Integer] Weight for weighted random selection (>= 0). P(v) = v.weight / sum(all_weights).
101
114
  end
@@ -100,9 +100,17 @@ module Cadenya
100
100
  #
101
101
  # @return [String, nil]
102
102
  optional :state_message, String, api_name: :stateMessage
103
+
104
+ # @!attribute user_data
105
+ # Arbitrary data used to render the variation's user_message_template
106
+ #
107
+ # @return [Hash{Symbol=>Object}, nil]
108
+ optional :user_data,
109
+ Cadenya::Internal::Type::HashOf[Cadenya::Internal::Type::Unknown],
110
+ api_name: :userData
103
111
  end
104
112
 
105
- # @!method initialize(config_snapshot:, initial_message:, metadata:, state:, system_prompt:, data: nil, info: nil, memory_stack: nil, output: nil, parent_objective_id: nil, secrets: nil, state_message: nil)
113
+ # @!method initialize(config_snapshot:, initial_message:, metadata:, state:, system_prompt:, data: nil, info: nil, memory_stack: nil, output: nil, parent_objective_id: nil, secrets: nil, state_message: nil, user_data: nil)
106
114
  # Some parameter documentations has been truncated, see
107
115
  # {Cadenya::Models::Objective} for more details.
108
116
  #
@@ -133,6 +141,8 @@ module Cadenya
133
141
  # @param secrets [Array<Cadenya::Models::ObjectiveSecret>] Secrets that can be used in the headers for tool calls using the secret interpol
134
142
  #
135
143
  # @param state_message [String] Optional human-readable detail about the current state (e.g. a failure reason).
144
+ #
145
+ # @param user_data [Hash{Symbol=>Object}] Arbitrary data used to render the variation's user_message_template
136
146
 
137
147
  # The current lifecycle state of the objective.
138
148
  #
@@ -25,9 +25,11 @@ module Cadenya
25
25
  required :data, Cadenya::Internal::Type::HashOf[Cadenya::Internal::Type::Unknown]
26
26
 
27
27
  # @!attribute initial_message
28
- # Optional override for initial message sent to the agent. This becomes the first
29
- # user message in the LLM chat history. The agent variation is used to set this if
30
- # not present.
28
+ # Optional override for the initial message sent to the agent. This becomes the
29
+ # first user message in the LLM chat history. When not set, the selected
30
+ # variation's user_message_template is rendered with user_data instead. If neither
31
+ # this field nor a user_message_template is present, the request is rejected with
32
+ # InvalidArgument.
31
33
  #
32
34
  # @return [String, nil]
33
35
  optional :initial_message, String, api_name: :initialMessage
@@ -69,6 +71,16 @@ module Cadenya
69
71
  # @return [Array<Cadenya::Models::ObjectiveCreateParams::Secret>, nil]
70
72
  optional :secrets, -> { Cadenya::Internal::Type::ArrayOf[Cadenya::ObjectiveCreateParams::Secret] }
71
73
 
74
+ # @!attribute user_data
75
+ # Arbitrary data rendered into the selected variation's user_message_template
76
+ # (liquid) to produce the initial user message. Separate from `data`, which
77
+ # renders the system prompt template.
78
+ #
79
+ # @return [Hash{Symbol=>Object}, nil]
80
+ optional :user_data,
81
+ Cadenya::Internal::Type::HashOf[Cadenya::Internal::Type::Unknown],
82
+ api_name: :userData
83
+
72
84
  # @!attribute variation_id
73
85
  # Optional explicit variation selection. Overrides the agent's
74
86
  # variation_selection_mode.
@@ -76,7 +88,7 @@ module Cadenya
76
88
  # @return [String, nil]
77
89
  optional :variation_id, String, api_name: :variationId
78
90
 
79
- # @!method initialize(workspace_id:, agent_id:, data:, initial_message: nil, memory_stack: nil, metadata: nil, secrets: nil, variation_id: nil, request_options: {})
91
+ # @!method initialize(workspace_id:, agent_id:, data:, initial_message: nil, memory_stack: nil, metadata: nil, secrets: nil, user_data: nil, variation_id: nil, request_options: {})
80
92
  # Some parameter documentations has been truncated, see
81
93
  # {Cadenya::Models::ObjectiveCreateParams} for more details.
82
94
  #
@@ -86,7 +98,7 @@ module Cadenya
86
98
  #
87
99
  # @param data [Hash{Symbol=>Object}] Arbitrary data for the objective. May be used in liquid templates for prompts co
88
100
  #
89
- # @param initial_message [String] Optional override for initial message sent to the agent. This becomes the first
101
+ # @param initial_message [String] Optional override for the initial message sent to the agent. This becomes the fi
90
102
  #
91
103
  # @param memory_stack [Array<Cadenya::Models::MemoryReference>] Memory layers/entries to push onto this objective's memory stack on
92
104
  #
@@ -94,6 +106,8 @@ module Cadenya
94
106
  #
95
107
  # @param secrets [Array<Cadenya::Models::ObjectiveCreateParams::Secret>] Secrets that can be used in the headers for tool calls using the secret interpol
96
108
  #
109
+ # @param user_data [Hash{Symbol=>Object}] Arbitrary data rendered into the selected variation's user_message_template
110
+ #
97
111
  # @param variation_id [String] Optional explicit variation selection. Overrides the agent's variation_selection
98
112
  #
99
113
  # @param request_options [Cadenya::RequestOptions, Hash{Symbol=>Object}]
@@ -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
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cadenya
4
+ module Models
5
+ module Objectives
6
+ # @see Cadenya::Resources::Objectives::ToolCalls#retrieve
7
+ class ToolCallRetrieveParams < Cadenya::Internal::Type::BaseModel
8
+ extend Cadenya::Internal::Type::RequestParameters::Converter
9
+ include Cadenya::Internal::Type::RequestParameters
10
+
11
+ # @!attribute workspace_id
12
+ #
13
+ # @return [String]
14
+ required :workspace_id, String
15
+
16
+ # @!attribute objective_id
17
+ #
18
+ # @return [String]
19
+ required :objective_id, String
20
+
21
+ # @!attribute tool_call_id
22
+ #
23
+ # @return [String]
24
+ required :tool_call_id, String
25
+
26
+ # @!method initialize(workspace_id:, objective_id:, tool_call_id:, request_options: {})
27
+ # @param workspace_id [String]
28
+ # @param objective_id [String]
29
+ # @param tool_call_id [String]
30
+ # @param request_options [Cadenya::RequestOptions, Hash{Symbol=>Object}]
31
+ end
32
+ end
33
+ end
34
+ end
@@ -3,18 +3,26 @@
3
3
  module Cadenya
4
4
  module Models
5
5
  class ToolResult < Cadenya::Internal::Type::BaseModel
6
- # @!attribute content
6
+ # @!attribute result
7
+ # ObjectiveToolCallResult is the content a tool returned after execution. Tools
8
+ # can return multiple content blocks, and blocks can be multi-modal (text, image,
9
+ # audio). Media blocks are stored by Cadenya and served as short-lived signed URLs
10
+ # rather than inline bytes.
7
11
  #
8
- # @return [String, nil]
9
- optional :content, String
12
+ # @return [Cadenya::Models::Objectives::ObjectiveToolCallResult]
13
+ required :result, -> { Cadenya::Objectives::ObjectiveToolCallResult }
10
14
 
11
15
  # @!attribute tool_call_id
12
16
  #
13
- # @return [String, nil]
14
- optional :tool_call_id, String, api_name: :toolCallId
17
+ # @return [String]
18
+ required :tool_call_id, String, api_name: :toolCallId
15
19
 
16
- # @!method initialize(content: nil, tool_call_id: nil)
17
- # @param content [String]
20
+ # @!method initialize(result:, tool_call_id:)
21
+ # Some parameter documentations has been truncated, see
22
+ # {Cadenya::Models::ToolResult} for more details.
23
+ #
24
+ # @param result [Cadenya::Models::Objectives::ObjectiveToolCallResult] ObjectiveToolCallResult is the content a tool returned after execution.
25
+ #
18
26
  # @param tool_call_id [String]
19
27
  end
20
28
  end