cadenya 0.11.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 (36) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +8 -0
  3. data/README.md +1 -1
  4. data/lib/cadenya/models/objectives/objective_tool_call_data.rb +1 -9
  5. data/lib/cadenya/models/objectives/objective_tool_call_result.rb +27 -0
  6. data/lib/cadenya/models/objectives/objective_tool_call_result_audio_block.rb +46 -0
  7. data/lib/cadenya/models/objectives/objective_tool_call_result_content_block.rb +34 -0
  8. data/lib/cadenya/models/objectives/objective_tool_call_result_image_block.rb +46 -0
  9. data/lib/cadenya/models/objectives/objective_tool_call_result_text_block.rb +21 -0
  10. data/lib/cadenya/models/objectives/objective_tool_call_with_result.rb +102 -0
  11. data/lib/cadenya/models/objectives/tool_call_retrieve_params.rb +34 -0
  12. data/lib/cadenya/models/tool_result.rb +15 -7
  13. data/lib/cadenya/resources/objectives/tool_calls.rb +39 -0
  14. data/lib/cadenya/version.rb +1 -1
  15. data/lib/cadenya.rb +7 -0
  16. data/rbi/cadenya/models/objectives/objective_tool_call_data.rbi +0 -11
  17. data/rbi/cadenya/models/objectives/objective_tool_call_result.rbi +54 -0
  18. data/rbi/cadenya/models/objectives/objective_tool_call_result_audio_block.rbi +69 -0
  19. data/rbi/cadenya/models/objectives/objective_tool_call_result_content_block.rbi +90 -0
  20. data/rbi/cadenya/models/objectives/objective_tool_call_result_image_block.rbi +69 -0
  21. data/rbi/cadenya/models/objectives/objective_tool_call_result_text_block.rbi +31 -0
  22. data/rbi/cadenya/models/objectives/objective_tool_call_with_result.rbi +219 -0
  23. data/rbi/cadenya/models/objectives/tool_call_retrieve_params.rbi +58 -0
  24. data/rbi/cadenya/models/tool_result.rbi +34 -12
  25. data/rbi/cadenya/resources/objectives/tool_calls.rbi +20 -0
  26. data/sig/cadenya/models/objectives/objective_tool_call_data.rbs +0 -7
  27. data/sig/cadenya/models/objectives/objective_tool_call_result.rbs +24 -0
  28. data/sig/cadenya/models/objectives/objective_tool_call_result_audio_block.rbs +34 -0
  29. data/sig/cadenya/models/objectives/objective_tool_call_result_content_block.rbs +46 -0
  30. data/sig/cadenya/models/objectives/objective_tool_call_result_image_block.rbs +34 -0
  31. data/sig/cadenya/models/objectives/objective_tool_call_result_text_block.rbs +17 -0
  32. data/sig/cadenya/models/objectives/objective_tool_call_with_result.rbs +91 -0
  33. data/sig/cadenya/models/objectives/tool_call_retrieve_params.rbs +34 -0
  34. data/sig/cadenya/models/tool_result.rbs +15 -9
  35. data/sig/cadenya/resources/objectives/tool_calls.rbs +7 -0
  36. metadata +22 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: eccefbddc3e445e6a54402fc8a5eba71d7cb44baa645cb15177c73fbc52978da
4
- data.tar.gz: 4e9a538a35dca88e184acac8d92e0db0dd7209346583e193d83bf6753be34ba8
3
+ metadata.gz: cc33022d12e62f8273e8a7aa25cc2f020c231e6ce29f66775f9b144747d5658f
4
+ data.tar.gz: 619df9b5f16e896b922e1f8a1fa312f175a869154eb78a54c29a641e20f09b6b
5
5
  SHA512:
6
- metadata.gz: 10fa27a5fcd86594aa52b339718a896037884aa27323d2d668a598f5058db98930e7a1426d608e5196306946f3184785709ca3bcb0f5df846df3758fd10a4218
7
- data.tar.gz: e84213d6dd22de862fbb36859443c9eb6da7784ac5a921d3c2c11db603c104710b62aab859d3897e683a31e5ab8e6db57952a3dce3723b01308174eff93eab9c
6
+ metadata.gz: 67d08c0901b15069f74e1a8a071876d9ac7c2871f5d73c2986c28ce4b6c01fe564a3385e6bd932f018a6392094d10e3d0a860f9bcd199435cc4fb99beb3a52d4
7
+ data.tar.gz: e6bd7a52e5e2a517108f7eeb6a3902c4662ed72c4158e06da10fc0862fc9292191d479ede3e87662a6104d9a680fe62d9e05d51be0f3b15ed9015907780415f4
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
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
+
3
11
  ## 0.11.0 (2026-06-10)
