cadenya 1.4.0 → 1.6.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/api.md +48 -0
- data/lib/cadenya/client.rb +3 -2
- data/lib/cadenya/resources/agent_pools.rb +108 -0
- data/lib/cadenya/types.rb +576 -5
- data/lib/cadenya.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ae66411f710ec4a8a1179bb0808b5d2a833e23941002f10e306f0740c13330c2
|
|
4
|
+
data.tar.gz: 38707e94f11ebd1852aef385b9a61421aee21071b6fab2c59b9c3606a8f8e4a6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 20431f93c5ef100493776c4c36a2b70a0ca01ff14493c419df5f31e637cedaffd2a3b8f2b93144bc3bf3d19186e618b9c3dec4e37d5deb6ff19435dd540a5ba9
|
|
7
|
+
data.tar.gz: 2080ef8b4f1c54c33760380a2c9da415a43ce581c2eb48b1164104bcf360ad3067ffd3dce09082edbf69b94723df7206d0854ce63930688a28bb72d6e2d0dfdd
|
data/api.md
CHANGED
|
@@ -147,6 +147,54 @@ List workspaces
|
|
|
147
147
|
client.workspaces.list(limit: nil, cursor: nil, sort_order: nil, include_info: nil, labels: nil) # => Cadenya::Page of Cadenya::Types::Workspace
|
|
148
148
|
```
|
|
149
149
|
|
|
150
|
+
## client.agent_pools
|
|
151
|
+
|
|
152
|
+
List agent pools
|
|
153
|
+
|
|
154
|
+
```ruby
|
|
155
|
+
client.agent_pools.list(workspace_id: nil, limit: nil, cursor: nil, prefix: nil, query: nil, state: nil, labels: nil, sort_order: nil, include_info: nil) # => Cadenya::Page of Cadenya::Types::AgentPool
|
|
156
|
+
```
|
|
157
|
+
Create a new agent pool
|
|
158
|
+
|
|
159
|
+
```ruby
|
|
160
|
+
client.agent_pools.create(metadata:, spec:, workspace_id: nil) # => Cadenya::Types::AgentPool
|
|
161
|
+
```
|
|
162
|
+
Get an agent pool by ID
|
|
163
|
+
|
|
164
|
+
```ruby
|
|
165
|
+
client.agent_pools.retrieve(id, workspace_id: nil) # => Cadenya::Types::AgentPool
|
|
166
|
+
```
|
|
167
|
+
Delete an agent pool
|
|
168
|
+
|
|
169
|
+
```ruby
|
|
170
|
+
client.agent_pools.delete(id, workspace_id: nil) # => nil
|
|
171
|
+
```
|
|
172
|
+
Update an agent pool
|
|
173
|
+
|
|
174
|
+
```ruby
|
|
175
|
+
client.agent_pools.update(id, workspace_id: nil, metadata: nil, spec: nil, update_mask: nil) # => Cadenya::Types::AgentPool
|
|
176
|
+
```
|
|
177
|
+
Activate an agent pool
|
|
178
|
+
|
|
179
|
+
```ruby
|
|
180
|
+
client.agent_pools.activate(id, workspace_id: nil) # => Cadenya::Types::AgentPool
|
|
181
|
+
```
|
|
182
|
+
Archive an agent pool
|
|
183
|
+
|
|
184
|
+
```ruby
|
|
185
|
+
client.agent_pools.archive(id, workspace_id: nil) # => Cadenya::Types::AgentPool
|
|
186
|
+
```
|
|
187
|
+
Deactivate an agent pool
|
|
188
|
+
|
|
189
|
+
```ruby
|
|
190
|
+
client.agent_pools.deactivate(id, workspace_id: nil) # => Cadenya::Types::AgentPool
|
|
191
|
+
```
|
|
192
|
+
Unarchive an agent pool
|
|
193
|
+
|
|
194
|
+
```ruby
|
|
195
|
+
client.agent_pools.unarchive(id, workspace_id: nil) # => Cadenya::Types::AgentPool
|
|
196
|
+
```
|
|
197
|
+
|
|
150
198
|
## client.agents
|
|
151
199
|
|
|
152
200
|
List agents
|
data/lib/cadenya/client.rb
CHANGED
|
@@ -8,7 +8,7 @@ module Cadenya
|
|
|
8
8
|
# The Cadenya API client. Resource groups are readers; unset options are
|
|
9
9
|
# read from the environment.
|
|
10
10
|
class Client
|
|
11
|
-
attr_reader :accounts, :api_keys, :workspace_admin, :profiles, :workspaces, :agents, :ai_provider_keys, :models, :memory_layers, :objectives, :tool_search, :tenants, :tool_sets, :uploads, :widget_sessions, :widgets, :workspace_secrets
|
|
11
|
+
attr_reader :accounts, :api_keys, :workspace_admin, :profiles, :workspaces, :agent_pools, :agents, :ai_provider_keys, :models, :memory_layers, :objectives, :tool_search, :tenants, :tool_sets, :uploads, :widget_sessions, :widgets, :workspace_secrets
|
|
12
12
|
|
|
13
13
|
def initialize(api_key: nil, base_url: nil, webhook_secret: nil, max_retries: 0, connection: nil, stream_transport: nil, workspace_id: nil)
|
|
14
14
|
if !api_key.nil? && api_key.to_s.strip.empty?
|
|
@@ -37,7 +37,7 @@ module Cadenya
|
|
|
37
37
|
auth_header: ["Authorization", "Bearer #{api_key}"],
|
|
38
38
|
max_retries: max_retries,
|
|
39
39
|
defaults: defaults,
|
|
40
|
-
user_agent: "cadenya-ruby/1.
|
|
40
|
+
user_agent: "cadenya-ruby/1.5.0 (api 1.0)",
|
|
41
41
|
connection: connection,
|
|
42
42
|
stream_transport: stream_transport
|
|
43
43
|
)
|
|
@@ -46,6 +46,7 @@ module Cadenya
|
|
|
46
46
|
@workspace_admin = Resources::WorkspaceAdmin.new(core)
|
|
47
47
|
@profiles = Resources::Profiles.new(core)
|
|
48
48
|
@workspaces = Resources::Workspaces.new(core)
|
|
49
|
+
@agent_pools = Resources::AgentPools.new(core)
|
|
49
50
|
@agents = Resources::Agents.new(core)
|
|
50
51
|
@ai_provider_keys = Resources::AiProviderKeys.new(core)
|
|
51
52
|
@models = Resources::Models.new(core)
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Code generated by redwood. DO NOT EDIT.
|
|
4
|
+
|
|
5
|
+
module Cadenya
|
|
6
|
+
module Resources
|
|
7
|
+
class AgentPools
|
|
8
|
+
def initialize(core)
|
|
9
|
+
@core = core
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
# List agent pools
|
|
13
|
+
def list(workspace_id: nil, limit: nil, cursor: nil, prefix: nil, query: nil, state: nil, labels: nil, sort_order: nil, include_info: nil, request_options: nil)
|
|
14
|
+
workspace_id = @core.resolve_default("workspaceId", "CADENYA_WORKSPACE_ID", workspace_id)
|
|
15
|
+
_path = "/v1/workspaces/#{Util.path_param('workspaceId', workspace_id)}/agent_pools"
|
|
16
|
+
_query = {
|
|
17
|
+
"limit" => limit,
|
|
18
|
+
"cursor" => cursor,
|
|
19
|
+
"prefix" => prefix,
|
|
20
|
+
"query" => query,
|
|
21
|
+
"state" => state,
|
|
22
|
+
"labels" => labels,
|
|
23
|
+
"sortOrder" => sort_order,
|
|
24
|
+
"includeInfo" => include_info,
|
|
25
|
+
}
|
|
26
|
+
_data = @core.request(:get, _path, query: _query, request_options: request_options) || {}
|
|
27
|
+
_items = (_data["items"] || []).map { |item| Types::AgentPool.from_json(item) }
|
|
28
|
+
_next_cursor = (((_data)["pagination"] || {}))["nextCursor"].to_s
|
|
29
|
+
Page.new(_items, _next_cursor) do |_c|
|
|
30
|
+
list(workspace_id: workspace_id, limit: limit, cursor: _c, prefix: prefix, query: query, state: state, labels: labels, sort_order: sort_order, include_info: include_info, request_options: request_options)
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# Create a new agent pool
|
|
35
|
+
def create(metadata:, spec:, workspace_id: nil, request_options: nil)
|
|
36
|
+
workspace_id = @core.resolve_default("workspaceId", "CADENYA_WORKSPACE_ID", workspace_id)
|
|
37
|
+
_path = "/v1/workspaces/#{Util.path_param('workspaceId', workspace_id)}/agent_pools"
|
|
38
|
+
_body = {
|
|
39
|
+
"metadata" => metadata.nil? ? nil : (->(_v) { Types.encode_CreateResourceMetadata(_v) }).call(metadata),
|
|
40
|
+
"spec" => spec.nil? ? nil : (->(_v) { Types.encode_AgentPoolSpec(_v) }).call(spec),
|
|
41
|
+
}.reject { |_k, v| v.nil? }
|
|
42
|
+
_data = @core.request(:post, _path, body: _body, request_options: request_options)
|
|
43
|
+
Types::AgentPool.from_json(_data)
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# Get an agent pool by ID
|
|
47
|
+
def retrieve(id, workspace_id: nil, request_options: nil)
|
|
48
|
+
workspace_id = @core.resolve_default("workspaceId", "CADENYA_WORKSPACE_ID", workspace_id)
|
|
49
|
+
_path = "/v1/workspaces/#{Util.path_param('workspaceId', workspace_id)}/agent_pools/#{Util.path_param('id', id)}"
|
|
50
|
+
_data = @core.request(:get, _path, request_options: request_options)
|
|
51
|
+
Types::AgentPool.from_json(_data)
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Delete an agent pool
|
|
55
|
+
def delete(id, workspace_id: nil, request_options: nil)
|
|
56
|
+
workspace_id = @core.resolve_default("workspaceId", "CADENYA_WORKSPACE_ID", workspace_id)
|
|
57
|
+
_path = "/v1/workspaces/#{Util.path_param('workspaceId', workspace_id)}/agent_pools/#{Util.path_param('id', id)}"
|
|
58
|
+
@core.request(:delete, _path, expects_body: false, request_options: request_options)
|
|
59
|
+
nil
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Update an agent pool
|
|
63
|
+
def update(id, workspace_id: nil, metadata: nil, spec: nil, update_mask: nil, request_options: nil)
|
|
64
|
+
workspace_id = @core.resolve_default("workspaceId", "CADENYA_WORKSPACE_ID", workspace_id)
|
|
65
|
+
_path = "/v1/workspaces/#{Util.path_param('workspaceId', workspace_id)}/agent_pools/#{Util.path_param('id', id)}"
|
|
66
|
+
_body = {
|
|
67
|
+
"metadata" => metadata.nil? ? nil : (->(_v) { Types.encode_UpdateResourceMetadata(_v) }).call(metadata),
|
|
68
|
+
"spec" => spec.nil? ? nil : (->(_v) { Types.encode_AgentPoolUpdateSpec(_v) }).call(spec),
|
|
69
|
+
"updateMask" => update_mask,
|
|
70
|
+
}.reject { |_k, v| v.nil? }
|
|
71
|
+
_data = @core.request(:patch, _path, body: _body, request_options: request_options)
|
|
72
|
+
Types::AgentPool.from_json(_data)
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# Activate an agent pool
|
|
76
|
+
def activate(id, workspace_id: nil, request_options: nil)
|
|
77
|
+
workspace_id = @core.resolve_default("workspaceId", "CADENYA_WORKSPACE_ID", workspace_id)
|
|
78
|
+
_path = "/v1/workspaces/#{Util.path_param('workspaceId', workspace_id)}/agent_pools/#{Util.path_param('id', id)}:activate"
|
|
79
|
+
_data = @core.request(:post, _path, request_options: request_options)
|
|
80
|
+
Types::AgentPool.from_json(_data)
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# Archive an agent pool
|
|
84
|
+
def archive(id, workspace_id: nil, request_options: nil)
|
|
85
|
+
workspace_id = @core.resolve_default("workspaceId", "CADENYA_WORKSPACE_ID", workspace_id)
|
|
86
|
+
_path = "/v1/workspaces/#{Util.path_param('workspaceId', workspace_id)}/agent_pools/#{Util.path_param('id', id)}:archive"
|
|
87
|
+
_data = @core.request(:post, _path, request_options: request_options)
|
|
88
|
+
Types::AgentPool.from_json(_data)
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
# Deactivate an agent pool
|
|
92
|
+
def deactivate(id, workspace_id: nil, request_options: nil)
|
|
93
|
+
workspace_id = @core.resolve_default("workspaceId", "CADENYA_WORKSPACE_ID", workspace_id)
|
|
94
|
+
_path = "/v1/workspaces/#{Util.path_param('workspaceId', workspace_id)}/agent_pools/#{Util.path_param('id', id)}:deactivate"
|
|
95
|
+
_data = @core.request(:post, _path, request_options: request_options)
|
|
96
|
+
Types::AgentPool.from_json(_data)
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# Unarchive an agent pool
|
|
100
|
+
def unarchive(id, workspace_id: nil, request_options: nil)
|
|
101
|
+
workspace_id = @core.resolve_default("workspaceId", "CADENYA_WORKSPACE_ID", workspace_id)
|
|
102
|
+
_path = "/v1/workspaces/#{Util.path_param('workspaceId', workspace_id)}/agent_pools/#{Util.path_param('id', id)}:unarchive"
|
|
103
|
+
_data = @core.request(:post, _path, request_options: request_options)
|
|
104
|
+
Types::AgentPool.from_json(_data)
|
|
105
|
+
end
|
|
106
|
+
end
|
|
107
|
+
end
|
|
108
|
+
end
|
data/lib/cadenya/types.rb
CHANGED
|
@@ -399,6 +399,29 @@ module Cadenya
|
|
|
399
399
|
end
|
|
400
400
|
end
|
|
401
401
|
|
|
402
|
+
class ActivateAgentPoolRequest
|
|
403
|
+
attr_reader :workspace_id, :id
|
|
404
|
+
|
|
405
|
+
def initialize(workspace_id: nil, id: nil)
|
|
406
|
+
@workspace_id = workspace_id
|
|
407
|
+
@id = id
|
|
408
|
+
end
|
|
409
|
+
|
|
410
|
+
def self.from_json(data)
|
|
411
|
+
new(
|
|
412
|
+
workspace_id: data["workspaceId"],
|
|
413
|
+
id: data["id"],
|
|
414
|
+
)
|
|
415
|
+
end
|
|
416
|
+
|
|
417
|
+
def to_h
|
|
418
|
+
{
|
|
419
|
+
workspace_id: Util.plain(@workspace_id),
|
|
420
|
+
id: Util.plain(@id),
|
|
421
|
+
}.reject { |_k, v| v.nil? }
|
|
422
|
+
end
|
|
423
|
+
end
|
|
424
|
+
|
|
402
425
|
def self.decode_AddAgentVariationAssignmentRequest(data)
|
|
403
426
|
return nil if data.nil? || data["type"].to_s.empty?
|
|
404
427
|
case data["type"]
|
|
@@ -408,6 +431,8 @@ module Cadenya
|
|
|
408
431
|
Types::AddAgentVariationAssignmentRequest_ToolSetId.from_json(data)
|
|
409
432
|
when "subAgentId"
|
|
410
433
|
Types::AddAgentVariationAssignmentRequest_SubAgentId.from_json(data)
|
|
434
|
+
when "agentPoolId"
|
|
435
|
+
Types::AddAgentVariationAssignmentRequest_AgentPoolId.from_json(data)
|
|
411
436
|
else
|
|
412
437
|
raise ArgumentError, "AddAgentVariationAssignmentRequest: unknown type #{data["type"].inspect}"
|
|
413
438
|
end
|
|
@@ -525,6 +550,138 @@ module Cadenya
|
|
|
525
550
|
end
|
|
526
551
|
end
|
|
527
552
|
|
|
553
|
+
AgentPoolState = ["AGENT_POOL_STATE_UNSPECIFIED", "AGENT_POOL_STATE_ACTIVE", "AGENT_POOL_STATE_INACTIVE", "AGENT_POOL_STATE_ARCHIVED"].freeze
|
|
554
|
+
|
|
555
|
+
class AgentPool
|
|
556
|
+
attr_reader :metadata, :spec, :info, :state
|
|
557
|
+
|
|
558
|
+
def initialize(metadata: nil, spec: nil, info: nil, state: nil)
|
|
559
|
+
@metadata = metadata
|
|
560
|
+
@spec = spec
|
|
561
|
+
@info = info
|
|
562
|
+
@state = state
|
|
563
|
+
end
|
|
564
|
+
|
|
565
|
+
def self.from_json(data)
|
|
566
|
+
new(
|
|
567
|
+
metadata: data["metadata"].nil? ? nil : Types::ResourceMetadata.from_json(data["metadata"]),
|
|
568
|
+
spec: data["spec"].nil? ? nil : Types::AgentPoolSpec.from_json(data["spec"]),
|
|
569
|
+
info: data["info"].nil? ? nil : Types::AgentPoolInfo.from_json(data["info"]),
|
|
570
|
+
state: data["state"],
|
|
571
|
+
)
|
|
572
|
+
end
|
|
573
|
+
|
|
574
|
+
def to_h
|
|
575
|
+
{
|
|
576
|
+
metadata: Util.plain(@metadata),
|
|
577
|
+
spec: Util.plain(@spec),
|
|
578
|
+
info: Util.plain(@info),
|
|
579
|
+
state: Util.plain(@state),
|
|
580
|
+
}.reject { |_k, v| v.nil? }
|
|
581
|
+
end
|
|
582
|
+
end
|
|
583
|
+
|
|
584
|
+
class AgentPoolAssignment
|
|
585
|
+
attr_reader :agent_id
|
|
586
|
+
|
|
587
|
+
def initialize(agent_id: nil)
|
|
588
|
+
@agent_id = agent_id
|
|
589
|
+
end
|
|
590
|
+
|
|
591
|
+
def self.from_json(data)
|
|
592
|
+
new(
|
|
593
|
+
agent_id: data["agentId"],
|
|
594
|
+
)
|
|
595
|
+
end
|
|
596
|
+
|
|
597
|
+
def to_h
|
|
598
|
+
{
|
|
599
|
+
agent_id: Util.plain(@agent_id),
|
|
600
|
+
}.reject { |_k, v| v.nil? }
|
|
601
|
+
end
|
|
602
|
+
end
|
|
603
|
+
|
|
604
|
+
class AgentPoolInfo
|
|
605
|
+
attr_reader :assigned_agents, :created_by
|
|
606
|
+
|
|
607
|
+
def initialize(assigned_agents: nil, created_by: nil)
|
|
608
|
+
@assigned_agents = assigned_agents
|
|
609
|
+
@created_by = created_by
|
|
610
|
+
end
|
|
611
|
+
|
|
612
|
+
def self.from_json(data)
|
|
613
|
+
new(
|
|
614
|
+
assigned_agents: data["assignedAgents"],
|
|
615
|
+
created_by: data["createdBy"].nil? ? nil : Types::Profile.from_json(data["createdBy"]),
|
|
616
|
+
)
|
|
617
|
+
end
|
|
618
|
+
|
|
619
|
+
def to_h
|
|
620
|
+
{
|
|
621
|
+
assigned_agents: Util.plain(@assigned_agents),
|
|
622
|
+
created_by: Util.plain(@created_by),
|
|
623
|
+
}.reject { |_k, v| v.nil? }
|
|
624
|
+
end
|
|
625
|
+
end
|
|
626
|
+
|
|
627
|
+
class AgentPoolSpec
|
|
628
|
+
attr_reader :description, :state, :assignments, :instructions
|
|
629
|
+
|
|
630
|
+
def initialize(description: nil, state: nil, assignments: nil, instructions: nil)
|
|
631
|
+
@description = description
|
|
632
|
+
@state = state
|
|
633
|
+
@assignments = assignments
|
|
634
|
+
@instructions = instructions
|
|
635
|
+
end
|
|
636
|
+
|
|
637
|
+
def self.from_json(data)
|
|
638
|
+
new(
|
|
639
|
+
description: data["description"],
|
|
640
|
+
state: data["state"],
|
|
641
|
+
assignments: data["assignments"].nil? ? nil : (data["assignments"]).map { |item| Types::AgentPoolAssignment.from_json(item) },
|
|
642
|
+
instructions: data["instructions"],
|
|
643
|
+
)
|
|
644
|
+
end
|
|
645
|
+
|
|
646
|
+
def to_h
|
|
647
|
+
{
|
|
648
|
+
description: Util.plain(@description),
|
|
649
|
+
state: Util.plain(@state),
|
|
650
|
+
assignments: Util.plain(@assignments),
|
|
651
|
+
instructions: Util.plain(@instructions),
|
|
652
|
+
}.reject { |_k, v| v.nil? }
|
|
653
|
+
end
|
|
654
|
+
end
|
|
655
|
+
|
|
656
|
+
class AgentPoolUpdateSpec
|
|
657
|
+
attr_reader :description, :state, :assignments, :instructions
|
|
658
|
+
|
|
659
|
+
def initialize(description: nil, state: nil, assignments: nil, instructions: nil)
|
|
660
|
+
@description = description
|
|
661
|
+
@state = state
|
|
662
|
+
@assignments = assignments
|
|
663
|
+
@instructions = instructions
|
|
664
|
+
end
|
|
665
|
+
|
|
666
|
+
def self.from_json(data)
|
|
667
|
+
new(
|
|
668
|
+
description: data["description"],
|
|
669
|
+
state: data["state"],
|
|
670
|
+
assignments: data["assignments"].nil? ? nil : (data["assignments"]).map { |item| Types::AgentPoolAssignment.from_json(item) },
|
|
671
|
+
instructions: data["instructions"],
|
|
672
|
+
)
|
|
673
|
+
end
|
|
674
|
+
|
|
675
|
+
def to_h
|
|
676
|
+
{
|
|
677
|
+
description: Util.plain(@description),
|
|
678
|
+
state: Util.plain(@state),
|
|
679
|
+
assignments: Util.plain(@assignments),
|
|
680
|
+
instructions: Util.plain(@instructions),
|
|
681
|
+
}.reject { |_k, v| v.nil? }
|
|
682
|
+
end
|
|
683
|
+
end
|
|
684
|
+
|
|
528
685
|
AgentScheduleState = ["STATE_UNSPECIFIED", "STATE_ACTIVE", "STATE_PAUSED", "STATE_ARCHIVED"].freeze
|
|
529
686
|
|
|
530
687
|
class AgentSchedule
|
|
@@ -724,9 +881,9 @@ module Cadenya
|
|
|
724
881
|
end
|
|
725
882
|
|
|
726
883
|
class AgentVariationInfo
|
|
727
|
-
attr_reader :tool_count, :tool_set_count, :sub_agent_count, :created_by, :model, :score, :feedback_count, :memory_layer_count, :effective_tool_count, :assignment_metadata
|
|
884
|
+
attr_reader :tool_count, :tool_set_count, :sub_agent_count, :created_by, :model, :score, :feedback_count, :memory_layer_count, :effective_tool_count, :assignment_metadata, :agent_pool_count
|
|
728
885
|
|
|
729
|
-
def initialize(tool_count: nil, tool_set_count: nil, sub_agent_count: nil, created_by: nil, model: nil, score: nil, feedback_count: nil, memory_layer_count: nil, effective_tool_count: nil, assignment_metadata: nil)
|
|
886
|
+
def initialize(tool_count: nil, tool_set_count: nil, sub_agent_count: nil, created_by: nil, model: nil, score: nil, feedback_count: nil, memory_layer_count: nil, effective_tool_count: nil, assignment_metadata: nil, agent_pool_count: nil)
|
|
730
887
|
@tool_count = tool_count
|
|
731
888
|
@tool_set_count = tool_set_count
|
|
732
889
|
@sub_agent_count = sub_agent_count
|
|
@@ -737,6 +894,7 @@ module Cadenya
|
|
|
737
894
|
@memory_layer_count = memory_layer_count
|
|
738
895
|
@effective_tool_count = effective_tool_count
|
|
739
896
|
@assignment_metadata = assignment_metadata
|
|
897
|
+
@agent_pool_count = agent_pool_count
|
|
740
898
|
end
|
|
741
899
|
|
|
742
900
|
def self.from_json(data)
|
|
@@ -751,6 +909,7 @@ module Cadenya
|
|
|
751
909
|
memory_layer_count: data["memoryLayerCount"],
|
|
752
910
|
effective_tool_count: data["effectiveToolCount"],
|
|
753
911
|
assignment_metadata: data["assignmentMetadata"].nil? ? nil : (data["assignmentMetadata"]).transform_values { |v| Types::BareMetadata.from_json(v) },
|
|
912
|
+
agent_pool_count: data["agentPoolCount"],
|
|
754
913
|
)
|
|
755
914
|
end
|
|
756
915
|
|
|
@@ -766,6 +925,7 @@ module Cadenya
|
|
|
766
925
|
memory_layer_count: Util.plain(@memory_layer_count),
|
|
767
926
|
effective_tool_count: Util.plain(@effective_tool_count),
|
|
768
927
|
assignment_metadata: Util.plain(@assignment_metadata),
|
|
928
|
+
agent_pool_count: Util.plain(@agent_pool_count),
|
|
769
929
|
}.reject { |_k, v| v.nil? }
|
|
770
930
|
end
|
|
771
931
|
end
|
|
@@ -958,6 +1118,29 @@ module Cadenya
|
|
|
958
1118
|
end
|
|
959
1119
|
end
|
|
960
1120
|
|
|
1121
|
+
class ArchiveAgentPoolRequest
|
|
1122
|
+
attr_reader :workspace_id, :id
|
|
1123
|
+
|
|
1124
|
+
def initialize(workspace_id: nil, id: nil)
|
|
1125
|
+
@workspace_id = workspace_id
|
|
1126
|
+
@id = id
|
|
1127
|
+
end
|
|
1128
|
+
|
|
1129
|
+
def self.from_json(data)
|
|
1130
|
+
new(
|
|
1131
|
+
workspace_id: data["workspaceId"],
|
|
1132
|
+
id: data["id"],
|
|
1133
|
+
)
|
|
1134
|
+
end
|
|
1135
|
+
|
|
1136
|
+
def to_h
|
|
1137
|
+
{
|
|
1138
|
+
workspace_id: Util.plain(@workspace_id),
|
|
1139
|
+
id: Util.plain(@id),
|
|
1140
|
+
}.reject { |_k, v| v.nil? }
|
|
1141
|
+
end
|
|
1142
|
+
end
|
|
1143
|
+
|
|
961
1144
|
class ArchiveAgentRequest
|
|
962
1145
|
attr_reader :workspace_id, :id
|
|
963
1146
|
|
|
@@ -1154,6 +1337,8 @@ module Cadenya
|
|
|
1154
1337
|
Types::CallableTool_Agent.from_json(data)
|
|
1155
1338
|
when "cadenyaProvidedTool"
|
|
1156
1339
|
Types::CallableTool_CadenyaProvidedTool.from_json(data)
|
|
1340
|
+
when "agentPool"
|
|
1341
|
+
Types::CallableTool_AgentPool.from_json(data)
|
|
1157
1342
|
else
|
|
1158
1343
|
raise ArgumentError, "CallableTool: unknown type #{data["type"].inspect}"
|
|
1159
1344
|
end
|
|
@@ -1640,6 +1825,32 @@ module Cadenya
|
|
|
1640
1825
|
end
|
|
1641
1826
|
end
|
|
1642
1827
|
|
|
1828
|
+
class CreateAgentPoolRequest
|
|
1829
|
+
attr_reader :workspace_id, :metadata, :spec
|
|
1830
|
+
|
|
1831
|
+
def initialize(workspace_id: nil, metadata: nil, spec: nil)
|
|
1832
|
+
@workspace_id = workspace_id
|
|
1833
|
+
@metadata = metadata
|
|
1834
|
+
@spec = spec
|
|
1835
|
+
end
|
|
1836
|
+
|
|
1837
|
+
def self.from_json(data)
|
|
1838
|
+
new(
|
|
1839
|
+
workspace_id: data["workspaceId"],
|
|
1840
|
+
metadata: data["metadata"].nil? ? nil : Types::CreateResourceMetadata.from_json(data["metadata"]),
|
|
1841
|
+
spec: data["spec"].nil? ? nil : Types::AgentPoolSpec.from_json(data["spec"]),
|
|
1842
|
+
)
|
|
1843
|
+
end
|
|
1844
|
+
|
|
1845
|
+
def to_h
|
|
1846
|
+
{
|
|
1847
|
+
workspace_id: Util.plain(@workspace_id),
|
|
1848
|
+
metadata: Util.plain(@metadata),
|
|
1849
|
+
spec: Util.plain(@spec),
|
|
1850
|
+
}.reject { |_k, v| v.nil? }
|
|
1851
|
+
end
|
|
1852
|
+
end
|
|
1853
|
+
|
|
1643
1854
|
class CreateAgentRequest
|
|
1644
1855
|
attr_reader :workspace_id, :metadata, :spec, :default_variation
|
|
1645
1856
|
|
|
@@ -2291,6 +2502,29 @@ module Cadenya
|
|
|
2291
2502
|
end
|
|
2292
2503
|
end
|
|
2293
2504
|
|
|
2505
|
+
class DeactivateAgentPoolRequest
|
|
2506
|
+
attr_reader :workspace_id, :id
|
|
2507
|
+
|
|
2508
|
+
def initialize(workspace_id: nil, id: nil)
|
|
2509
|
+
@workspace_id = workspace_id
|
|
2510
|
+
@id = id
|
|
2511
|
+
end
|
|
2512
|
+
|
|
2513
|
+
def self.from_json(data)
|
|
2514
|
+
new(
|
|
2515
|
+
workspace_id: data["workspaceId"],
|
|
2516
|
+
id: data["id"],
|
|
2517
|
+
)
|
|
2518
|
+
end
|
|
2519
|
+
|
|
2520
|
+
def to_h
|
|
2521
|
+
{
|
|
2522
|
+
workspace_id: Util.plain(@workspace_id),
|
|
2523
|
+
id: Util.plain(@id),
|
|
2524
|
+
}.reject { |_k, v| v.nil? }
|
|
2525
|
+
end
|
|
2526
|
+
end
|
|
2527
|
+
|
|
2294
2528
|
class DeleteTenantWidgetSessionsResponse
|
|
2295
2529
|
attr_reader :sessions_deleted, :objectives_deleted
|
|
2296
2530
|
|
|
@@ -2587,6 +2821,29 @@ module Cadenya
|
|
|
2587
2821
|
end
|
|
2588
2822
|
end
|
|
2589
2823
|
|
|
2824
|
+
class ListAgentPoolsResponse
|
|
2825
|
+
attr_reader :items, :pagination
|
|
2826
|
+
|
|
2827
|
+
def initialize(items: nil, pagination: nil)
|
|
2828
|
+
@items = items
|
|
2829
|
+
@pagination = pagination
|
|
2830
|
+
end
|
|
2831
|
+
|
|
2832
|
+
def self.from_json(data)
|
|
2833
|
+
new(
|
|
2834
|
+
items: data["items"].nil? ? nil : (data["items"]).map { |item| Types::AgentPool.from_json(item) },
|
|
2835
|
+
pagination: data["pagination"].nil? ? nil : Types::Page.from_json(data["pagination"]),
|
|
2836
|
+
)
|
|
2837
|
+
end
|
|
2838
|
+
|
|
2839
|
+
def to_h
|
|
2840
|
+
{
|
|
2841
|
+
items: Util.plain(@items),
|
|
2842
|
+
pagination: Util.plain(@pagination),
|
|
2843
|
+
}.reject { |_k, v| v.nil? }
|
|
2844
|
+
end
|
|
2845
|
+
end
|
|
2846
|
+
|
|
2590
2847
|
class ListAgentSchedulesResponse
|
|
2591
2848
|
attr_reader :items, :pagination
|
|
2592
2849
|
|
|
@@ -4932,6 +5189,8 @@ module Cadenya
|
|
|
4932
5189
|
Types::RemoveAgentVariationAssignmentRequest_ToolSetId.from_json(data)
|
|
4933
5190
|
when "subAgentId"
|
|
4934
5191
|
Types::RemoveAgentVariationAssignmentRequest_SubAgentId.from_json(data)
|
|
5192
|
+
when "agentPoolId"
|
|
5193
|
+
Types::RemoveAgentVariationAssignmentRequest_AgentPoolId.from_json(data)
|
|
4935
5194
|
else
|
|
4936
5195
|
raise ArgumentError, "RemoveAgentVariationAssignmentRequest: unknown type #{data["type"].inspect}"
|
|
4937
5196
|
end
|
|
@@ -5457,6 +5716,12 @@ module Cadenya
|
|
|
5457
5716
|
end
|
|
5458
5717
|
end
|
|
5459
5718
|
|
|
5719
|
+
def self.decode_StatusDetails(data)
|
|
5720
|
+
return Types::WidgetSessionErrorInfo.from_json(data) if data.is_a?(Hash) && ["@type", "domain", "reason"].all? { |k| data.key?(k) }
|
|
5721
|
+
return Types::GoogleProtobufAny.from_json(data) if data.is_a?(Hash)
|
|
5722
|
+
raise ArgumentError, "StatusDetails: no variant matched"
|
|
5723
|
+
end
|
|
5724
|
+
|
|
5460
5725
|
class Status
|
|
5461
5726
|
attr_reader :code, :message, :details
|
|
5462
5727
|
|
|
@@ -5470,7 +5735,7 @@ module Cadenya
|
|
|
5470
5735
|
new(
|
|
5471
5736
|
code: data["code"],
|
|
5472
5737
|
message: data["message"],
|
|
5473
|
-
details: data["details"].nil? ? nil : (data["details"]).map { |item| Types
|
|
5738
|
+
details: data["details"].nil? ? nil : (data["details"]).map { |item| Types.decode_StatusDetails(item) },
|
|
5474
5739
|
)
|
|
5475
5740
|
end
|
|
5476
5741
|
|
|
@@ -6707,6 +6972,29 @@ module Cadenya
|
|
|
6707
6972
|
end
|
|
6708
6973
|
end
|
|
6709
6974
|
|
|
6975
|
+
class UnarchiveAgentPoolRequest
|
|
6976
|
+
attr_reader :workspace_id, :id
|
|
6977
|
+
|
|
6978
|
+
def initialize(workspace_id: nil, id: nil)
|
|
6979
|
+
@workspace_id = workspace_id
|
|
6980
|
+
@id = id
|
|
6981
|
+
end
|
|
6982
|
+
|
|
6983
|
+
def self.from_json(data)
|
|
6984
|
+
new(
|
|
6985
|
+
workspace_id: data["workspaceId"],
|
|
6986
|
+
id: data["id"],
|
|
6987
|
+
)
|
|
6988
|
+
end
|
|
6989
|
+
|
|
6990
|
+
def to_h
|
|
6991
|
+
{
|
|
6992
|
+
workspace_id: Util.plain(@workspace_id),
|
|
6993
|
+
id: Util.plain(@id),
|
|
6994
|
+
}.reject { |_k, v| v.nil? }
|
|
6995
|
+
end
|
|
6996
|
+
end
|
|
6997
|
+
|
|
6710
6998
|
class UnarchiveAgentRequest
|
|
6711
6999
|
attr_reader :workspace_id, :id
|
|
6712
7000
|
|
|
@@ -6892,6 +7180,38 @@ module Cadenya
|
|
|
6892
7180
|
end
|
|
6893
7181
|
end
|
|
6894
7182
|
|
|
7183
|
+
class UpdateAgentPoolRequest
|
|
7184
|
+
attr_reader :workspace_id, :id, :metadata, :spec, :update_mask
|
|
7185
|
+
|
|
7186
|
+
def initialize(workspace_id: nil, id: nil, metadata: nil, spec: nil, update_mask: nil)
|
|
7187
|
+
@workspace_id = workspace_id
|
|
7188
|
+
@id = id
|
|
7189
|
+
@metadata = metadata
|
|
7190
|
+
@spec = spec
|
|
7191
|
+
@update_mask = update_mask
|
|
7192
|
+
end
|
|
7193
|
+
|
|
7194
|
+
def self.from_json(data)
|
|
7195
|
+
new(
|
|
7196
|
+
workspace_id: data["workspaceId"],
|
|
7197
|
+
id: data["id"],
|
|
7198
|
+
metadata: data["metadata"].nil? ? nil : Types::UpdateResourceMetadata.from_json(data["metadata"]),
|
|
7199
|
+
spec: data["spec"].nil? ? nil : Types::AgentPoolUpdateSpec.from_json(data["spec"]),
|
|
7200
|
+
update_mask: data["updateMask"],
|
|
7201
|
+
)
|
|
7202
|
+
end
|
|
7203
|
+
|
|
7204
|
+
def to_h
|
|
7205
|
+
{
|
|
7206
|
+
workspace_id: Util.plain(@workspace_id),
|
|
7207
|
+
id: Util.plain(@id),
|
|
7208
|
+
metadata: Util.plain(@metadata),
|
|
7209
|
+
spec: Util.plain(@spec),
|
|
7210
|
+
update_mask: Util.plain(@update_mask),
|
|
7211
|
+
}.reject { |_k, v| v.nil? }
|
|
7212
|
+
end
|
|
7213
|
+
end
|
|
7214
|
+
|
|
6895
7215
|
class UpdateAgentRequest
|
|
6896
7216
|
attr_reader :workspace_id, :id, :metadata, :spec, :update_mask
|
|
6897
7217
|
|
|
@@ -7461,6 +7781,8 @@ module Cadenya
|
|
|
7461
7781
|
Types::VariationAssignment_ToolSetId.from_json(data)
|
|
7462
7782
|
when "subAgentId"
|
|
7463
7783
|
Types::VariationAssignment_SubAgentId.from_json(data)
|
|
7784
|
+
when "agentPoolId"
|
|
7785
|
+
Types::VariationAssignment_AgentPoolId.from_json(data)
|
|
7464
7786
|
else
|
|
7465
7787
|
raise ArgumentError, "VariationAssignment: unknown type #{data["type"].inspect}"
|
|
7466
7788
|
end
|
|
@@ -7661,14 +7983,15 @@ module Cadenya
|
|
|
7661
7983
|
WidgetSessionState = ["STATE_UNSPECIFIED", "STATE_ACTIVE", "STATE_EXPIRED", "STATE_REVOKED", "STATE_EXHAUSTED"].freeze
|
|
7662
7984
|
|
|
7663
7985
|
class WidgetSession
|
|
7664
|
-
attr_reader :metadata, :spec, :info, :state, :secrets
|
|
7986
|
+
attr_reader :metadata, :spec, :info, :state, :secrets, :credentials
|
|
7665
7987
|
|
|
7666
|
-
def initialize(metadata: nil, spec: nil, info: nil, state: nil, secrets: nil)
|
|
7988
|
+
def initialize(metadata: nil, spec: nil, info: nil, state: nil, secrets: nil, credentials: nil)
|
|
7667
7989
|
@metadata = metadata
|
|
7668
7990
|
@spec = spec
|
|
7669
7991
|
@info = info
|
|
7670
7992
|
@state = state
|
|
7671
7993
|
@secrets = secrets
|
|
7994
|
+
@credentials = credentials
|
|
7672
7995
|
end
|
|
7673
7996
|
|
|
7674
7997
|
def self.from_json(data)
|
|
@@ -7678,6 +8001,7 @@ module Cadenya
|
|
|
7678
8001
|
info: data["info"].nil? ? nil : Types::WidgetSessionInfo.from_json(data["info"]),
|
|
7679
8002
|
state: data["state"],
|
|
7680
8003
|
secrets: data["secrets"].nil? ? nil : (data["secrets"]).map { |item| Types::WidgetSession_Secret.from_json(item) },
|
|
8004
|
+
credentials: data["credentials"].nil? ? nil : Types::WidgetSessionCredentials.from_json(data["credentials"]),
|
|
7681
8005
|
)
|
|
7682
8006
|
end
|
|
7683
8007
|
|
|
@@ -7688,6 +8012,39 @@ module Cadenya
|
|
|
7688
8012
|
info: Util.plain(@info),
|
|
7689
8013
|
state: Util.plain(@state),
|
|
7690
8014
|
secrets: Util.plain(@secrets),
|
|
8015
|
+
credentials: Util.plain(@credentials),
|
|
8016
|
+
}.reject { |_k, v| v.nil? }
|
|
8017
|
+
end
|
|
8018
|
+
end
|
|
8019
|
+
|
|
8020
|
+
class WidgetSessionCredentials
|
|
8021
|
+
attr_reader :session_id, :host, :token, :token_expires_at, :session_expires_at
|
|
8022
|
+
|
|
8023
|
+
def initialize(session_id: nil, host: nil, token: nil, token_expires_at: nil, session_expires_at: nil)
|
|
8024
|
+
@session_id = session_id
|
|
8025
|
+
@host = host
|
|
8026
|
+
@token = token
|
|
8027
|
+
@token_expires_at = token_expires_at
|
|
8028
|
+
@session_expires_at = session_expires_at
|
|
8029
|
+
end
|
|
8030
|
+
|
|
8031
|
+
def self.from_json(data)
|
|
8032
|
+
new(
|
|
8033
|
+
session_id: data["sessionId"],
|
|
8034
|
+
host: data["host"],
|
|
8035
|
+
token: data["token"],
|
|
8036
|
+
token_expires_at: data["tokenExpiresAt"].nil? ? nil : Time.iso8601(data["tokenExpiresAt"]),
|
|
8037
|
+
session_expires_at: data["sessionExpiresAt"].nil? ? nil : Time.iso8601(data["sessionExpiresAt"]),
|
|
8038
|
+
)
|
|
8039
|
+
end
|
|
8040
|
+
|
|
8041
|
+
def to_h
|
|
8042
|
+
{
|
|
8043
|
+
session_id: Util.plain(@session_id),
|
|
8044
|
+
host: Util.plain(@host),
|
|
8045
|
+
token: Util.plain(@token),
|
|
8046
|
+
token_expires_at: Util.plain(@token_expires_at),
|
|
8047
|
+
session_expires_at: Util.plain(@session_expires_at),
|
|
7691
8048
|
}.reject { |_k, v| v.nil? }
|
|
7692
8049
|
end
|
|
7693
8050
|
end
|
|
@@ -8119,6 +8476,29 @@ module Cadenya
|
|
|
8119
8476
|
end
|
|
8120
8477
|
end
|
|
8121
8478
|
|
|
8479
|
+
class VariationAssignment_AgentPoolId
|
|
8480
|
+
attr_reader :type, :agent_pool_id
|
|
8481
|
+
|
|
8482
|
+
def initialize(type: nil, agent_pool_id: nil)
|
|
8483
|
+
@type = type
|
|
8484
|
+
@agent_pool_id = agent_pool_id
|
|
8485
|
+
end
|
|
8486
|
+
|
|
8487
|
+
def self.from_json(data)
|
|
8488
|
+
new(
|
|
8489
|
+
type: data["type"],
|
|
8490
|
+
agent_pool_id: data["agentPoolId"],
|
|
8491
|
+
)
|
|
8492
|
+
end
|
|
8493
|
+
|
|
8494
|
+
def to_h
|
|
8495
|
+
{
|
|
8496
|
+
type: Util.plain(@type),
|
|
8497
|
+
agent_pool_id: Util.plain(@agent_pool_id),
|
|
8498
|
+
}.reject { |_k, v| v.nil? }
|
|
8499
|
+
end
|
|
8500
|
+
end
|
|
8501
|
+
|
|
8122
8502
|
class ObjectiveToolCallResult_ContentBlock_Text
|
|
8123
8503
|
attr_reader :type, :text
|
|
8124
8504
|
|
|
@@ -9389,6 +9769,29 @@ module Cadenya
|
|
|
9389
9769
|
end
|
|
9390
9770
|
end
|
|
9391
9771
|
|
|
9772
|
+
class CallableTool_AgentPool
|
|
9773
|
+
attr_reader :type, :agent_pool
|
|
9774
|
+
|
|
9775
|
+
def initialize(type: nil, agent_pool: nil)
|
|
9776
|
+
@type = type
|
|
9777
|
+
@agent_pool = agent_pool
|
|
9778
|
+
end
|
|
9779
|
+
|
|
9780
|
+
def self.from_json(data)
|
|
9781
|
+
new(
|
|
9782
|
+
type: data["type"],
|
|
9783
|
+
agent_pool: data["agentPool"].nil? ? nil : Types::ResourceMetadata.from_json(data["agentPool"]),
|
|
9784
|
+
)
|
|
9785
|
+
end
|
|
9786
|
+
|
|
9787
|
+
def to_h
|
|
9788
|
+
{
|
|
9789
|
+
type: Util.plain(@type),
|
|
9790
|
+
agent_pool: Util.plain(@agent_pool),
|
|
9791
|
+
}.reject { |_k, v| v.nil? }
|
|
9792
|
+
end
|
|
9793
|
+
end
|
|
9794
|
+
|
|
9392
9795
|
class MemoryEntryCreateSpec_Content
|
|
9393
9796
|
attr_reader :type, :content, :key, :description
|
|
9394
9797
|
|
|
@@ -9612,6 +10015,38 @@ module Cadenya
|
|
|
9612
10015
|
end
|
|
9613
10016
|
end
|
|
9614
10017
|
|
|
10018
|
+
class AddAgentVariationAssignmentRequest_AgentPoolId
|
|
10019
|
+
attr_reader :type, :agent_pool_id, :workspace_id, :agent_id, :variation_id
|
|
10020
|
+
|
|
10021
|
+
def initialize(type: nil, agent_pool_id: nil, workspace_id: nil, agent_id: nil, variation_id: nil)
|
|
10022
|
+
@type = type
|
|
10023
|
+
@agent_pool_id = agent_pool_id
|
|
10024
|
+
@workspace_id = workspace_id
|
|
10025
|
+
@agent_id = agent_id
|
|
10026
|
+
@variation_id = variation_id
|
|
10027
|
+
end
|
|
10028
|
+
|
|
10029
|
+
def self.from_json(data)
|
|
10030
|
+
new(
|
|
10031
|
+
type: data["type"],
|
|
10032
|
+
agent_pool_id: data["agentPoolId"],
|
|
10033
|
+
workspace_id: data["workspaceId"],
|
|
10034
|
+
agent_id: data["agentId"],
|
|
10035
|
+
variation_id: data["variationId"],
|
|
10036
|
+
)
|
|
10037
|
+
end
|
|
10038
|
+
|
|
10039
|
+
def to_h
|
|
10040
|
+
{
|
|
10041
|
+
type: Util.plain(@type),
|
|
10042
|
+
agent_pool_id: Util.plain(@agent_pool_id),
|
|
10043
|
+
workspace_id: Util.plain(@workspace_id),
|
|
10044
|
+
agent_id: Util.plain(@agent_id),
|
|
10045
|
+
variation_id: Util.plain(@variation_id),
|
|
10046
|
+
}.reject { |_k, v| v.nil? }
|
|
10047
|
+
end
|
|
10048
|
+
end
|
|
10049
|
+
|
|
9615
10050
|
class RemoveAgentVariationAssignmentRequest_ToolId
|
|
9616
10051
|
attr_reader :type, :tool_id, :workspace_id, :agent_id, :variation_id
|
|
9617
10052
|
|
|
@@ -9708,6 +10143,38 @@ module Cadenya
|
|
|
9708
10143
|
end
|
|
9709
10144
|
end
|
|
9710
10145
|
|
|
10146
|
+
class RemoveAgentVariationAssignmentRequest_AgentPoolId
|
|
10147
|
+
attr_reader :type, :agent_pool_id, :workspace_id, :agent_id, :variation_id
|
|
10148
|
+
|
|
10149
|
+
def initialize(type: nil, agent_pool_id: nil, workspace_id: nil, agent_id: nil, variation_id: nil)
|
|
10150
|
+
@type = type
|
|
10151
|
+
@agent_pool_id = agent_pool_id
|
|
10152
|
+
@workspace_id = workspace_id
|
|
10153
|
+
@agent_id = agent_id
|
|
10154
|
+
@variation_id = variation_id
|
|
10155
|
+
end
|
|
10156
|
+
|
|
10157
|
+
def self.from_json(data)
|
|
10158
|
+
new(
|
|
10159
|
+
type: data["type"],
|
|
10160
|
+
agent_pool_id: data["agentPoolId"],
|
|
10161
|
+
workspace_id: data["workspaceId"],
|
|
10162
|
+
agent_id: data["agentId"],
|
|
10163
|
+
variation_id: data["variationId"],
|
|
10164
|
+
)
|
|
10165
|
+
end
|
|
10166
|
+
|
|
10167
|
+
def to_h
|
|
10168
|
+
{
|
|
10169
|
+
type: Util.plain(@type),
|
|
10170
|
+
agent_pool_id: Util.plain(@agent_pool_id),
|
|
10171
|
+
workspace_id: Util.plain(@workspace_id),
|
|
10172
|
+
agent_id: Util.plain(@agent_id),
|
|
10173
|
+
variation_id: Util.plain(@variation_id),
|
|
10174
|
+
}.reject { |_k, v| v.nil? }
|
|
10175
|
+
end
|
|
10176
|
+
end
|
|
10177
|
+
|
|
9711
10178
|
class AIProviderCredential_ApiKey
|
|
9712
10179
|
attr_reader :type, :api_key
|
|
9713
10180
|
|
|
@@ -10076,6 +10543,39 @@ module Cadenya
|
|
|
10076
10543
|
end
|
|
10077
10544
|
end
|
|
10078
10545
|
|
|
10546
|
+
WidgetSessionErrorReason = ["TOKEN_EXPIRED", "SESSION_REVOKED", "SESSION_EXPIRED", "SESSION_EXHAUSTED"].freeze
|
|
10547
|
+
|
|
10548
|
+
class WidgetSessionErrorInfo
|
|
10549
|
+
attr_reader :type, :domain, :reason, :metadata
|
|
10550
|
+
|
|
10551
|
+
def initialize(type: nil, domain: nil, reason: nil, metadata: nil)
|
|
10552
|
+
@type = type
|
|
10553
|
+
@domain = domain
|
|
10554
|
+
@reason = reason
|
|
10555
|
+
@metadata = metadata
|
|
10556
|
+
end
|
|
10557
|
+
|
|
10558
|
+
def self.from_json(data)
|
|
10559
|
+
new(
|
|
10560
|
+
type: data["@type"],
|
|
10561
|
+
domain: data["domain"],
|
|
10562
|
+
reason: data["reason"],
|
|
10563
|
+
metadata: data["metadata"],
|
|
10564
|
+
)
|
|
10565
|
+
end
|
|
10566
|
+
|
|
10567
|
+
def to_h
|
|
10568
|
+
{
|
|
10569
|
+
type: Util.plain(@type),
|
|
10570
|
+
domain: Util.plain(@domain),
|
|
10571
|
+
reason: Util.plain(@reason),
|
|
10572
|
+
metadata: Util.plain(@metadata),
|
|
10573
|
+
}.reject { |_k, v| v.nil? }
|
|
10574
|
+
end
|
|
10575
|
+
end
|
|
10576
|
+
|
|
10577
|
+
AgentPoolServiceListAgentPoolsState = ["AGENT_POOL_STATE_UNSPECIFIED", "AGENT_POOL_STATE_ACTIVE", "AGENT_POOL_STATE_INACTIVE", "AGENT_POOL_STATE_ARCHIVED"].freeze
|
|
10578
|
+
|
|
10079
10579
|
AgentServiceListAgentsState = ["STATE_UNSPECIFIED", "STATE_DRAFT", "STATE_PUBLISHED", "STATE_ARCHIVED"].freeze
|
|
10080
10580
|
|
|
10081
10581
|
AgentServiceListAgentsVariationSelectionMode = ["VARIATION_SELECTION_MODE_UNSPECIFIED", "VARIATION_SELECTION_MODE_RANDOM", "VARIATION_SELECTION_MODE_WEIGHTED"].freeze
|
|
@@ -10223,11 +10723,44 @@ module Cadenya
|
|
|
10223
10723
|
(->(_v) { encode_AddAgentVariationAssignmentRequest_ToolSetId(_v) }).call(data)
|
|
10224
10724
|
when "subAgentId"
|
|
10225
10725
|
(->(_v) { encode_AddAgentVariationAssignmentRequest_SubAgentId(_v) }).call(data)
|
|
10726
|
+
when "agentPoolId"
|
|
10727
|
+
(->(_v) { encode_AddAgentVariationAssignmentRequest_AgentPoolId(_v) }).call(data)
|
|
10226
10728
|
else
|
|
10227
10729
|
data
|
|
10228
10730
|
end
|
|
10229
10731
|
end
|
|
10230
10732
|
|
|
10733
|
+
ENCODE_AGENT_POOL_ASSIGNMENT = {
|
|
10734
|
+
"agent_id" => ["agentId", nil],
|
|
10735
|
+
"agentId" => ["agentId", nil],
|
|
10736
|
+
}.freeze
|
|
10737
|
+
|
|
10738
|
+
def self.encode_AgentPoolAssignment(data)
|
|
10739
|
+
encode_fields(ENCODE_AGENT_POOL_ASSIGNMENT, data)
|
|
10740
|
+
end
|
|
10741
|
+
|
|
10742
|
+
ENCODE_AGENT_POOL_SPEC = {
|
|
10743
|
+
"description" => ["description", nil],
|
|
10744
|
+
"state" => ["state", nil],
|
|
10745
|
+
"assignments" => ["assignments", ->(_v) { _v.is_a?(Array) ? _v.map { |_i| (->(_v) { encode_AgentPoolAssignment(_v) }).call(_i) } : _v }],
|
|
10746
|
+
"instructions" => ["instructions", nil],
|
|
10747
|
+
}.freeze
|
|
10748
|
+
|
|
10749
|
+
def self.encode_AgentPoolSpec(data)
|
|
10750
|
+
encode_fields(ENCODE_AGENT_POOL_SPEC, data)
|
|
10751
|
+
end
|
|
10752
|
+
|
|
10753
|
+
ENCODE_AGENT_POOL_UPDATE_SPEC = {
|
|
10754
|
+
"description" => ["description", nil],
|
|
10755
|
+
"state" => ["state", nil],
|
|
10756
|
+
"assignments" => ["assignments", ->(_v) { _v.is_a?(Array) ? _v.map { |_i| (->(_v) { encode_AgentPoolAssignment(_v) }).call(_i) } : _v }],
|
|
10757
|
+
"instructions" => ["instructions", nil],
|
|
10758
|
+
}.freeze
|
|
10759
|
+
|
|
10760
|
+
def self.encode_AgentPoolUpdateSpec(data)
|
|
10761
|
+
encode_fields(ENCODE_AGENT_POOL_UPDATE_SPEC, data)
|
|
10762
|
+
end
|
|
10763
|
+
|
|
10231
10764
|
ENCODE_AGENT_SCHEDULE_SPEC = {
|
|
10232
10765
|
"schedule" => ["schedule", ->(_v) { encode_AgentScheduleSpec_Schedule(_v) }],
|
|
10233
10766
|
"overlap_policy" => ["overlapPolicy", nil],
|
|
@@ -10750,6 +11283,8 @@ module Cadenya
|
|
|
10750
11283
|
(->(_v) { encode_RemoveAgentVariationAssignmentRequest_ToolSetId(_v) }).call(data)
|
|
10751
11284
|
when "subAgentId"
|
|
10752
11285
|
(->(_v) { encode_RemoveAgentVariationAssignmentRequest_SubAgentId(_v) }).call(data)
|
|
11286
|
+
when "agentPoolId"
|
|
11287
|
+
(->(_v) { encode_RemoveAgentVariationAssignmentRequest_AgentPoolId(_v) }).call(data)
|
|
10753
11288
|
else
|
|
10754
11289
|
data
|
|
10755
11290
|
end
|
|
@@ -11217,6 +11752,8 @@ module Cadenya
|
|
|
11217
11752
|
(->(_v) { encode_VariationAssignment_ToolSetId(_v) }).call(data)
|
|
11218
11753
|
when "subAgentId"
|
|
11219
11754
|
(->(_v) { encode_VariationAssignment_SubAgentId(_v) }).call(data)
|
|
11755
|
+
when "agentPoolId"
|
|
11756
|
+
(->(_v) { encode_VariationAssignment_AgentPoolId(_v) }).call(data)
|
|
11220
11757
|
else
|
|
11221
11758
|
data
|
|
11222
11759
|
end
|
|
@@ -11318,6 +11855,16 @@ module Cadenya
|
|
|
11318
11855
|
encode_fields(ENCODE_VARIATION_ASSIGNMENT_SUB_AGENT_ID, data)
|
|
11319
11856
|
end
|
|
11320
11857
|
|
|
11858
|
+
ENCODE_VARIATION_ASSIGNMENT_AGENT_POOL_ID = {
|
|
11859
|
+
"type" => ["type", nil],
|
|
11860
|
+
"agent_pool_id" => ["agentPoolId", nil],
|
|
11861
|
+
"agentPoolId" => ["agentPoolId", nil],
|
|
11862
|
+
}.freeze
|
|
11863
|
+
|
|
11864
|
+
def self.encode_VariationAssignment_AgentPoolId(data)
|
|
11865
|
+
encode_fields(ENCODE_VARIATION_ASSIGNMENT_AGENT_POOL_ID, data)
|
|
11866
|
+
end
|
|
11867
|
+
|
|
11321
11868
|
ENCODE_TOOL_SET_ADAPTER_MCP_VARIANT = {
|
|
11322
11869
|
"type" => ["type", nil],
|
|
11323
11870
|
"mcp" => ["mcp", ->(_v) { encode_ToolSetAdapter_MCP(_v) }],
|
|
@@ -11656,6 +12203,18 @@ module Cadenya
|
|
|
11656
12203
|
encode_fields(ENCODE_ADD_AGENT_VARIATION_ASSIGNMENT_REQUEST_SUB_AGENT_ID, data, drop: DROP_ADD_AGENT_VARIATION_ASSIGNMENT_REQUEST_SUB_AGENT_ID)
|
|
11657
12204
|
end
|
|
11658
12205
|
|
|
12206
|
+
ENCODE_ADD_AGENT_VARIATION_ASSIGNMENT_REQUEST_AGENT_POOL_ID = {
|
|
12207
|
+
"type" => ["type", nil],
|
|
12208
|
+
"agent_pool_id" => ["agentPoolId", nil],
|
|
12209
|
+
"agentPoolId" => ["agentPoolId", nil],
|
|
12210
|
+
}.freeze
|
|
12211
|
+
|
|
12212
|
+
DROP_ADD_AGENT_VARIATION_ASSIGNMENT_REQUEST_AGENT_POOL_ID = ["agentId", "agent_id", "variationId", "variation_id", "workspaceId", "workspace_id"].freeze
|
|
12213
|
+
|
|
12214
|
+
def self.encode_AddAgentVariationAssignmentRequest_AgentPoolId(data)
|
|
12215
|
+
encode_fields(ENCODE_ADD_AGENT_VARIATION_ASSIGNMENT_REQUEST_AGENT_POOL_ID, data, drop: DROP_ADD_AGENT_VARIATION_ASSIGNMENT_REQUEST_AGENT_POOL_ID)
|
|
12216
|
+
end
|
|
12217
|
+
|
|
11659
12218
|
ENCODE_REMOVE_AGENT_VARIATION_ASSIGNMENT_REQUEST_TOOL_ID = {
|
|
11660
12219
|
"type" => ["type", nil],
|
|
11661
12220
|
"tool_id" => ["toolId", nil],
|
|
@@ -11692,6 +12251,18 @@ module Cadenya
|
|
|
11692
12251
|
encode_fields(ENCODE_REMOVE_AGENT_VARIATION_ASSIGNMENT_REQUEST_SUB_AGENT_ID, data, drop: DROP_REMOVE_AGENT_VARIATION_ASSIGNMENT_REQUEST_SUB_AGENT_ID)
|
|
11693
12252
|
end
|
|
11694
12253
|
|
|
12254
|
+
ENCODE_REMOVE_AGENT_VARIATION_ASSIGNMENT_REQUEST_AGENT_POOL_ID = {
|
|
12255
|
+
"type" => ["type", nil],
|
|
12256
|
+
"agent_pool_id" => ["agentPoolId", nil],
|
|
12257
|
+
"agentPoolId" => ["agentPoolId", nil],
|
|
12258
|
+
}.freeze
|
|
12259
|
+
|
|
12260
|
+
DROP_REMOVE_AGENT_VARIATION_ASSIGNMENT_REQUEST_AGENT_POOL_ID = ["agentId", "agent_id", "variationId", "variation_id", "workspaceId", "workspace_id"].freeze
|
|
12261
|
+
|
|
12262
|
+
def self.encode_RemoveAgentVariationAssignmentRequest_AgentPoolId(data)
|
|
12263
|
+
encode_fields(ENCODE_REMOVE_AGENT_VARIATION_ASSIGNMENT_REQUEST_AGENT_POOL_ID, data, drop: DROP_REMOVE_AGENT_VARIATION_ASSIGNMENT_REQUEST_AGENT_POOL_ID)
|
|
12264
|
+
end
|
|
12265
|
+
|
|
11695
12266
|
ENCODE_AI_PROVIDER_CREDENTIAL_API_KEY = {
|
|
11696
12267
|
"type" => ["type", nil],
|
|
11697
12268
|
"api_key" => ["apiKey", ->(_v) { encode_CredentialAPIKey(_v) }],
|
data/lib/cadenya.rb
CHANGED
|
@@ -12,6 +12,7 @@ require_relative "cadenya/resources/api_keys"
|
|
|
12
12
|
require_relative "cadenya/resources/workspace_admin"
|
|
13
13
|
require_relative "cadenya/resources/profiles"
|
|
14
14
|
require_relative "cadenya/resources/workspaces"
|
|
15
|
+
require_relative "cadenya/resources/agent_pools"
|
|
15
16
|
require_relative "cadenya/resources/agents"
|
|
16
17
|
require_relative "cadenya/resources/agent_schedules"
|
|
17
18
|
require_relative "cadenya/resources/agent_variations"
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: cadenya
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.6.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Cadenya
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-09-
|
|
11
|
+
date: 2026-09-18 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|
|
@@ -52,6 +52,7 @@ files:
|
|
|
52
52
|
- lib/cadenya/core.rb
|
|
53
53
|
- lib/cadenya/pagination.rb
|
|
54
54
|
- lib/cadenya/resources/accounts.rb
|
|
55
|
+
- lib/cadenya/resources/agent_pools.rb
|
|
55
56
|
- lib/cadenya/resources/agent_schedules.rb
|
|
56
57
|
- lib/cadenya/resources/agent_variations.rb
|
|
57
58
|
- lib/cadenya/resources/agents.rb
|