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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +16 -0
- data/README.md +1 -1
- data/lib/cadenya/models/context_lengths.rb +87 -0
- data/lib/cadenya/models/objective_diagnostics.rb +50 -0
- data/lib/cadenya/models/objective_retrieve_diagnostics_params.rb +26 -0
- data/lib/cadenya/models/objective_retrieve_diagnostics_response.rb +25 -0
- data/lib/cadenya/models/objectives/objective_tool_call.rb +1 -0
- data/lib/cadenya/models/objectives/objective_tool_call_with_result.rb +1 -0
- data/lib/cadenya/models/objectives/set_tool_call_content_request_audio_block.rb +26 -0
- data/lib/cadenya/models/objectives/set_tool_call_content_request_content_block.rb +32 -0
- data/lib/cadenya/models/objectives/set_tool_call_content_request_image_block.rb +26 -0
- data/lib/cadenya/models/objectives/set_tool_call_content_request_text_block.rb +17 -0
- data/lib/cadenya/models/objectives/tool_call_list_params.rb +31 -1
- data/lib/cadenya/models/objectives/tool_call_set_content_params.rb +51 -0
- data/lib/cadenya/models/tool_called.rb +33 -1
- data/lib/cadenya/models/tool_set_adapter.rb +18 -1
- data/lib/cadenya/models/tool_set_adapter_bare.rb +26 -0
- data/lib/cadenya/models/tool_sets/config_bare.rb +14 -0
- data/lib/cadenya/models/tool_sets/tool_spec_config.rb +16 -1
- data/lib/cadenya/models.rb +8 -0
- data/lib/cadenya/resources/objectives/tool_calls.rb +53 -2
- data/lib/cadenya/resources/objectives.rb +30 -0
- data/lib/cadenya/version.rb +1 -1
- data/lib/cadenya.rb +11 -0
- data/rbi/cadenya/models/context_lengths.rbi +103 -0
- data/rbi/cadenya/models/objective_diagnostics.rbi +76 -0
- data/rbi/cadenya/models/objective_retrieve_diagnostics_params.rbi +46 -0
- data/rbi/cadenya/models/objective_retrieve_diagnostics_response.rbi +43 -0
- data/rbi/cadenya/models/objectives/objective_tool_call.rbi +5 -0
- data/rbi/cadenya/models/objectives/objective_tool_call_with_result.rbi +5 -0
- data/rbi/cadenya/models/objectives/set_tool_call_content_request_audio_block.rbi +40 -0
- data/rbi/cadenya/models/objectives/set_tool_call_content_request_content_block.rbi +89 -0
- data/rbi/cadenya/models/objectives/set_tool_call_content_request_image_block.rbi +40 -0
- data/rbi/cadenya/models/objectives/set_tool_call_content_request_text_block.rbi +28 -0
- data/rbi/cadenya/models/objectives/tool_call_list_params.rbi +85 -0
- data/rbi/cadenya/models/objectives/tool_call_set_content_params.rbi +80 -0
- data/rbi/cadenya/models/tool_called.rbi +55 -2
- data/rbi/cadenya/models/tool_set_adapter.rbi +24 -1
- data/rbi/cadenya/models/tool_set_adapter_bare.rbi +37 -0
- data/rbi/cadenya/models/tool_sets/config_bare.rbi +25 -0
- data/rbi/cadenya/models/tool_sets/tool_spec_config.rbi +20 -1
- data/rbi/cadenya/models.rbi +9 -0
- data/rbi/cadenya/resources/objectives/tool_calls.rbi +37 -0
- data/rbi/cadenya/resources/objectives.rbi +19 -0
- data/sig/cadenya/models/context_lengths.rbs +55 -0
- data/sig/cadenya/models/objective_diagnostics.rbs +30 -0
- data/sig/cadenya/models/objective_retrieve_diagnostics_params.rbs +28 -0
- data/sig/cadenya/models/objective_retrieve_diagnostics_response.rbs +14 -0
- data/sig/cadenya/models/objectives/objective_tool_call.rbs +2 -0
- data/sig/cadenya/models/objectives/objective_tool_call_with_result.rbs +2 -0
- data/sig/cadenya/models/objectives/set_tool_call_content_request_audio_block.rbs +18 -0
- data/sig/cadenya/models/objectives/set_tool_call_content_request_content_block.rbs +44 -0
- data/sig/cadenya/models/objectives/set_tool_call_content_request_image_block.rbs +18 -0
- data/sig/cadenya/models/objectives/set_tool_call_content_request_text_block.rbs +15 -0
- data/sig/cadenya/models/objectives/tool_call_list_params.rbs +30 -0
- data/sig/cadenya/models/objectives/tool_call_set_content_params.rbs +43 -0
- data/sig/cadenya/models/tool_called.rbs +33 -3
- data/sig/cadenya/models/tool_set_adapter.rbs +7 -0
- data/sig/cadenya/models/tool_set_adapter_bare.rbs +15 -0
- data/sig/cadenya/models/tool_sets/config_bare.rbs +13 -0
- data/sig/cadenya/models/tool_sets/tool_spec_config.rbs +9 -0
- data/sig/cadenya/models.rbs +8 -0
- data/sig/cadenya/resources/objectives/tool_calls.rbs +9 -0
- data/sig/cadenya/resources/objectives.rbs +6 -0
- metadata +35 -2
|
@@ -28,6 +28,26 @@ module Cadenya
|
|
|
28
28
|
sig { params(cursor: String).void }
|
|
29
29
|
attr_writer :cursor
|
|
30
30
|
|
|
31
|
+
# Filter by tool call execution status. Useful for reverse-harness polling of bare
|
|
32
|
+
# tool calls waiting for externally supplied content
|
|
33
|
+
# (TOOL_CALL_EXECUTION_STATUS_WAITING_FOR_CONTENT).
|
|
34
|
+
sig do
|
|
35
|
+
returns(
|
|
36
|
+
T.nilable(
|
|
37
|
+
Cadenya::Objectives::ToolCallListParams::ExecutionStatus::OrSymbol
|
|
38
|
+
)
|
|
39
|
+
)
|
|
40
|
+
end
|
|
41
|
+
attr_reader :execution_status
|
|
42
|
+
|
|
43
|
+
sig do
|
|
44
|
+
params(
|
|
45
|
+
execution_status:
|
|
46
|
+
Cadenya::Objectives::ToolCallListParams::ExecutionStatus::OrSymbol
|
|
47
|
+
).void
|
|
48
|
+
end
|
|
49
|
+
attr_writer :execution_status
|
|
50
|
+
|
|
31
51
|
# When set to true you may use more of your alloted API rate-limit
|
|
32
52
|
sig { returns(T.nilable(T::Boolean)) }
|
|
33
53
|
attr_reader :include_info
|
|
@@ -62,6 +82,8 @@ module Cadenya
|
|
|
62
82
|
workspace_id: String,
|
|
63
83
|
objective_id: String,
|
|
64
84
|
cursor: String,
|
|
85
|
+
execution_status:
|
|
86
|
+
Cadenya::Objectives::ToolCallListParams::ExecutionStatus::OrSymbol,
|
|
65
87
|
include_info: T::Boolean,
|
|
66
88
|
limit: Integer,
|
|
67
89
|
status: Cadenya::Objectives::ToolCallListParams::Status::OrSymbol,
|
|
@@ -73,6 +95,10 @@ module Cadenya
|
|
|
73
95
|
objective_id:,
|
|
74
96
|
# Pagination cursor from previous response
|
|
75
97
|
cursor: nil,
|
|
98
|
+
# Filter by tool call execution status. Useful for reverse-harness polling of bare
|
|
99
|
+
# tool calls waiting for externally supplied content
|
|
100
|
+
# (TOOL_CALL_EXECUTION_STATUS_WAITING_FOR_CONTENT).
|
|
101
|
+
execution_status: nil,
|
|
76
102
|
# When set to true you may use more of your alloted API rate-limit
|
|
77
103
|
include_info: nil,
|
|
78
104
|
# Maximum number of results to return
|
|
@@ -89,6 +115,8 @@ module Cadenya
|
|
|
89
115
|
workspace_id: String,
|
|
90
116
|
objective_id: String,
|
|
91
117
|
cursor: String,
|
|
118
|
+
execution_status:
|
|
119
|
+
Cadenya::Objectives::ToolCallListParams::ExecutionStatus::OrSymbol,
|
|
92
120
|
include_info: T::Boolean,
|
|
93
121
|
limit: Integer,
|
|
94
122
|
status: Cadenya::Objectives::ToolCallListParams::Status::OrSymbol,
|
|
@@ -99,6 +127,63 @@ module Cadenya
|
|
|
99
127
|
def to_hash
|
|
100
128
|
end
|
|
101
129
|
|
|
130
|
+
# Filter by tool call execution status. Useful for reverse-harness polling of bare
|
|
131
|
+
# tool calls waiting for externally supplied content
|
|
132
|
+
# (TOOL_CALL_EXECUTION_STATUS_WAITING_FOR_CONTENT).
|
|
133
|
+
module ExecutionStatus
|
|
134
|
+
extend Cadenya::Internal::Type::Enum
|
|
135
|
+
|
|
136
|
+
TaggedSymbol =
|
|
137
|
+
T.type_alias do
|
|
138
|
+
T.all(
|
|
139
|
+
Symbol,
|
|
140
|
+
Cadenya::Objectives::ToolCallListParams::ExecutionStatus
|
|
141
|
+
)
|
|
142
|
+
end
|
|
143
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
144
|
+
|
|
145
|
+
TOOL_CALL_EXECUTION_STATUS_UNSPECIFIED =
|
|
146
|
+
T.let(
|
|
147
|
+
:TOOL_CALL_EXECUTION_STATUS_UNSPECIFIED,
|
|
148
|
+
Cadenya::Objectives::ToolCallListParams::ExecutionStatus::TaggedSymbol
|
|
149
|
+
)
|
|
150
|
+
TOOL_CALL_EXECUTION_STATUS_PENDING =
|
|
151
|
+
T.let(
|
|
152
|
+
:TOOL_CALL_EXECUTION_STATUS_PENDING,
|
|
153
|
+
Cadenya::Objectives::ToolCallListParams::ExecutionStatus::TaggedSymbol
|
|
154
|
+
)
|
|
155
|
+
TOOL_CALL_EXECUTION_STATUS_RUNNING =
|
|
156
|
+
T.let(
|
|
157
|
+
:TOOL_CALL_EXECUTION_STATUS_RUNNING,
|
|
158
|
+
Cadenya::Objectives::ToolCallListParams::ExecutionStatus::TaggedSymbol
|
|
159
|
+
)
|
|
160
|
+
TOOL_CALL_EXECUTION_STATUS_COMPLETED =
|
|
161
|
+
T.let(
|
|
162
|
+
:TOOL_CALL_EXECUTION_STATUS_COMPLETED,
|
|
163
|
+
Cadenya::Objectives::ToolCallListParams::ExecutionStatus::TaggedSymbol
|
|
164
|
+
)
|
|
165
|
+
TOOL_CALL_EXECUTION_STATUS_ERRORED =
|
|
166
|
+
T.let(
|
|
167
|
+
:TOOL_CALL_EXECUTION_STATUS_ERRORED,
|
|
168
|
+
Cadenya::Objectives::ToolCallListParams::ExecutionStatus::TaggedSymbol
|
|
169
|
+
)
|
|
170
|
+
TOOL_CALL_EXECUTION_STATUS_WAITING_FOR_CONTENT =
|
|
171
|
+
T.let(
|
|
172
|
+
:TOOL_CALL_EXECUTION_STATUS_WAITING_FOR_CONTENT,
|
|
173
|
+
Cadenya::Objectives::ToolCallListParams::ExecutionStatus::TaggedSymbol
|
|
174
|
+
)
|
|
175
|
+
|
|
176
|
+
sig do
|
|
177
|
+
override.returns(
|
|
178
|
+
T::Array[
|
|
179
|
+
Cadenya::Objectives::ToolCallListParams::ExecutionStatus::TaggedSymbol
|
|
180
|
+
]
|
|
181
|
+
)
|
|
182
|
+
end
|
|
183
|
+
def self.values
|
|
184
|
+
end
|
|
185
|
+
end
|
|
186
|
+
|
|
102
187
|
# Filter by tool call status
|
|
103
188
|
module Status
|
|
104
189
|
extend Cadenya::Internal::Type::Enum
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Cadenya
|
|
4
|
+
module Models
|
|
5
|
+
module Objectives
|
|
6
|
+
class ToolCallSetContentParams < Cadenya::Internal::Type::BaseModel
|
|
7
|
+
extend Cadenya::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Cadenya::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
OrHash =
|
|
11
|
+
T.type_alias do
|
|
12
|
+
T.any(
|
|
13
|
+
Cadenya::Objectives::ToolCallSetContentParams,
|
|
14
|
+
Cadenya::Internal::AnyHash
|
|
15
|
+
)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
sig { returns(String) }
|
|
19
|
+
attr_accessor :workspace_id
|
|
20
|
+
|
|
21
|
+
sig { returns(String) }
|
|
22
|
+
attr_accessor :objective_id
|
|
23
|
+
|
|
24
|
+
sig { returns(String) }
|
|
25
|
+
attr_accessor :tool_call_id
|
|
26
|
+
|
|
27
|
+
# The content to set on the tool call. Mirrors
|
|
28
|
+
# ObjectiveToolCallResult.ContentBlock but writable: media blocks carry raw data
|
|
29
|
+
# on input where the result-side carries a signed url on output.
|
|
30
|
+
sig do
|
|
31
|
+
returns(
|
|
32
|
+
T::Array[Cadenya::Objectives::SetToolCallContentRequestContentBlock]
|
|
33
|
+
)
|
|
34
|
+
end
|
|
35
|
+
attr_accessor :content
|
|
36
|
+
|
|
37
|
+
sig do
|
|
38
|
+
params(
|
|
39
|
+
workspace_id: String,
|
|
40
|
+
objective_id: String,
|
|
41
|
+
tool_call_id: String,
|
|
42
|
+
content:
|
|
43
|
+
T::Array[
|
|
44
|
+
Cadenya::Objectives::SetToolCallContentRequestContentBlock::OrHash
|
|
45
|
+
],
|
|
46
|
+
request_options: Cadenya::RequestOptions::OrHash
|
|
47
|
+
).returns(T.attached_class)
|
|
48
|
+
end
|
|
49
|
+
def self.new(
|
|
50
|
+
workspace_id:,
|
|
51
|
+
objective_id:,
|
|
52
|
+
tool_call_id:,
|
|
53
|
+
# The content to set on the tool call. Mirrors
|
|
54
|
+
# ObjectiveToolCallResult.ContentBlock but writable: media blocks carry raw data
|
|
55
|
+
# on input where the result-side carries a signed url on output.
|
|
56
|
+
content:,
|
|
57
|
+
request_options: {}
|
|
58
|
+
)
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
sig do
|
|
62
|
+
override.returns(
|
|
63
|
+
{
|
|
64
|
+
workspace_id: String,
|
|
65
|
+
objective_id: String,
|
|
66
|
+
tool_call_id: String,
|
|
67
|
+
content:
|
|
68
|
+
T::Array[
|
|
69
|
+
Cadenya::Objectives::SetToolCallContentRequestContentBlock
|
|
70
|
+
],
|
|
71
|
+
request_options: Cadenya::RequestOptions
|
|
72
|
+
}
|
|
73
|
+
)
|
|
74
|
+
end
|
|
75
|
+
def to_hash
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
end
|
|
@@ -6,6 +6,32 @@ module Cadenya
|
|
|
6
6
|
OrHash =
|
|
7
7
|
T.type_alias { T.any(Cadenya::ToolCalled, Cadenya::Internal::AnyHash) }
|
|
8
8
|
|
|
9
|
+
# The arguments passed to the tool.
|
|
10
|
+
sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
|
|
11
|
+
attr_reader :arguments
|
|
12
|
+
|
|
13
|
+
sig { params(arguments: T::Hash[Symbol, T.anything]).void }
|
|
14
|
+
attr_writer :arguments
|
|
15
|
+
|
|
16
|
+
# Config defines the adapter to use for the tool. This is used to determine how
|
|
17
|
+
# the tool is called. For example, if the tool is an HTTP tool, the adapter will
|
|
18
|
+
# be Http. If the tool is an inline tool, the adapter will be Inline.
|
|
19
|
+
sig { returns(T.nilable(Cadenya::ToolSets::ToolSpecConfig)) }
|
|
20
|
+
attr_reader :config
|
|
21
|
+
|
|
22
|
+
sig { params(config: Cadenya::ToolSets::ToolSpecConfig::OrHash).void }
|
|
23
|
+
attr_writer :config
|
|
24
|
+
|
|
25
|
+
# CallableTool is a union that represents a tool that can be called by an agent.
|
|
26
|
+
# In Cadenya, a tool that is used within an agent objective might be a
|
|
27
|
+
# user-defined tool (IE: MCP, HTTP), another Agent (useful to separate context),
|
|
28
|
+
# or a Cadenya Tool (one Cadenya provides).
|
|
29
|
+
sig { returns(T.nilable(Cadenya::CallableTool)) }
|
|
30
|
+
attr_reader :tool
|
|
31
|
+
|
|
32
|
+
sig { params(tool: Cadenya::CallableTool::OrHash).void }
|
|
33
|
+
attr_writer :tool
|
|
34
|
+
|
|
9
35
|
# The ID of the objective tool call record that was executed.
|
|
10
36
|
sig { returns(T.nilable(String)) }
|
|
11
37
|
attr_reader :tool_call_id
|
|
@@ -13,14 +39,41 @@ module Cadenya
|
|
|
13
39
|
sig { params(tool_call_id: String).void }
|
|
14
40
|
attr_writer :tool_call_id
|
|
15
41
|
|
|
16
|
-
sig
|
|
42
|
+
sig do
|
|
43
|
+
params(
|
|
44
|
+
arguments: T::Hash[Symbol, T.anything],
|
|
45
|
+
config: Cadenya::ToolSets::ToolSpecConfig::OrHash,
|
|
46
|
+
tool: Cadenya::CallableTool::OrHash,
|
|
47
|
+
tool_call_id: String
|
|
48
|
+
).returns(T.attached_class)
|
|
49
|
+
end
|
|
17
50
|
def self.new(
|
|
51
|
+
# The arguments passed to the tool.
|
|
52
|
+
arguments: nil,
|
|
53
|
+
# Config defines the adapter to use for the tool. This is used to determine how
|
|
54
|
+
# the tool is called. For example, if the tool is an HTTP tool, the adapter will
|
|
55
|
+
# be Http. If the tool is an inline tool, the adapter will be Inline.
|
|
56
|
+
config: nil,
|
|
57
|
+
# CallableTool is a union that represents a tool that can be called by an agent.
|
|
58
|
+
# In Cadenya, a tool that is used within an agent objective might be a
|
|
59
|
+
# user-defined tool (IE: MCP, HTTP), another Agent (useful to separate context),
|
|
60
|
+
# or a Cadenya Tool (one Cadenya provides).
|
|
61
|
+
tool: nil,
|
|
18
62
|
# The ID of the objective tool call record that was executed.
|
|
19
63
|
tool_call_id: nil
|
|
20
64
|
)
|
|
21
65
|
end
|
|
22
66
|
|
|
23
|
-
sig
|
|
67
|
+
sig do
|
|
68
|
+
override.returns(
|
|
69
|
+
{
|
|
70
|
+
arguments: T::Hash[Symbol, T.anything],
|
|
71
|
+
config: Cadenya::ToolSets::ToolSpecConfig,
|
|
72
|
+
tool: Cadenya::CallableTool,
|
|
73
|
+
tool_call_id: String
|
|
74
|
+
}
|
|
75
|
+
)
|
|
76
|
+
end
|
|
24
77
|
def to_hash
|
|
25
78
|
end
|
|
26
79
|
end
|
|
@@ -8,6 +8,17 @@ module Cadenya
|
|
|
8
8
|
T.any(Cadenya::ToolSetAdapter, Cadenya::Internal::AnyHash)
|
|
9
9
|
end
|
|
10
10
|
|
|
11
|
+
# Bare tool sets define tools without an execution adapter. A bare tool call
|
|
12
|
+
# doesn't fire anything: the objective's workflow pauses and waits for an external
|
|
13
|
+
# API consumer to set the tool call's content (e.g. human-in-the-loop tools, or a
|
|
14
|
+
# reverse harness that polls for pending tool calls, executes locally, and reports
|
|
15
|
+
# results back via SetToolCallContent).
|
|
16
|
+
sig { returns(T.nilable(Cadenya::ToolSetAdapterBare)) }
|
|
17
|
+
attr_reader :bare
|
|
18
|
+
|
|
19
|
+
sig { params(bare: Cadenya::ToolSetAdapterBare::OrHash).void }
|
|
20
|
+
attr_writer :bare
|
|
21
|
+
|
|
11
22
|
sig { returns(T.nilable(Cadenya::ToolSetAdapterHTTP)) }
|
|
12
23
|
attr_reader :http
|
|
13
24
|
|
|
@@ -28,17 +39,29 @@ module Cadenya
|
|
|
28
39
|
|
|
29
40
|
sig do
|
|
30
41
|
params(
|
|
42
|
+
bare: Cadenya::ToolSetAdapterBare::OrHash,
|
|
31
43
|
http: Cadenya::ToolSetAdapterHTTP::OrHash,
|
|
32
44
|
mcp: Cadenya::ToolSetAdapterMcp::OrHash,
|
|
33
45
|
openapi: Cadenya::ToolSetAdapterOpenAPI::OrHash
|
|
34
46
|
).returns(T.attached_class)
|
|
35
47
|
end
|
|
36
|
-
def self.new(
|
|
48
|
+
def self.new(
|
|
49
|
+
# Bare tool sets define tools without an execution adapter. A bare tool call
|
|
50
|
+
# doesn't fire anything: the objective's workflow pauses and waits for an external
|
|
51
|
+
# API consumer to set the tool call's content (e.g. human-in-the-loop tools, or a
|
|
52
|
+
# reverse harness that polls for pending tool calls, executes locally, and reports
|
|
53
|
+
# results back via SetToolCallContent).
|
|
54
|
+
bare: nil,
|
|
55
|
+
http: nil,
|
|
56
|
+
mcp: nil,
|
|
57
|
+
openapi: nil
|
|
58
|
+
)
|
|
37
59
|
end
|
|
38
60
|
|
|
39
61
|
sig do
|
|
40
62
|
override.returns(
|
|
41
63
|
{
|
|
64
|
+
bare: Cadenya::ToolSetAdapterBare,
|
|
42
65
|
http: Cadenya::ToolSetAdapterHTTP,
|
|
43
66
|
mcp: Cadenya::ToolSetAdapterMcp,
|
|
44
67
|
openapi: Cadenya::ToolSetAdapterOpenAPI
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Cadenya
|
|
4
|
+
module Models
|
|
5
|
+
class ToolSetAdapterBare < Cadenya::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(Cadenya::ToolSetAdapterBare, Cadenya::Internal::AnyHash)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
# How long to wait for content to be set before the tool call errors. If unset,
|
|
12
|
+
# the call waits indefinitely.
|
|
13
|
+
sig { returns(T.nilable(Integer)) }
|
|
14
|
+
attr_reader :content_timeout
|
|
15
|
+
|
|
16
|
+
sig { params(content_timeout: Integer).void }
|
|
17
|
+
attr_writer :content_timeout
|
|
18
|
+
|
|
19
|
+
# Bare tool sets define tools without an execution adapter. A bare tool call
|
|
20
|
+
# doesn't fire anything: the objective's workflow pauses and waits for an external
|
|
21
|
+
# API consumer to set the tool call's content (e.g. human-in-the-loop tools, or a
|
|
22
|
+
# reverse harness that polls for pending tool calls, executes locally, and reports
|
|
23
|
+
# results back via SetToolCallContent).
|
|
24
|
+
sig { params(content_timeout: Integer).returns(T.attached_class) }
|
|
25
|
+
def self.new(
|
|
26
|
+
# How long to wait for content to be set before the tool call errors. If unset,
|
|
27
|
+
# the call waits indefinitely.
|
|
28
|
+
content_timeout: nil
|
|
29
|
+
)
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
sig { override.returns({ content_timeout: Integer }) }
|
|
33
|
+
def to_hash
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Cadenya
|
|
4
|
+
module Models
|
|
5
|
+
module ToolSets
|
|
6
|
+
class ConfigBare < Cadenya::Internal::Type::BaseModel
|
|
7
|
+
OrHash =
|
|
8
|
+
T.type_alias do
|
|
9
|
+
T.any(Cadenya::ToolSets::ConfigBare, Cadenya::Internal::AnyHash)
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
# Marks the tool as bare: it has no execution adapter of its own and relies on the
|
|
13
|
+
# parent tool set being a Bare tool set. Present so a webhook consumer can tell a
|
|
14
|
+
# tool is bare from the tool data alone, without cross-referencing the tool set.
|
|
15
|
+
sig { returns(T.attached_class) }
|
|
16
|
+
def self.new
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
sig { override.returns({}) }
|
|
20
|
+
def to_hash
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -9,6 +9,15 @@ module Cadenya
|
|
|
9
9
|
T.any(Cadenya::ToolSets::ToolSpecConfig, Cadenya::Internal::AnyHash)
|
|
10
10
|
end
|
|
11
11
|
|
|
12
|
+
# Marks the tool as bare: it has no execution adapter of its own and relies on the
|
|
13
|
+
# parent tool set being a Bare tool set. Present so a webhook consumer can tell a
|
|
14
|
+
# tool is bare from the tool data alone, without cross-referencing the tool set.
|
|
15
|
+
sig { returns(T.nilable(Cadenya::ToolSets::ConfigBare)) }
|
|
16
|
+
attr_reader :bare
|
|
17
|
+
|
|
18
|
+
sig { params(bare: Cadenya::ToolSets::ConfigBare::OrHash).void }
|
|
19
|
+
attr_writer :bare
|
|
20
|
+
|
|
12
21
|
sig { returns(T.nilable(Cadenya::ToolSets::ConfigHTTP)) }
|
|
13
22
|
attr_reader :http
|
|
14
23
|
|
|
@@ -32,17 +41,27 @@ module Cadenya
|
|
|
32
41
|
# be Http. If the tool is an inline tool, the adapter will be Inline.
|
|
33
42
|
sig do
|
|
34
43
|
params(
|
|
44
|
+
bare: Cadenya::ToolSets::ConfigBare::OrHash,
|
|
35
45
|
http: Cadenya::ToolSets::ConfigHTTP::OrHash,
|
|
36
46
|
mcp: Cadenya::ToolSets::ConfigMcp::OrHash,
|
|
37
47
|
openapi: Cadenya::ToolSets::ConfigOpenAPI::OrHash
|
|
38
48
|
).returns(T.attached_class)
|
|
39
49
|
end
|
|
40
|
-
def self.new(
|
|
50
|
+
def self.new(
|
|
51
|
+
# Marks the tool as bare: it has no execution adapter of its own and relies on the
|
|
52
|
+
# parent tool set being a Bare tool set. Present so a webhook consumer can tell a
|
|
53
|
+
# tool is bare from the tool data alone, without cross-referencing the tool set.
|
|
54
|
+
bare: nil,
|
|
55
|
+
http: nil,
|
|
56
|
+
mcp: nil,
|
|
57
|
+
openapi: nil
|
|
58
|
+
)
|
|
41
59
|
end
|
|
42
60
|
|
|
43
61
|
sig do
|
|
44
62
|
override.returns(
|
|
45
63
|
{
|
|
64
|
+
bare: Cadenya::ToolSets::ConfigBare,
|
|
46
65
|
http: Cadenya::ToolSets::ConfigHTTP,
|
|
47
66
|
mcp: Cadenya::ToolSets::ConfigMcp,
|
|
48
67
|
openapi: Cadenya::ToolSets::ConfigOpenAPI
|
data/rbi/cadenya/models.rbi
CHANGED
|
@@ -89,6 +89,8 @@ module Cadenya
|
|
|
89
89
|
|
|
90
90
|
CallableTool = Cadenya::Models::CallableTool
|
|
91
91
|
|
|
92
|
+
ContextLengths = Cadenya::Models::ContextLengths
|
|
93
|
+
|
|
92
94
|
ContextWindowCompacted = Cadenya::Models::ContextWindowCompacted
|
|
93
95
|
|
|
94
96
|
CreateOperationMetadata = Cadenya::Models::CreateOperationMetadata
|
|
@@ -147,6 +149,8 @@ module Cadenya
|
|
|
147
149
|
|
|
148
150
|
ObjectiveCreateParams = Cadenya::Models::ObjectiveCreateParams
|
|
149
151
|
|
|
152
|
+
ObjectiveDiagnostics = Cadenya::Models::ObjectiveDiagnostics
|
|
153
|
+
|
|
150
154
|
ObjectiveError = Cadenya::Models::ObjectiveError
|
|
151
155
|
|
|
152
156
|
ObjectiveEvent = Cadenya::Models::ObjectiveEvent
|
|
@@ -166,6 +170,9 @@ module Cadenya
|
|
|
166
170
|
|
|
167
171
|
ObjectiveListParams = Cadenya::Models::ObjectiveListParams
|
|
168
172
|
|
|
173
|
+
ObjectiveRetrieveDiagnosticsParams =
|
|
174
|
+
Cadenya::Models::ObjectiveRetrieveDiagnosticsParams
|
|
175
|
+
|
|
169
176
|
ObjectiveRetrieveParams = Cadenya::Models::ObjectiveRetrieveParams
|
|
170
177
|
|
|
171
178
|
Objectives = Cadenya::Models::Objectives
|
|
@@ -224,6 +231,8 @@ module Cadenya
|
|
|
224
231
|
|
|
225
232
|
ToolSetAdapter = Cadenya::Models::ToolSetAdapter
|
|
226
233
|
|
|
234
|
+
ToolSetAdapterBare = Cadenya::Models::ToolSetAdapterBare
|
|
235
|
+
|
|
227
236
|
ToolSetAdapterHTTP = Cadenya::Models::ToolSetAdapterHTTP
|
|
228
237
|
|
|
229
238
|
ToolSetAdapterMcp = Cadenya::Models::ToolSetAdapterMcp
|
|
@@ -30,6 +30,8 @@ module Cadenya
|
|
|
30
30
|
objective_id: String,
|
|
31
31
|
workspace_id: String,
|
|
32
32
|
cursor: String,
|
|
33
|
+
execution_status:
|
|
34
|
+
Cadenya::Objectives::ToolCallListParams::ExecutionStatus::OrSymbol,
|
|
33
35
|
include_info: T::Boolean,
|
|
34
36
|
limit: Integer,
|
|
35
37
|
status: Cadenya::Objectives::ToolCallListParams::Status::OrSymbol,
|
|
@@ -47,6 +49,10 @@ module Cadenya
|
|
|
47
49
|
workspace_id:,
|
|
48
50
|
# Query param: Pagination cursor from previous response
|
|
49
51
|
cursor: nil,
|
|
52
|
+
# Query param: Filter by tool call execution status. Useful for reverse-harness
|
|
53
|
+
# polling of bare tool calls waiting for externally supplied content
|
|
54
|
+
# (TOOL_CALL_EXECUTION_STATUS_WAITING_FOR_CONTENT).
|
|
55
|
+
execution_status: nil,
|
|
50
56
|
# Query param: When set to true you may use more of your alloted API rate-limit
|
|
51
57
|
include_info: nil,
|
|
52
58
|
# Query param: Maximum number of results to return
|
|
@@ -104,6 +110,37 @@ module Cadenya
|
|
|
104
110
|
)
|
|
105
111
|
end
|
|
106
112
|
|
|
113
|
+
# For bare tool calls (tool sets with no execution adapter), sets the content an
|
|
114
|
+
# external API consumer supplies for the call — used for human-in-the-loop tools
|
|
115
|
+
# and reverse harnesses that execute tools locally and report results back.
|
|
116
|
+
sig do
|
|
117
|
+
params(
|
|
118
|
+
tool_call_id: String,
|
|
119
|
+
workspace_id: String,
|
|
120
|
+
objective_id: String,
|
|
121
|
+
content:
|
|
122
|
+
T::Array[
|
|
123
|
+
Cadenya::Objectives::SetToolCallContentRequestContentBlock::OrHash
|
|
124
|
+
],
|
|
125
|
+
request_options: Cadenya::RequestOptions::OrHash
|
|
126
|
+
).returns(Cadenya::Objectives::ObjectiveToolCall)
|
|
127
|
+
end
|
|
128
|
+
def set_content(
|
|
129
|
+
# Path param: The ID of the tool call to set content for
|
|
130
|
+
tool_call_id,
|
|
131
|
+
# Path param
|
|
132
|
+
workspace_id:,
|
|
133
|
+
# Path param: The ID of the objective. Supports "external_id:" prefix for external
|
|
134
|
+
# IDs.
|
|
135
|
+
objective_id:,
|
|
136
|
+
# Body param: The content to set on the tool call. Mirrors
|
|
137
|
+
# ObjectiveToolCallResult.ContentBlock but writable: media blocks carry raw data
|
|
138
|
+
# on input where the result-side carries a signed url on output.
|
|
139
|
+
content:,
|
|
140
|
+
request_options: {}
|
|
141
|
+
)
|
|
142
|
+
end
|
|
143
|
+
|
|
107
144
|
# @api private
|
|
108
145
|
sig { params(client: Cadenya::Client).returns(T.attached_class) }
|
|
109
146
|
def self.new(client:)
|
|
@@ -267,6 +267,25 @@ module Cadenya
|
|
|
267
267
|
)
|
|
268
268
|
end
|
|
269
269
|
|
|
270
|
+
# Returns the context-usage breakdown measured for the objective's most recent
|
|
271
|
+
# iteration: character lengths per context component (system prompt, memory
|
|
272
|
+
# appendices, tool definitions, messages by role) alongside the iteration's input
|
|
273
|
+
# token counts.
|
|
274
|
+
sig do
|
|
275
|
+
params(
|
|
276
|
+
objective_id: String,
|
|
277
|
+
workspace_id: String,
|
|
278
|
+
request_options: Cadenya::RequestOptions::OrHash
|
|
279
|
+
).returns(Cadenya::Models::ObjectiveRetrieveDiagnosticsResponse)
|
|
280
|
+
end
|
|
281
|
+
def retrieve_diagnostics(
|
|
282
|
+
# The ID of the objective. Supports "external_id:" prefix for external IDs.
|
|
283
|
+
objective_id,
|
|
284
|
+
workspace_id:,
|
|
285
|
+
request_options: {}
|
|
286
|
+
)
|
|
287
|
+
end
|
|
288
|
+
|
|
270
289
|
# Streams events for an objective in real-time using server-sent events (SSE)
|
|
271
290
|
sig do
|
|
272
291
|
params(
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
module Cadenya
|
|
2
|
+
module Models
|
|
3
|
+
type context_lengths =
|
|
4
|
+
{
|
|
5
|
+
assistant_messages: Integer,
|
|
6
|
+
available_tools: Integer,
|
|
7
|
+
episodic_memory: Integer,
|
|
8
|
+
skills_memory: Integer,
|
|
9
|
+
system_prompt: Integer,
|
|
10
|
+
tool_definitions: Integer,
|
|
11
|
+
tool_results: Integer,
|
|
12
|
+
user_messages: Integer
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
class ContextLengths < Cadenya::Internal::Type::BaseModel
|
|
16
|
+
attr_accessor assistant_messages: Integer
|
|
17
|
+
|
|
18
|
+
attr_accessor available_tools: Integer
|
|
19
|
+
|
|
20
|
+
attr_accessor episodic_memory: Integer
|
|
21
|
+
|
|
22
|
+
attr_accessor skills_memory: Integer
|
|
23
|
+
|
|
24
|
+
attr_accessor system_prompt: Integer
|
|
25
|
+
|
|
26
|
+
attr_accessor tool_definitions: Integer
|
|
27
|
+
|
|
28
|
+
attr_accessor tool_results: Integer
|
|
29
|
+
|
|
30
|
+
attr_accessor user_messages: Integer
|
|
31
|
+
|
|
32
|
+
def initialize: (
|
|
33
|
+
assistant_messages: Integer,
|
|
34
|
+
available_tools: Integer,
|
|
35
|
+
episodic_memory: Integer,
|
|
36
|
+
skills_memory: Integer,
|
|
37
|
+
system_prompt: Integer,
|
|
38
|
+
tool_definitions: Integer,
|
|
39
|
+
tool_results: Integer,
|
|
40
|
+
user_messages: Integer
|
|
41
|
+
) -> void
|
|
42
|
+
|
|
43
|
+
def to_hash: -> {
|
|
44
|
+
assistant_messages: Integer,
|
|
45
|
+
available_tools: Integer,
|
|
46
|
+
episodic_memory: Integer,
|
|
47
|
+
skills_memory: Integer,
|
|
48
|
+
system_prompt: Integer,
|
|
49
|
+
tool_definitions: Integer,
|
|
50
|
+
tool_results: Integer,
|
|
51
|
+
user_messages: Integer
|
|
52
|
+
}
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
module Cadenya
|
|
2
|
+
module Models
|
|
3
|
+
type objective_diagnostics =
|
|
4
|
+
{
|
|
5
|
+
cached_input_tokens: Integer,
|
|
6
|
+
context_lengths: Cadenya::ContextLengths,
|
|
7
|
+
input_tokens: Integer
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
class ObjectiveDiagnostics < Cadenya::Internal::Type::BaseModel
|
|
11
|
+
attr_accessor cached_input_tokens: Integer
|
|
12
|
+
|
|
13
|
+
attr_accessor context_lengths: Cadenya::ContextLengths
|
|
14
|
+
|
|
15
|
+
attr_accessor input_tokens: Integer
|
|
16
|
+
|
|
17
|
+
def initialize: (
|
|
18
|
+
cached_input_tokens: Integer,
|
|
19
|
+
context_lengths: Cadenya::ContextLengths,
|
|
20
|
+
input_tokens: Integer
|
|
21
|
+
) -> void
|
|
22
|
+
|
|
23
|
+
def to_hash: -> {
|
|
24
|
+
cached_input_tokens: Integer,
|
|
25
|
+
context_lengths: Cadenya::ContextLengths,
|
|
26
|
+
input_tokens: Integer
|
|
27
|
+
}
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
module Cadenya
|
|
2
|
+
module Models
|
|
3
|
+
type objective_retrieve_diagnostics_params =
|
|
4
|
+
{ workspace_id: String, objective_id: String }
|
|
5
|
+
& Cadenya::Internal::Type::request_parameters
|
|
6
|
+
|
|
7
|
+
class ObjectiveRetrieveDiagnosticsParams < Cadenya::Internal::Type::BaseModel
|
|
8
|
+
extend Cadenya::Internal::Type::RequestParameters::Converter
|
|
9
|
+
include Cadenya::Internal::Type::RequestParameters
|
|
10
|
+
|
|
11
|
+
attr_accessor workspace_id: String
|
|
12
|
+
|
|
13
|
+
attr_accessor objective_id: String
|
|
14
|
+
|
|
15
|
+
def initialize: (
|
|
16
|
+
workspace_id: String,
|
|
17
|
+
objective_id: String,
|
|
18
|
+
?request_options: Cadenya::request_opts
|
|
19
|
+
) -> void
|
|
20
|
+
|
|
21
|
+
def to_hash: -> {
|
|
22
|
+
workspace_id: String,
|
|
23
|
+
objective_id: String,
|
|
24
|
+
request_options: Cadenya::RequestOptions
|
|
25
|
+
}
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
module Cadenya
|
|
2
|
+
module Models
|
|
3
|
+
type objective_retrieve_diagnostics_response =
|
|
4
|
+
{ diagnostics: Cadenya::ObjectiveDiagnostics }
|
|
5
|
+
|
|
6
|
+
class ObjectiveRetrieveDiagnosticsResponse < Cadenya::Internal::Type::BaseModel
|
|
7
|
+
attr_accessor diagnostics: Cadenya::ObjectiveDiagnostics
|
|
8
|
+
|
|
9
|
+
def initialize: (diagnostics: Cadenya::ObjectiveDiagnostics) -> void
|
|
10
|
+
|
|
11
|
+
def to_hash: -> { diagnostics: Cadenya::ObjectiveDiagnostics }
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|