4
12
 
5
13
  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.12.0"
21
21
  ```
22
22
 
23
23
  <!-- x-release-please-end -->
@@ -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
@@ -4,6 +4,45 @@ module Cadenya
4
4
  module Resources
5
5
  class Objectives
6
6
  class ToolCalls
7
+ # Retrieves a single tool call, including the content the tool returned. Media
8
+ # content (images, audio) is served as short-lived signed URLs.
9
+ #
10
+ # @overload retrieve(tool_call_id, workspace_id:, objective_id:, request_options: {})
11
+ #
12
+ # @param tool_call_id [String] The ID of the tool call to retrieve
13
+ #
14
+ # @param workspace_id [String]
15
+ #
16
+ # @param objective_id [String] The ID of the objective. Supports "external_id:" prefix for external IDs.
17
+ #
18
+ # @param request_options [Cadenya::RequestOptions, Hash{Symbol=>Object}, nil]
19
+ #
20
+ # @return [Cadenya::Models::Objectives::ObjectiveToolCallWithResult]
21
+ #
22
+ # @see Cadenya::Models::Objectives::ToolCallRetrieveParams
23
+ def retrieve(tool_call_id, params)
24
+ parsed, options = Cadenya::Objectives::ToolCallRetrieveParams.dump_request(params)
25
+ workspace_id =
26
+ parsed.delete(:workspace_id) do
27
+ raise ArgumentError.new("missing required path argument #{_1}")
28
+ end
29
+ objective_id =
30
+ parsed.delete(:objective_id) do
31
+ raise ArgumentError.new("missing required path argument #{_1}")
32
+ end
33
+ @client.request(
34
+ method: :get,
35
+ path: [
36
+ "v1/workspaces/%1$s/objectives/%2$s/tool_calls/%3$s",
37
+ workspace_id,
38
+ objective_id,
39
+ tool_call_id
40
+ ],
41
+ model: Cadenya::Objectives::ObjectiveToolCallWithResult,
42
+ options: options
43
+ )
44
+ end
45
+
7
46
  # Lists all tool calls for an objective
8
47
  #
9
48
  # @overload list(objective_id, workspace_id:, cursor: nil, include_info: nil, limit: nil, status: nil, request_options: {})
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Cadenya
4
- VERSION = "0.11.0"
4
+ VERSION = "0.12.0"
5
5
  end
data/lib/cadenya.rb CHANGED
@@ -224,11 +224,18 @@ require_relative "cadenya/models/objectives/objective_tool"
224
224
  require_relative "cadenya/models/objectives/objective_tool_call"
225
225
  require_relative "cadenya/models/objectives/objective_tool_call_data"
226
226
  require_relative "cadenya/models/objectives/objective_tool_call_info"
227
+ require_relative "cadenya/models/objectives/objective_tool_call_result"
228
+ require_relative "cadenya/models/objectives/objective_tool_call_result_audio_block"
229
+ require_relative "cadenya/models/objectives/objective_tool_call_result_content_block"
230
+ require_relative "cadenya/models/objectives/objective_tool_call_result_image_block"
231
+ require_relative "cadenya/models/objectives/objective_tool_call_result_text_block"
232
+ require_relative "cadenya/models/objectives/objective_tool_call_with_result"
227
233
  require_relative "cadenya/models/objectives/task_list_params"
228
234
  require_relative "cadenya/models/objectives/task_retrieve_params"
229
235
  require_relative "cadenya/models/objectives/tool_call_approve_params"
230
236
  require_relative "cadenya/models/objectives/tool_call_deny_params"
231
237
  require_relative "cadenya/models/objectives/tool_call_list_params"
238
+ require_relative "cadenya/models/objectives/tool_call_retrieve_params"
232
239
  require_relative "cadenya/models/objectives/tool_list_params"
233
240
  require_relative "cadenya/models/objective_secret"
234
241
  require_relative "cadenya/models/operation_metadata"
@@ -38,13 +38,6 @@ module Cadenya
38
38
  sig { params(memo: String).void }
39
39
  attr_writer :memo
40
40
 
41
- # The result content returned by the tool after execution
42
- sig { returns(T.nilable(String)) }
43
- attr_reader :result
44
-
45
- sig { params(result: String).void }
46
- attr_writer :result
47
-
48
41
  # A profile identifies a user or non-human principal (such as an API key) at the
49
42
  # account level. Profiles are account-scoped and can be granted access to multiple
50
43
  # workspaces.
@@ -59,7 +52,6 @@ module Cadenya
59
52
  callable: Cadenya::CallableTool::OrHash,
60
53
  arguments: T::Hash[Symbol, T.anything],
61
54
  memo: String,
62
- result: String,
63
55
  status_changed_by: Cadenya::Profile::OrHash
64
56
  ).returns(T.attached_class)
65
57
  end
@@ -73,8 +65,6 @@ module Cadenya
73
65
  arguments: nil,
74
66
  # A memo supplied by the reviewer when denying the tool call
75
67
  memo: nil,
76
- # The result content returned by the tool after execution
77
- result: nil,
78
68
  # A profile identifies a user or non-human principal (such as an API key) at the
79
69
  # account level. Profiles are account-scoped and can be granted access to multiple
80
70
  # workspaces.
@@ -88,7 +78,6 @@ module Cadenya
88
78
  callable: Cadenya::CallableTool,
89
79
  arguments: T::Hash[Symbol, T.anything],
90
80
  memo: String,
91
- result: String,
92
81
  status_changed_by: Cadenya::Profile
93
82
  }
94
83
  )
@@ -0,0 +1,54 @@
1
+ # typed: strong
2
+
3
+ module Cadenya
4
+ module Models
5
+ ObjectiveToolCallResult = Objectives::ObjectiveToolCallResult
6
+
7
+ module Objectives
8
+ class ObjectiveToolCallResult < Cadenya::Internal::Type::BaseModel
9
+ OrHash =
10
+ T.type_alias do
11
+ T.any(
12
+ Cadenya::Objectives::ObjectiveToolCallResult,
13
+ Cadenya::Internal::AnyHash
14
+ )
15
+ end
16
+
17
+ sig do
18
+ returns(
19
+ T::Array[Cadenya::Objectives::ObjectiveToolCallResultContentBlock]
20
+ )
21
+ end
22
+ attr_accessor :content
23
+
24
+ # ObjectiveToolCallResult is the content a tool returned after execution. Tools
25
+ # can return multiple content blocks, and blocks can be multi-modal (text, image,
26
+ # audio). Media blocks are stored by Cadenya and served as short-lived signed URLs
27
+ # rather than inline bytes.
28
+ sig do
29
+ params(
30
+ content:
31
+ T::Array[
32
+ Cadenya::Objectives::ObjectiveToolCallResultContentBlock::OrHash
33
+ ]
34
+ ).returns(T.attached_class)
35
+ end
36
+ def self.new(content:)
37
+ end
38
+
39
+ sig do
40
+ override.returns(
41
+ {
42
+ content:
43
+ T::Array[
44
+ Cadenya::Objectives::ObjectiveToolCallResultContentBlock
45
+ ]
46
+ }
47
+ )
48
+ end
49
+ def to_hash
50
+ end
51
+ end
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,69 @@
1
+ # typed: strong
2
+
3
+ module Cadenya
4
+ module Models
5
+ ObjectiveToolCallResultAudioBlock =
6
+ Objectives::ObjectiveToolCallResultAudioBlock
7
+
8
+ module Objectives
9
+ class ObjectiveToolCallResultAudioBlock < Cadenya::Internal::Type::BaseModel
10
+ OrHash =
11
+ T.type_alias do
12
+ T.any(
13
+ Cadenya::Objectives::ObjectiveToolCallResultAudioBlock,
14
+ Cadenya::Internal::AnyHash
15
+ )
16
+ end
17
+
18
+ # When the signed URL expires.
19
+ sig { returns(Time) }
20
+ attr_accessor :expires_at
21
+
22
+ # IANA media type of the stored audio, e.g. audio/wav.
23
+ sig { returns(String) }
24
+ attr_accessor :mime_type
25
+
26
+ # Size of the stored audio in bytes.
27
+ sig { returns(String) }
28
+ attr_accessor :size_bytes
29
+
30
+ # Short-lived signed URL to download the stored audio.
31
+ sig { returns(String) }
32
+ attr_accessor :url
33
+
34
+ sig do
35
+ params(
36
+ expires_at: Time,
37
+ mime_type: String,
38
+ size_bytes: String,
39
+ url: String
40
+ ).returns(T.attached_class)
41
+ end
42
+ def self.new(
43
+ # When the signed URL expires.
44
+ expires_at:,
45
+ # IANA media type of the stored audio, e.g. audio/wav.
46
+ mime_type:,
47
+ # Size of the stored audio in bytes.
48
+ size_bytes:,
49
+ # Short-lived signed URL to download the stored audio.
50
+ url:
51
+ )
52
+ end
53
+
54
+ sig do
55
+ override.returns(
56
+ {
57
+ expires_at: Time,
58
+ mime_type: String,
59
+ size_bytes: String,
60
+ url: String
61
+ }
62
+ )
63
+ end
64
+ def to_hash
65
+ end
66
+ end
67
+ end
68
+ end
69
+ end