cadenya 1.9.0 → 1.10.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: eecb6d4f82f8979e9e5b6353bba75ca96097bcfcba0b023a7287996f7867c04b
4
- data.tar.gz: 6d65c5f9ea8484123b41c7de59968ef0bbd539e6521908ed4a48ed97a72211b9
3
+ metadata.gz: 66c3b113b08869561c10e843ec5b764a7dd59305f68ee64cf76231f3ddad4097
4
+ data.tar.gz: 3a65671641630b92f4803b4d03b149f269e77f7a19b00353d566d8e9dfe5d0cb
5
5
  SHA512:
6
- metadata.gz: e0abbd8000d1341c0359001f98f057429b128b746b0244c930f160e4572c2fbb54b0459cbe1f6712dbf274c2de9d968ece4aa462e7d4087910cd021e7e5d8ecc
7
- data.tar.gz: 77686a8de6a5595239d0ae18edd14a7c376a4ef130e556a00ab5c637d66de4c39ddb15b7d48aefad6ee126799bca5861fb46afce9425465b78542c0ce7e03d90
6
+ metadata.gz: f5758d99634dfb57211fd7a2411d71865e6c8065d165618458d18ba5661dcf53f4a55b21e00d929eb1fd4770f1650741f58d3f24f8f6a6955f9e0e3ef34d89b5
7
+ data.tar.gz: 6e6ff3ea1e47712a1dd3da0b5e72a8c2c32e64fe30db8c326490b515b5ee73039644fdea1cb8fcb062a28b60fd549ebd94ef8150b70ce1162391d7c44afc8e0b
data/api.md CHANGED
@@ -169,6 +169,11 @@ List workspaces
169
169
  ```ruby
170
170
  client.workspaces.list(limit: nil, cursor: nil, sort_order: nil, include_info: nil, labels: nil) # => Cadenya::Page of Cadenya::Types::Workspace
171
171
  ```
172
+ Get temporary workspace claim status
173
+
174
+ ```ruby
175
+ client.workspaces.retrieve_temporary(workspace_id) # => Cadenya::Types::TemporaryWorkspace
176
+ ```
172
177
 
173
178
  ## client.agent_pools
174
179
 
