cadenya 0.29.0 → 0.31.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/agents/agent_variation_spec_constraints.rb +15 -1
- data/lib/cadenya/models/agents/webhook_delivery_data.rb +1 -0
- data/lib/cadenya/models/agents/webhook_delivery_list_params.rb +1 -0
- data/lib/cadenya/models/objective.rb +1 -0
- data/lib/cadenya/models/objective_event_data.rb +37 -1
- data/lib/cadenya/models/objective_list_params.rb +1 -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 +2 -0
- data/lib/cadenya/resources/objectives/tool_calls.rb +53 -2
- data/lib/cadenya/version.rb +1 -1
- data/lib/cadenya.rb +7 -0
- data/rbi/cadenya/models/agents/agent_variation_spec_constraints.rbi +25 -4
- data/rbi/cadenya/models/agents/webhook_delivery_data.rbi +5 -0
- data/rbi/cadenya/models/agents/webhook_delivery_list_params.rbi +5 -0
- data/rbi/cadenya/models/objective.rbi +2 -0
- data/rbi/cadenya/models/objective_event_data.rbi +59 -0
- data/rbi/cadenya/models/objective_list_params.rbi +5 -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 +2 -0
- data/rbi/cadenya/resources/objectives/tool_calls.rbi +37 -0
- data/sig/cadenya/models/agents/agent_variation_spec_constraints.rbs +15 -2
- data/sig/cadenya/models/agents/webhook_delivery_data.rbs +2 -0
- data/sig/cadenya/models/agents/webhook_delivery_list_params.rbs +2 -0
- data/sig/cadenya/models/objective.rbs +2 -0
- data/sig/cadenya/models/objective_event_data.rbs +21 -0
- data/sig/cadenya/models/objective_list_params.rbs +2 -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 +2 -0
- data/sig/cadenya/resources/objectives/tool_calls.rbs +9 -0
- metadata +23 -2
|
@@ -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
|
@@ -231,6 +231,8 @@ module Cadenya
|
|
|
231
231
|
|
|
232
232
|
ToolSetAdapter = Cadenya::Models::ToolSetAdapter
|
|
233
233
|
|
|
234
|
+
ToolSetAdapterBare = Cadenya::Models::ToolSetAdapterBare
|
|
235
|
+
|
|
234
236
|
ToolSetAdapterHTTP = Cadenya::Models::ToolSetAdapterHTTP
|
|
235
237
|
|
|
236
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:)
|
|
@@ -4,9 +4,17 @@ module Cadenya
|
|
|
4
4
|
|
|
5
5
|
module Agents
|
|
6
6
|
type agent_variation_spec_constraints =
|
|
7
|
-
{
|
|
7
|
+
{
|
|
8
|
+
inactivity_timeout: Integer,
|
|
9
|
+
max_sub_objectives: Integer,
|
|
10
|
+
max_tool_calls: Integer
|
|
11
|
+
}
|
|
8
12
|
|
|
9
13
|
class AgentVariationSpecConstraints < Cadenya::Internal::Type::BaseModel
|
|
14
|
+
attr_reader inactivity_timeout: Integer?
|
|
15
|
+
|
|
16
|
+
def inactivity_timeout=: (Integer) -> Integer
|
|
17
|
+
|
|
10
18
|
attr_reader max_sub_objectives: Integer?
|
|
11
19
|
|
|
12
20
|
def max_sub_objectives=: (Integer) -> Integer
|
|
@@ -16,11 +24,16 @@ module Cadenya
|
|
|
16
24
|
def max_tool_calls=: (Integer) -> Integer
|
|
17
25
|
|
|
18
26
|
def initialize: (
|
|
27
|
+
?inactivity_timeout: Integer,
|
|
19
28
|
?max_sub_objectives: Integer,
|
|
20
29
|
?max_tool_calls: Integer
|
|
21
30
|
) -> void
|
|
22
31
|
|
|
23
|
-
def to_hash: -> {
|
|
32
|
+
def to_hash: -> {
|
|
33
|
+
inactivity_timeout: Integer,
|
|
34
|
+
max_sub_objectives: Integer,
|
|
35
|
+
max_tool_calls: Integer
|
|
36
|
+
}
|
|
24
37
|
end
|
|
25
38
|
end
|
|
26
39
|
end
|
|
@@ -106,6 +106,7 @@ module Cadenya
|
|
|
106
106
|
| :OBJECTIVE_EVENT_TYPE_SUB_AGENT_UPDATED
|
|
107
107
|
| :OBJECTIVE_EVENT_TYPE_FINALIZED
|
|
108
108
|
| :OBJECTIVE_EVENT_TYPE_NOTICE
|
|
109
|
+
| :OBJECTIVE_EVENT_TYPE_TIMED_OUT
|
|
109
110
|
|
|
110
111
|
module EventType
|
|
111
112
|
extend Cadenya::Internal::Type::Enum
|
|
@@ -127,6 +128,7 @@ module Cadenya
|
|
|
127
128
|
OBJECTIVE_EVENT_TYPE_SUB_AGENT_UPDATED: :OBJECTIVE_EVENT_TYPE_SUB_AGENT_UPDATED
|
|
128
129
|
OBJECTIVE_EVENT_TYPE_FINALIZED: :OBJECTIVE_EVENT_TYPE_FINALIZED
|
|
129
130
|
OBJECTIVE_EVENT_TYPE_NOTICE: :OBJECTIVE_EVENT_TYPE_NOTICE
|
|
131
|
+
OBJECTIVE_EVENT_TYPE_TIMED_OUT: :OBJECTIVE_EVENT_TYPE_TIMED_OUT
|
|
130
132
|
|
|
131
133
|
def self?.values: -> ::Array[Cadenya::Models::Agents::WebhookDeliveryData::event_type]
|
|
132
134
|
end
|
|
@@ -76,6 +76,7 @@ module Cadenya
|
|
|
76
76
|
| :OBJECTIVE_EVENT_TYPE_SUB_AGENT_UPDATED
|
|
77
77
|
| :OBJECTIVE_EVENT_TYPE_FINALIZED
|
|
78
78
|
| :OBJECTIVE_EVENT_TYPE_NOTICE
|
|
79
|
+
| :OBJECTIVE_EVENT_TYPE_TIMED_OUT
|
|
79
80
|
|
|
80
81
|
module EventType
|
|
81
82
|
extend Cadenya::Internal::Type::Enum
|
|
@@ -97,6 +98,7 @@ module Cadenya
|
|
|
97
98
|
OBJECTIVE_EVENT_TYPE_SUB_AGENT_UPDATED: :OBJECTIVE_EVENT_TYPE_SUB_AGENT_UPDATED
|
|
98
99
|
OBJECTIVE_EVENT_TYPE_FINALIZED: :OBJECTIVE_EVENT_TYPE_FINALIZED
|
|
99
100
|
OBJECTIVE_EVENT_TYPE_NOTICE: :OBJECTIVE_EVENT_TYPE_NOTICE
|
|
101
|
+
OBJECTIVE_EVENT_TYPE_TIMED_OUT: :OBJECTIVE_EVENT_TYPE_TIMED_OUT
|
|
100
102
|
|
|
101
103
|
def self?.values: -> ::Array[Cadenya::Models::Agents::WebhookDeliveryListParams::event_type]
|
|
102
104
|
end
|
|
@@ -113,6 +113,7 @@ module Cadenya
|
|
|
113
113
|
| :STATE_FAILED
|
|
114
114
|
| :STATE_CANCELLED
|
|
115
115
|
| :STATE_FINALIZED
|
|
116
|
+
| :STATE_TIMED_OUT
|
|
116
117
|
|
|
117
118
|
module State
|
|
118
119
|
extend Cadenya::Internal::Type::Enum
|
|
@@ -124,6 +125,7 @@ module Cadenya
|
|
|
124
125
|
STATE_FAILED: :STATE_FAILED
|
|
125
126
|
STATE_CANCELLED: :STATE_CANCELLED
|
|
126
127
|
STATE_FINALIZED: :STATE_FINALIZED
|
|
128
|
+
STATE_TIMED_OUT: :STATE_TIMED_OUT
|
|
127
129
|
|
|
128
130
|
def self?.values: -> ::Array[Cadenya::Models::Objective::state]
|
|
129
131
|
end
|
|
@@ -11,6 +11,7 @@ module Cadenya
|
|
|
11
11
|
notice: Cadenya::ObjectiveEventData::Notice,
|
|
12
12
|
sub_agent_spawned: Cadenya::SubAgentSpawned,
|
|
13
13
|
sub_agent_updated: Cadenya::SubAgentUpdated,
|
|
14
|
+
timed_out: Cadenya::ObjectiveEventData::TimedOut,
|
|
14
15
|
tool_approval_requested: Cadenya::ToolApprovalRequested,
|
|
15
16
|
tool_approved: Cadenya::ToolApproved,
|
|
16
17
|
tool_called: Cadenya::ToolCalled,
|
|
@@ -72,6 +73,12 @@ module Cadenya
|
|
|
72
73
|
Cadenya::SubAgentUpdated
|
|
73
74
|
) -> Cadenya::SubAgentUpdated
|
|
74
75
|
|
|
76
|
+
attr_reader timed_out: Cadenya::ObjectiveEventData::TimedOut?
|
|
77
|
+
|
|
78
|
+
def timed_out=: (
|
|
79
|
+
Cadenya::ObjectiveEventData::TimedOut
|
|
80
|
+
) -> Cadenya::ObjectiveEventData::TimedOut
|
|
81
|
+
|
|
75
82
|
attr_reader tool_approval_requested: Cadenya::ToolApprovalRequested?
|
|
76
83
|
|
|
77
84
|
def tool_approval_requested=: (
|
|
@@ -116,6 +123,7 @@ module Cadenya
|
|
|
116
123
|
?notice: Cadenya::ObjectiveEventData::Notice,
|
|
117
124
|
?sub_agent_spawned: Cadenya::SubAgentSpawned,
|
|
118
125
|
?sub_agent_updated: Cadenya::SubAgentUpdated,
|
|
126
|
+
?timed_out: Cadenya::ObjectiveEventData::TimedOut,
|
|
119
127
|
?tool_approval_requested: Cadenya::ToolApprovalRequested,
|
|
120
128
|
?tool_approved: Cadenya::ToolApproved,
|
|
121
129
|
?tool_called: Cadenya::ToolCalled,
|
|
@@ -136,6 +144,7 @@ module Cadenya
|
|
|
136
144
|
notice: Cadenya::ObjectiveEventData::Notice,
|
|
137
145
|
sub_agent_spawned: Cadenya::SubAgentSpawned,
|
|
138
146
|
sub_agent_updated: Cadenya::SubAgentUpdated,
|
|
147
|
+
timed_out: Cadenya::ObjectiveEventData::TimedOut,
|
|
139
148
|
tool_approval_requested: Cadenya::ToolApprovalRequested,
|
|
140
149
|
tool_approved: Cadenya::ToolApproved,
|
|
141
150
|
tool_called: Cadenya::ToolCalled,
|
|
@@ -216,6 +225,18 @@ module Cadenya
|
|
|
216
225
|
def self?.values: -> ::Array[Cadenya::Models::ObjectiveEventData::Notice::level]
|
|
217
226
|
end
|
|
218
227
|
end
|
|
228
|
+
|
|
229
|
+
type timed_out = { message: String }
|
|
230
|
+
|
|
231
|
+
class TimedOut < Cadenya::Internal::Type::BaseModel
|
|
232
|
+
attr_reader message: String?
|
|
233
|
+
|
|
234
|
+
def message=: (String) -> String
|
|
235
|
+
|
|
236
|
+
def initialize: (?message: String) -> void
|
|
237
|
+
|
|
238
|
+
def to_hash: -> { message: String }
|
|
239
|
+
end
|
|
219
240
|
end
|
|
220
241
|
end
|
|
221
242
|
end
|
|
@@ -95,6 +95,7 @@ module Cadenya
|
|
|
95
95
|
| :STATE_FAILED
|
|
96
96
|
| :STATE_CANCELLED
|
|
97
97
|
| :STATE_FINALIZED
|
|
98
|
+
| :STATE_TIMED_OUT
|
|
98
99
|
|
|
99
100
|
module State
|
|
100
101
|
extend Cadenya::Internal::Type::Enum
|
|
@@ -106,6 +107,7 @@ module Cadenya
|
|
|
106
107
|
STATE_FAILED: :STATE_FAILED
|
|
107
108
|
STATE_CANCELLED: :STATE_CANCELLED
|
|
108
109
|
STATE_FINALIZED: :STATE_FINALIZED
|
|
110
|
+
STATE_TIMED_OUT: :STATE_TIMED_OUT
|
|
109
111
|
|
|
110
112
|
def self?.values: -> ::Array[Cadenya::Models::ObjectiveListParams::state]
|
|
111
113
|
end
|
|
@@ -49,6 +49,7 @@ module Cadenya
|
|
|
49
49
|
| :TOOL_CALL_EXECUTION_STATUS_RUNNING
|
|
50
50
|
| :TOOL_CALL_EXECUTION_STATUS_COMPLETED
|
|
51
51
|
| :TOOL_CALL_EXECUTION_STATUS_ERRORED
|
|
52
|
+
| :TOOL_CALL_EXECUTION_STATUS_WAITING_FOR_CONTENT
|
|
52
53
|
|
|
53
54
|
module ExecutionStatus
|
|
54
55
|
extend Cadenya::Internal::Type::Enum
|
|
@@ -58,6 +59,7 @@ module Cadenya
|
|
|
58
59
|
TOOL_CALL_EXECUTION_STATUS_RUNNING: :TOOL_CALL_EXECUTION_STATUS_RUNNING
|
|
59
60
|
TOOL_CALL_EXECUTION_STATUS_COMPLETED: :TOOL_CALL_EXECUTION_STATUS_COMPLETED
|
|
60
61
|
TOOL_CALL_EXECUTION_STATUS_ERRORED: :TOOL_CALL_EXECUTION_STATUS_ERRORED
|
|
62
|
+
TOOL_CALL_EXECUTION_STATUS_WAITING_FOR_CONTENT: :TOOL_CALL_EXECUTION_STATUS_WAITING_FOR_CONTENT
|
|
61
63
|
|
|
62
64
|
def self?.values: -> ::Array[Cadenya::Models::Objectives::ObjectiveToolCall::execution_status]
|
|
63
65
|
end
|
|
@@ -63,6 +63,7 @@ module Cadenya
|
|
|
63
63
|
| :TOOL_CALL_EXECUTION_STATUS_RUNNING
|
|
64
64
|
| :TOOL_CALL_EXECUTION_STATUS_COMPLETED
|
|
65
65
|
| :TOOL_CALL_EXECUTION_STATUS_ERRORED
|
|
66
|
+
| :TOOL_CALL_EXECUTION_STATUS_WAITING_FOR_CONTENT
|
|
66
67
|
|
|
67
68
|
module ExecutionStatus
|
|
68
69
|
extend Cadenya::Internal::Type::Enum
|
|
@@ -72,6 +73,7 @@ module Cadenya
|
|
|
72
73
|
TOOL_CALL_EXECUTION_STATUS_RUNNING: :TOOL_CALL_EXECUTION_STATUS_RUNNING
|
|
73
74
|
TOOL_CALL_EXECUTION_STATUS_COMPLETED: :TOOL_CALL_EXECUTION_STATUS_COMPLETED
|
|
74
75
|
TOOL_CALL_EXECUTION_STATUS_ERRORED: :TOOL_CALL_EXECUTION_STATUS_ERRORED
|
|
76
|
+
TOOL_CALL_EXECUTION_STATUS_WAITING_FOR_CONTENT: :TOOL_CALL_EXECUTION_STATUS_WAITING_FOR_CONTENT
|
|
75
77
|
|
|
76
78
|
def self?.values: -> ::Array[Cadenya::Models::Objectives::ObjectiveToolCallWithResult::execution_status]
|
|
77
79
|
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
module Cadenya
|
|
2
|
+
module Models
|
|
3
|
+
module Objectives
|
|
4
|
+
type set_tool_call_content_request_audio_block =
|
|
5
|
+
{ data: String, mime_type: String }
|
|
6
|
+
|
|
7
|
+
class SetToolCallContentRequestAudioBlock < Cadenya::Internal::Type::BaseModel
|
|
8
|
+
attr_accessor data: String
|
|
9
|
+
|
|
10
|
+
attr_accessor mime_type: String
|
|
11
|
+
|
|
12
|
+
def initialize: (data: String, mime_type: String) -> void
|
|
13
|
+
|
|
14
|
+
def to_hash: -> { data: String, mime_type: String }
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
module Cadenya
|
|
2
|
+
module Models
|
|
3
|
+
module Objectives
|
|
4
|
+
type set_tool_call_content_request_content_block =
|
|
5
|
+
{
|
|
6
|
+
audio: Cadenya::Objectives::SetToolCallContentRequestAudioBlock,
|
|
7
|
+
image: Cadenya::Objectives::SetToolCallContentRequestImageBlock,
|
|
8
|
+
text: Cadenya::Objectives::SetToolCallContentRequestTextBlock
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
class SetToolCallContentRequestContentBlock < Cadenya::Internal::Type::BaseModel
|
|
12
|
+
attr_reader audio: Cadenya::Objectives::SetToolCallContentRequestAudioBlock?
|
|
13
|
+
|
|
14
|
+
def audio=: (
|
|
15
|
+
Cadenya::Objectives::SetToolCallContentRequestAudioBlock
|
|
16
|
+
) -> Cadenya::Objectives::SetToolCallContentRequestAudioBlock
|
|
17
|
+
|
|
18
|
+
attr_reader image: Cadenya::Objectives::SetToolCallContentRequestImageBlock?
|
|
19
|
+
|
|
20
|
+
def image=: (
|
|
21
|
+
Cadenya::Objectives::SetToolCallContentRequestImageBlock
|
|
22
|
+
) -> Cadenya::Objectives::SetToolCallContentRequestImageBlock
|
|
23
|
+
|
|
24
|
+
attr_reader text: Cadenya::Objectives::SetToolCallContentRequestTextBlock?
|
|
25
|
+
|
|
26
|
+
def text=: (
|
|
27
|
+
Cadenya::Objectives::SetToolCallContentRequestTextBlock
|
|
28
|
+
) -> Cadenya::Objectives::SetToolCallContentRequestTextBlock
|
|
29
|
+
|
|
30
|
+
def initialize: (
|
|
31
|
+
?audio: Cadenya::Objectives::SetToolCallContentRequestAudioBlock,
|
|
32
|
+
?image: Cadenya::Objectives::SetToolCallContentRequestImageBlock,
|
|
33
|
+
?text: Cadenya::Objectives::SetToolCallContentRequestTextBlock
|
|
34
|
+
) -> void
|
|
35
|
+
|
|
36
|
+
def to_hash: -> {
|
|
37
|
+
audio: Cadenya::Objectives::SetToolCallContentRequestAudioBlock,
|
|
38
|
+
image: Cadenya::Objectives::SetToolCallContentRequestImageBlock,
|
|
39
|
+
text: Cadenya::Objectives::SetToolCallContentRequestTextBlock
|
|
40
|
+
}
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
module Cadenya
|
|
2
|
+
module Models
|
|
3
|
+
module Objectives
|
|
4
|
+
type set_tool_call_content_request_image_block =
|
|
5
|
+
{ data: String, mime_type: String }
|
|
6
|
+
|
|
7
|
+
class SetToolCallContentRequestImageBlock < Cadenya::Internal::Type::BaseModel
|
|
8
|
+
attr_accessor data: String
|
|
9
|
+
|
|
10
|
+
attr_accessor mime_type: String
|
|
11
|
+
|
|
12
|
+
def initialize: (data: String, mime_type: String) -> void
|
|
13
|
+
|
|
14
|
+
def to_hash: -> { data: String, mime_type: String }
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
module Cadenya
|
|
2
|
+
module Models
|
|
3
|
+
module Objectives
|
|
4
|
+
type set_tool_call_content_request_text_block = { text: String }
|
|
5
|
+
|
|
6
|
+
class SetToolCallContentRequestTextBlock < Cadenya::Internal::Type::BaseModel
|
|
7
|
+
attr_accessor text: String
|
|
8
|
+
|
|
9
|
+
def initialize: (text: String) -> void
|
|
10
|
+
|
|
11
|
+
def to_hash: -> { text: String }
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|