@@ -504,7 +509,7 @@ client.objectives.list(workspace_id: nil, limit: nil, cursor: nil, agent_id: nil
504
509
  Create a new objective
505
510
 
506
511
  ```ruby
507
- client.objectives.create(agent_id:, workspace_id: nil, variation_id: nil, metadata: nil, system_prompt_data: nil, first_user_message: nil, secrets: nil, memory_cascade: nil, first_user_message_data: nil, episodic_memory: nil, tenant: nil, subject: nil, pinned_parameters: nil, client_tools: nil) # => Cadenya::Types::Objective
512
+ client.objectives.create(agent_id:, workspace_id: nil, variation_id: nil, metadata: nil, system_prompt_data: nil, first_user_message: nil, secrets: nil, memory_cascade: nil, first_user_message_data: nil, episodic_memory: nil, tenant: nil, subject: nil, pinned_parameters: nil, client_tools: nil, system_prompt: nil) # => Cadenya::Types::Objective
508
513
  ```
509
514
  Get an objective by ID
510
515
 
@@ -604,7 +609,7 @@ client.objectives.interrupt(objective_id, workspace_id: nil) # => Cadenya::Types
604
609
  Create an objective and stream its events
605
610
 
606
611
  ```ruby
607
- client.objectives.create_and_stream(agent_id:, metadata:, workspace_id: nil, variation_id: nil, system_prompt_data: nil, first_user_message: nil, secrets: nil, memory_cascade: nil, first_user_message_data: nil, episodic_memory: nil, tenant: nil, subject: nil, pinned_parameters: nil, client_tools: nil, include_deltas: nil, last_event_id: nil) # => Cadenya::Stream
612
+ client.objectives.create_and_stream(agent_id:, metadata:, workspace_id: nil, variation_id: nil, system_prompt_data: nil, first_user_message: nil, secrets: nil, memory_cascade: nil, first_user_message_data: nil, episodic_memory: nil, tenant: nil, subject: nil, pinned_parameters: nil, client_tools: nil, system_prompt: nil, include_deltas: nil, last_event_id: nil) # => Cadenya::Stream
608
613
  ```
609
614
 
610
615
  ## client.tool_search
@@ -670,6 +675,11 @@ Archive a tool set
670
675
  ```ruby
671
676
  client.tool_sets.archive(id, workspace_id: nil) # => Cadenya::Types::ToolSet
672
677
  ```
678
+ Sync a tool set
679
+
680
+ ```ruby
681
+ client.tool_sets.sync(id, workspace_id: nil) # => nil
682
+ ```
673
683
  Unarchive a tool set
674
684
 
675
685
  ```ruby
@@ -691,6 +701,34 @@ List tool set usage
691
701
  client.tool_sets.list_usage(tool_set_id, workspace_id: nil, tool_id: nil, limit: nil, cursor: nil, sort_order: nil) # => Cadenya::Page of Cadenya::Types::ToolSetUsage
692
702
  ```
693
703
 
704
+ ## client.tool_sets.rules
705
+
706
+ List tool set rules
707
+
708
+ ```ruby
709
+ client.tool_sets.rules.list(tool_set_id, workspace_id: nil) # => Cadenya::Types::ListToolSetRulesResponse
710
+ ```
711
+ Create a tool set rule
712
+
713
+ ```ruby
714
+ client.tool_sets.rules.create(tool_set_id, name:, workspace_id: nil, description: nil, when_: nil, actions: nil, disabled: nil, position: nil) # => Cadenya::Types::ToolRule
715
+ ```
716
+ Get a tool set rule by ID
717
+
718
+ ```ruby
719
+ client.tool_sets.rules.retrieve(tool_set_id, id, workspace_id: nil) # => Cadenya::Types::ToolRule
720
+ ```
721
+ Delete a tool set rule
722
+
723
+ ```ruby
724
+ client.tool_sets.rules.delete(tool_set_id, id, workspace_id: nil) # => nil
725
+ ```
726
+ Update a tool set rule
727
+
728
+ ```ruby
729
+ client.tool_sets.rules.update(tool_set_id, id, workspace_id: nil, name: nil, description: nil, when_: nil, actions: nil, disabled: nil, position: nil, update_mask: nil) # => Cadenya::Types::ToolRule
730
+ ```
731
+
694
732
  ## client.tool_sets.secrets
695
733
 
696
734
  List tool set secrets
@@ -724,7 +762,7 @@ client.tool_sets.secrets.update(tool_set_id, id, workspace_id: nil, metadata: ni
724
762
  List tools
725
763
 
726
764
  ```ruby
727
- client.tool_sets.tools.list(tool_set_id, workspace_id: nil, limit: nil, cursor: nil, prefix: nil, query: nil, names: nil, states: nil, requires_approval: nil, overlays: nil, labels: nil, sort_order: nil, include_info: nil) # => Cadenya::Page of Cadenya::Types::Tool
765
+ client.tool_sets.tools.list(tool_set_id, workspace_id: nil, limit: nil, cursor: nil, prefix: nil, query: nil, names: nil, states: nil, requires_approval: nil, labels: nil, sort_order: nil, include_info: nil) # => Cadenya::Page of Cadenya::Types::Tool
728
766
  ```
729
767
  Create a new tool
730
768
 
@@ -38,7 +38,7 @@ module Cadenya
38
38
  end
39
39
 
40
40
  # Create a new objective
41
- def create(agent_id:, workspace_id: nil, variation_id: nil, metadata: nil, system_prompt_data: nil, first_user_message: nil, secrets: nil, memory_cascade: nil, first_user_message_data: nil, episodic_memory: nil, tenant: nil, subject: nil, pinned_parameters: nil, client_tools: nil, request_options: nil)
41
+ def create(agent_id:, workspace_id: nil, variation_id: nil, metadata: nil, system_prompt_data: nil, first_user_message: nil, secrets: nil, memory_cascade: nil, first_user_message_data: nil, episodic_memory: nil, tenant: nil, subject: nil, pinned_parameters: nil, client_tools: nil, system_prompt: nil, request_options: nil)
42
42
  workspace_id = @core.resolve_default("workspaceId", "CADENYA_WORKSPACE_ID", workspace_id)
43
43
  _path = "/v1/workspaces/#{Util.path_param('workspaceId', workspace_id)}/objectives"
44
44
  _body = {
@@ -55,6 +55,7 @@ module Cadenya
55
55
  "subject" => subject.nil? ? nil : (->(_v) { Types.encode_SubjectAssertion(_v) }).call(subject),
56
56
  "pinnedParameters" => pinned_parameters,
57
57
  "clientTools" => client_tools.nil? ? nil : (->(_v) { Types.encode_ClientTools(_v) }).call(client_tools),
58
+ "systemPrompt" => system_prompt,
58
59
  }.reject { |_k, v| v.nil? }
59
60
  _data = @core.request(:post, _path, body: _body, request_options: request_options)
60
61
  Types::Objective.from_json(_data)
@@ -301,7 +302,7 @@ module Cadenya
301
302
  end
302
303
 
303
304
  # Create an objective and stream its events
304
- def create_and_stream(agent_id:, metadata:, workspace_id: nil, variation_id: nil, system_prompt_data: nil, first_user_message: nil, secrets: nil, memory_cascade: nil, first_user_message_data: nil, episodic_memory: nil, tenant: nil, subject: nil, pinned_parameters: nil, client_tools: nil, include_deltas: nil, last_event_id: nil, request_options: nil)
305
+ def create_and_stream(agent_id:, metadata:, workspace_id: nil, variation_id: nil, system_prompt_data: nil, first_user_message: nil, secrets: nil, memory_cascade: nil, first_user_message_data: nil, episodic_memory: nil, tenant: nil, subject: nil, pinned_parameters: nil, client_tools: nil, system_prompt: nil, include_deltas: nil, last_event_id: nil, request_options: nil)
305
306
  workspace_id = @core.resolve_default("workspaceId", "CADENYA_WORKSPACE_ID", workspace_id)
306
307
  _path = "/v1/workspaces/#{Util.path_param('workspaceId', workspace_id)}/objectives:stream"
307
308
  _body = {
@@ -318,6 +319,7 @@ module Cadenya
318
319
  "subject" => subject.nil? ? nil : (->(_v) { Types.encode_SubjectAssertion(_v) }).call(subject),
319
320
  "pinnedParameters" => pinned_parameters,
320
321
  "clientTools" => client_tools.nil? ? nil : (->(_v) { Types.encode_ClientTools(_v) }).call(client_tools),
322
+ "systemPrompt" => system_prompt,
321
323
  "includeDeltas" => include_deltas,
322
324
  }.reject { |_k, v| v.nil? }
323
325
  _headers = last_event_id ? { "Last-Event-ID" => last_event_id } : nil
@@ -0,0 +1,70 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Code generated by redwood. DO NOT EDIT.
4
+
5
+ module Cadenya
6
+ module Resources
7
+ class ToolSetRules
8
+ def initialize(core)
9
+ @core = core
10
+ end
11
+
12
+ # List tool set rules
13
+ def list(tool_set_id, workspace_id: 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)}/tool_sets/#{Util.path_param('toolSetId', tool_set_id)}/rules"
16
+ _data = @core.request(:get, _path, request_options: request_options)
17
+ Types::ListToolSetRulesResponse.from_json(_data)
18
+ end
19
+
20
+ # Create a tool set rule
21
+ def create(tool_set_id, name:, workspace_id: nil, description: nil, when_: nil, actions: nil, disabled: nil, position: nil, request_options: nil)
22
+ workspace_id = @core.resolve_default("workspaceId", "CADENYA_WORKSPACE_ID", workspace_id)
23
+ _path = "/v1/workspaces/#{Util.path_param('workspaceId', workspace_id)}/tool_sets/#{Util.path_param('toolSetId', tool_set_id)}/rules"
24
+ _body = {
25
+ "name" => name,
26
+ "description" => description,
27
+ "when" => when_,
28
+ "actions" => actions.nil? ? nil : (->(_v) { Types.encode_ToolActions(_v) }).call(actions),
29
+ "disabled" => disabled,
30
+ "position" => position,
31
+ }.reject { |_k, v| v.nil? }
32
+ _data = @core.request(:post, _path, body: _body, request_options: request_options)
33
+ Types::ToolRule.from_json(_data)
34
+ end
35
+
36
+ # Get a tool set rule by ID
37
+ def retrieve(tool_set_id, id, workspace_id: nil, request_options: nil)
38
+ workspace_id = @core.resolve_default("workspaceId", "CADENYA_WORKSPACE_ID", workspace_id)
39
+ _path = "/v1/workspaces/#{Util.path_param('workspaceId', workspace_id)}/tool_sets/#{Util.path_param('toolSetId', tool_set_id)}/rules/#{Util.path_param('id', id)}"
40
+ _data = @core.request(:get, _path, request_options: request_options)
41
+ Types::ToolRule.from_json(_data)
42
+ end
43
+
44
+ # Delete a tool set rule
45
+ def delete(tool_set_id, id, workspace_id: nil, request_options: nil)
46
+ workspace_id = @core.resolve_default("workspaceId", "CADENYA_WORKSPACE_ID", workspace_id)
47
+ _path = "/v1/workspaces/#{Util.path_param('workspaceId', workspace_id)}/tool_sets/#{Util.path_param('toolSetId', tool_set_id)}/rules/#{Util.path_param('id', id)}"
48
+ @core.request(:delete, _path, expects_body: false, request_options: request_options)
49
+ nil
50
+ end
51
+
52
+ # Update a tool set rule
53
+ def update(tool_set_id, id, workspace_id: nil, name: nil, description: nil, when_: nil, actions: nil, disabled: nil, position: nil, update_mask: nil, request_options: nil)
54
+ workspace_id = @core.resolve_default("workspaceId", "CADENYA_WORKSPACE_ID", workspace_id)
55
+ _path = "/v1/workspaces/#{Util.path_param('workspaceId', workspace_id)}/tool_sets/#{Util.path_param('toolSetId', tool_set_id)}/rules/#{Util.path_param('id', id)}"
56
+ _body = {
57
+ "name" => name,
58
+ "description" => description,
59
+ "when" => when_,
60
+ "actions" => actions.nil? ? nil : (->(_v) { Types.encode_ToolActions(_v) }).call(actions),
61
+ "disabled" => disabled,
62
+ "position" => position,
63
+ "updateMask" => update_mask,
64
+ }.reject { |_k, v| v.nil? }
65
+ _data = @core.request(:patch, _path, body: _body, request_options: request_options)
66
+ Types::ToolRule.from_json(_data)
67
+ end
68
+ end
69
+ end
70
+ end
@@ -5,10 +5,11 @@
5
5
  module Cadenya
6
6
  module Resources
7
7
  class ToolSets
8
- attr_reader :secrets, :tools
8
+ attr_reader :rules, :secrets, :tools
9
9
 
10
10
  def initialize(core)
11
11
  @core = core
12
+ @rules = ToolSetRules.new(core)
12
13
  @secrets = ToolSetSecrets.new(core)
13
14
  @tools = Tools.new(core)
14
15
  end
@@ -84,6 +85,14 @@ module Cadenya
84
85
  Types::ToolSet.from_json(_data)
85
86
  end
86
87
 
88
+ # Sync a tool set
89
+ def sync(id, workspace_id: nil, request_options: nil)
90
+ workspace_id = @core.resolve_default("workspaceId", "CADENYA_WORKSPACE_ID", workspace_id)
91
+ _path = "/v1/workspaces/#{Util.path_param('workspaceId', workspace_id)}/tool_sets/#{Util.path_param('id', id)}:sync"
92
+ @core.request(:post, _path, expects_body: false, request_options: request_options)
93
+ nil
94
+ end
95
+
87
96
  # Unarchive a tool set
88
97
  def unarchive(id, workspace_id: nil, request_options: nil)
89
98
  workspace_id = @core.resolve_default("workspaceId", "CADENYA_WORKSPACE_ID", workspace_id)
@@ -10,12 +10,11 @@ module Cadenya
10
10
  end
11
11
 
12
12
  # List tools
13
- def list(tool_set_id, workspace_id: nil, limit: nil, cursor: nil, prefix: nil, query: nil, names: nil, states: nil, requires_approval: nil, overlays: nil, labels: nil, sort_order: nil, include_info: nil, request_options: nil)
13
+ def list(tool_set_id, workspace_id: nil, limit: nil, cursor: nil, prefix: nil, query: nil, names: nil, states: nil, requires_approval: nil, labels: nil, sort_order: nil, include_info: nil, request_options: nil)
14
14
  workspace_id = @core.resolve_default("workspaceId", "CADENYA_WORKSPACE_ID", workspace_id)
15
15
  _path = "/v1/workspaces/#{Util.path_param('workspaceId', workspace_id)}/tool_sets/#{Util.path_param('toolSetId', tool_set_id)}/tools"
16
16
  names = names.dup if names.is_a?(Array)
17
17
  states = states.dup if states.is_a?(Array)
18
- overlays = overlays.dup if overlays.is_a?(Array)
19
18
  _query = {
20
19
  "limit" => limit,
21
20
  "cursor" => cursor,
@@ -24,7 +23,6 @@ module Cadenya
24
23
  "names" => names,
25
24
  "states" => states,
26
25
  "requiresApproval" => requires_approval,
27
- "overlays" => overlays,
28
26
  "labels" => labels,
29
27
  "sortOrder" => sort_order,
30
28
  "includeInfo" => include_info,
@@ -33,7 +31,7 @@ module Cadenya
33
31
  _items = (_data["items"] || []).map { |item| Types::Tool.from_json(item) }
34
32
  _next_cursor = (((_data)["pagination"] || {}))["nextCursor"].to_s
35
33
  Page.new(_items, _next_cursor) do |_c|
36
- list(tool_set_id, workspace_id: workspace_id, limit: limit, cursor: _c, prefix: prefix, query: query, names: names, states: states, requires_approval: requires_approval, overlays: overlays, labels: labels, sort_order: sort_order, include_info: include_info, request_options: request_options)
34
+ list(tool_set_id, workspace_id: workspace_id, limit: limit, cursor: _c, prefix: prefix, query: query, names: names, states: states, requires_approval: requires_approval, labels: labels, sort_order: sort_order, include_info: include_info, request_options: request_options)
37
35
  end
38
36
  end
39
37
 
@@ -26,6 +26,13 @@ module Cadenya
26
26
  list(limit: limit, cursor: _c, sort_order: sort_order, include_info: include_info, labels: labels, request_options: request_options)
27
27
  end
28
28
  end
29
+
30
+ # Get temporary workspace claim status
31
+ def retrieve_temporary(workspace_id, request_options: nil)
32
+ _path = "/v1/workspaces/#{Util.path_param('workspaceId', workspace_id)}/temporary"
33
+ _data = @core.request(:get, _path, request_options: request_options)
34
+ Types::TemporaryWorkspace.from_json(_data)
35
+ end
29
36
  end
30
37
  end
31
38
  end