cadenya 1.0.1 → 1.1.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: 848ebb2b39aa33946683d9bb929d35b07eb615cc8babce18f4f3ca3ae46440b7
4
- data.tar.gz: 753a08e80d462781aed796a2a96ac29801d68b7136d29fdd1ddffdd57853eb39
3
+ metadata.gz: a34a1aa5ec8f93f32c4d4195c752a708703aa6d21271ddbde778fc714e156348
4
+ data.tar.gz: a2f70c8273fc506459d921a218c2741ce7cff7f91173d533146b29f9bb17cfb7
5
5
  SHA512:
6
- metadata.gz: 428b7b7b043d6b41b920b1146c502bbd453fb8c340a2feb46a50d12162baa0ce57c0ef45cd5fdf0def9d494cfa81d10deef488397dab6dbd8fd0e4b5b45afecc
7
- data.tar.gz: 198b736f259553305b7f5b90df3caf15c2e798152e4c8d92dbefcfa601d624d21e4b0984e724d1dd9a736195fcc86fe23c94dcc15f37d398c7d87bcd026b17a6
6
+ metadata.gz: d5ad906af80f5f85092cb525d853b84a63d4bc5561423b05445b8c0ef7dbcd6d745630126a95baced17950c0b731e81735932912845babf5cbcab1c8d2782de2
7
+ data.tar.gz: d03190e5823c1be2bbe24c2c2a564f141c65bcab927abc9c57e8464ef10f365fa7712ebf09facfab243a3bc3b2d705b80657f8a888d23409f8d5c473642242d2
data/api.md CHANGED
@@ -316,7 +316,7 @@ client.ai_provider_keys.create(metadata:, spec:, workspace_id: nil) # => Cadenya
316
316
  Get an AI provider key by ID
317
317
 
318
318
  ```ruby
319
- client.ai_provider_keys.retrieve(id, workspace_id: nil) # => Cadenya::Types::AIProviderKey
319
+ client.ai_provider_keys.retrieve(id, workspace_id: nil, include_info: nil) # => Cadenya::Types::AIProviderKey
320
320
  ```
321
321
  Delete an AI provider key
322
322
 
@@ -326,7 +326,45 @@ client.ai_provider_keys.delete(id, workspace_id: nil) # => nil
326
326
  Update an AI provider key
327
327
 
328
328
  ```ruby
329
- client.ai_provider_keys.update(id, workspace_id: nil, metadata: nil, spec: nil, update_mask: nil) # => Cadenya::Types::AIProviderKey
329
+ client.ai_provider_keys.update(id, workspace_id: nil, metadata: nil, spec: nil, update_mask: nil, credential_patch: nil) # => Cadenya::Types::AIProviderKey
330
+ ```
331
+
332
+ ## client.models
333
+
334
+ Create a model
335
+
336
+ ```ruby
337
+ client.models.create(ai_provider_key_id, metadata:, spec:, workspace_id: nil) # => Cadenya::Types::Model
338
+ ```
339
+ List models
340
+
341
+ ```ruby
342
+ client.models.list(workspace_id: nil, limit: nil, cursor: nil, prefix: nil, query: nil, state: nil, ai_provider_key_id: nil, is_assigned: nil, labels: nil, sort_order: nil, include_info: nil) # => Cadenya::Page of Cadenya::Types::Model
343
+ ```
344
+ Get a model by ID
345
+
346
+ ```ruby
347
+ client.models.retrieve(id, workspace_id: nil) # => Cadenya::Types::Model
348
+ ```
349
+ Update a model
350
+
351
+ ```ruby
352
+ client.models.update(id, workspace_id: nil, metadata: nil, spec: nil, pricing_override: nil, update_mask: nil) # => Cadenya::Types::Model
353
+ ```
354
+ Disable a model
355
+
356
+ ```ruby
357
+ client.models.disable(id, workspace_id: nil) # => Cadenya::Types::Model
358
+ ```
359
+ Enable a model
360
+
361
+ ```ruby
362
+ client.models.enable(id, workspace_id: nil) # => Cadenya::Types::Model
363
+ ```
364
+ Swap models on agent variations
365
+
366
+ ```ruby
367
+ client.models.swap_on_variations(workspace_id: nil, model_swaps: nil) # => nil
330
368
  ```
331
369
 
332
370
  ## client.memory_layers
@@ -385,34 +423,6 @@ Update a memory entry
385
423
  client.memory_layers.entries.update(memory_layer_id, id, workspace_id: nil, metadata: nil, spec: nil, update_mask: nil) # => Cadenya::Types::MemoryEntryDetail
386
424
  ```
387
425
 
388
- ## client.models
389
-
390
- List models
391
-
392
- ```ruby
393
- client.models.list(workspace_id: nil, limit: nil, cursor: nil, prefix: nil, query: nil, state: nil, ai_provider_key_id: nil, is_assigned: nil, labels: nil, sort_order: nil, include_info: nil) # => Cadenya::Page of Cadenya::Types::Model
394
- ```
395
- Get a model by ID
396
-
397
- ```ruby
398
- client.models.retrieve(id, workspace_id: nil) # => Cadenya::Types::Model
399
- ```
400
- Disable a model
401
-
402
- ```ruby
403
- client.models.disable(id, workspace_id: nil) # => Cadenya::Types::Model
404
- ```
405
- Enable a model
406
-
407
- ```ruby
408
- client.models.enable(id, workspace_id: nil) # => Cadenya::Types::Model
409
- ```
410
- Swap models on agent variations
411
-
412
- ```ruby
413
- client.models.swap_on_variations(workspace_id: nil, model_swaps: nil) # => nil
414
- ```
415
-
416
426
  ## client.objectives
417
427
 
418
428
  List objectives
@@ -460,16 +470,6 @@ Submit feedback for an objective
460
470
  ```ruby
461
471
  client.objectives.create_feedback(objective_id, metadata:, data:, workspace_id: nil) # => Cadenya::Types::ObjectiveFeedback
462
472
  ```
463
- List objective tasks
464
-
465
- ```ruby
466
- client.objectives.list_tasks(objective_id, workspace_id: nil, limit: nil, cursor: nil, sort_order: nil) # => Cadenya::Page of Cadenya::Types::ObjectiveTask
467
- ```
468
- Get an objective task by ID
469
-
470
- ```ruby
471
- client.objectives.retrieve_task(objective_id, id, workspace_id: nil) # => Cadenya::Types::ObjectiveTask
472
- ```
473
473
  List objective tool calls
474
474
 
475
475
  ```ruby
@@ -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, :memory_layers, :models, :objectives, :tool_search, :tenants, :tool_sets, :uploads, :widget_sessions, :widgets, :workspace_secrets
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
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.0.0 (api 1.0)",
40
+ user_agent: "cadenya-ruby/1.0.1 (api 1.0)",
41
41
  connection: connection,
42
42
  stream_transport: stream_transport
43
43
  )
@@ -48,8 +48,8 @@ module Cadenya
48
48
  @workspaces = Resources::Workspaces.new(core)
49
49
  @agents = Resources::Agents.new(core)
50
50
  @ai_provider_keys = Resources::AiProviderKeys.new(core)
51
- @memory_layers = Resources::MemoryLayers.new(core)
52
51
  @models = Resources::Models.new(core)
52
+ @memory_layers = Resources::MemoryLayers.new(core)
53
53
  @objectives = Resources::Objectives.new(core)
54
54
  @tool_search = Resources::ToolSearch.new(core)
55
55
  @tenants = Resources::Tenants.new(core)
@@ -44,10 +44,13 @@ module Cadenya
44
44
  end
45
45
 
46
46
  # Get an AI provider key by ID
47
- def retrieve(id, workspace_id: nil, request_options: nil)
47
+ def retrieve(id, workspace_id: nil, include_info: nil, request_options: nil)
48
48
  workspace_id = @core.resolve_default("workspaceId", "CADENYA_WORKSPACE_ID", workspace_id)
49
49
  _path = "/v1/workspaces/#{Util.path_param('workspaceId', workspace_id)}/ai_provider_keys/#{Util.path_param('id', id)}"
50
- _data = @core.request(:get, _path, request_options: request_options)
50
+ _query = {
51
+ "includeInfo" => include_info,
52
+ }
53
+ _data = @core.request(:get, _path, query: _query, request_options: request_options)
51
54
  Types::AIProviderKey.from_json(_data)
52
55
  end
53
56
 
@@ -60,13 +63,14 @@ module Cadenya
60
63
  end
61
64
 
62
65
  # Update an AI provider key
63
- def update(id, workspace_id: nil, metadata: nil, spec: nil, update_mask: nil, request_options: nil)
66
+ def update(id, workspace_id: nil, metadata: nil, spec: nil, update_mask: nil, credential_patch: nil, request_options: nil)
64
67
  workspace_id = @core.resolve_default("workspaceId", "CADENYA_WORKSPACE_ID", workspace_id)
65
68
  _path = "/v1/workspaces/#{Util.path_param('workspaceId', workspace_id)}/ai_provider_keys/#{Util.path_param('id', id)}"
66
69
  _body = {
67
70
  "metadata" => metadata.nil? ? nil : (->(_v) { Types.encode_UpdateResourceMetadata(_v) }).call(metadata),
68
71
  "spec" => spec.nil? ? nil : (->(_v) { Types.encode_AIProviderKeySpec(_v) }).call(spec),
69
72
  "updateMask" => update_mask,
73
+ "credentialPatch" => credential_patch.nil? ? nil : (->(_v) { Types.encode_AIProviderCredentialPatch(_v) }).call(credential_patch),
70
74
  }.reject { |_k, v| v.nil? }
71
75
  _data = @core.request(:patch, _path, body: _body, request_options: request_options)
72
76
  Types::AIProviderKey.from_json(_data)
@@ -9,6 +9,18 @@ module Cadenya
9
9
  @core = core
10
10
  end
11
11
 
12
+ # Create a model
13
+ def create(ai_provider_key_id, metadata:, spec:, 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)}/ai_provider_keys/#{Util.path_param('aiProviderKeyId', ai_provider_key_id)}/models"
16
+ _body = {
17
+ "metadata" => metadata.nil? ? nil : (->(_v) { Types.encode_CreateResourceMetadata(_v) }).call(metadata),
18
+ "spec" => spec.nil? ? nil : (->(_v) { Types.encode_ModelSpec(_v) }).call(spec),
19
+ }.reject { |_k, v| v.nil? }
20
+ _data = @core.request(:post, _path, body: _body, request_options: request_options)
21
+ Types::Model.from_json(_data)
22
+ end
23
+
12
24
  # List models
13
25
  def list(workspace_id: nil, limit: nil, cursor: nil, prefix: nil, query: nil, state: nil, ai_provider_key_id: nil, is_assigned: nil, labels: nil, sort_order: nil, include_info: nil, request_options: nil)
14
26
  workspace_id = @core.resolve_default("workspaceId", "CADENYA_WORKSPACE_ID", workspace_id)
@@ -41,6 +53,20 @@ module Cadenya
41
53
  Types::Model.from_json(_data)
42
54
  end
43
55
 
56
+ # Update a model
57
+ def update(id, workspace_id: nil, metadata: nil, spec: nil, pricing_override: nil, update_mask: nil, request_options: nil)
58
+ workspace_id = @core.resolve_default("workspaceId", "CADENYA_WORKSPACE_ID", workspace_id)
59
+ _path = "/v1/workspaces/#{Util.path_param('workspaceId', workspace_id)}/models/#{Util.path_param('id', id)}"
60
+ _body = {
61
+ "metadata" => metadata.nil? ? nil : (->(_v) { Types.encode_UpdateResourceMetadata(_v) }).call(metadata),
62
+ "spec" => spec.nil? ? nil : (->(_v) { Types.encode_ModelSpec(_v) }).call(spec),
63
+ "pricingOverride" => pricing_override.nil? ? nil : (->(_v) { Types.encode_ModelPricingOverride(_v) }).call(pricing_override),
64
+ "updateMask" => update_mask,
65
+ }.reject { |_k, v| v.nil? }
66
+ _data = @core.request(:patch, _path, body: _body, request_options: request_options)
67
+ Types::Model.from_json(_data)
68
+ end
69
+
44
70
  # Disable a model
45
71
  def disable(id, workspace_id: nil, request_options: nil)
46
72
  workspace_id = @core.resolve_default("workspaceId", "CADENYA_WORKSPACE_ID", workspace_id)
@@ -155,31 +155,6 @@ module Cadenya
155
155
  Types::ObjectiveFeedback.from_json(_data)
156
156
  end
157
157
 
158
- # List objective tasks
159
- def list_tasks(objective_id, workspace_id: nil, limit: nil, cursor: nil, sort_order: nil, request_options: nil)
160
- workspace_id = @core.resolve_default("workspaceId", "CADENYA_WORKSPACE_ID", workspace_id)
161
- _path = "/v1/workspaces/#{Util.path_param('workspaceId', workspace_id)}/objectives/#{Util.path_param('objectiveId', objective_id)}/tasks"
162
- _query = {
163
- "limit" => limit,
164
- "cursor" => cursor,
165
- "sortOrder" => sort_order,
166
- }
167
- _data = @core.request(:get, _path, query: _query, request_options: request_options) || {}
168
- _items = (_data["items"] || []).map { |item| Types::ObjectiveTask.from_json(item) }
169
- _next_cursor = (((_data)["pagination"] || {}))["nextCursor"].to_s
170
- Page.new(_items, _next_cursor) do |_c|
171
- list_tasks(objective_id, workspace_id: workspace_id, limit: limit, cursor: _c, sort_order: sort_order, request_options: request_options)
172
- end
173
- end
174
-
175
- # Get an objective task by ID
176
- def retrieve_task(objective_id, id, workspace_id: nil, request_options: nil)
177
- workspace_id = @core.resolve_default("workspaceId", "CADENYA_WORKSPACE_ID", workspace_id)
178
- _path = "/v1/workspaces/#{Util.path_param('workspaceId', workspace_id)}/objectives/#{Util.path_param('objectiveId', objective_id)}/tasks/#{Util.path_param('id', id)}"
179
- _data = @core.request(:get, _path, request_options: request_options)
180
- Types::ObjectiveTask.from_json(_data)
181
- end
182
-
183
158
  # List objective tool calls
184
159
  def list_tool_calls(objective_id, workspace_id: nil, limit: nil, cursor: nil, status: nil, include_info: nil, execution_status: nil, labels: nil, request_options: nil)
185
160
  workspace_id = @core.resolve_default("workspaceId", "CADENYA_WORKSPACE_ID", workspace_id)
data/lib/cadenya/types.rb CHANGED
@@ -15,6 +15,10 @@ module Cadenya
15
15
  Types::AIProviderConfig_Openai.from_json(data)
16
16
  when "openaiCompatible"
17
17
  Types::AIProviderConfig_OpenaiCompatible.from_json(data)
18
+ when "vertex"
19
+ Types::AIProviderConfig_Vertex.from_json(data)
20
+ when "bedrock"
21
+ Types::AIProviderConfig_Bedrock.from_json(data)
18
22
  else
19
23
  raise ArgumentError, "AIProviderConfig: unknown type #{data["type"].inspect}"
20
24
  end
@@ -27,11 +31,90 @@ module Cadenya
27
31
  Types::AIProviderCredential_ApiKey.from_json(data)
28
32
  when "headers"
29
33
  Types::AIProviderCredential_Headers.from_json(data)
34
+ when "googleServiceAccount"
35
+ Types::AIProviderCredential_GoogleServiceAccount.from_json(data)
36
+ when "awsAccessKey"
37
+ Types::AIProviderCredential_AwsAccessKey.from_json(data)
30
38
  else
31
39
  raise ArgumentError, "AIProviderCredential: unknown type #{data["type"].inspect}"
32
40
  end
33
41
  end
34
42
 
43
+ class AIProviderCredentialFieldStatus
44
+ attr_reader :name, :sensitive, :configured, :value
45
+
46
+ def initialize(name: nil, sensitive: nil, configured: nil, value: nil)
47
+ @name = name
48
+ @sensitive = sensitive
49
+ @configured = configured
50
+ @value = value
51
+ end
52
+
53
+ def self.from_json(data)
54
+ new(
55
+ name: data["name"],
56
+ sensitive: data["sensitive"],
57
+ configured: data["configured"],
58
+ value: data["value"],
59
+ )
60
+ end
61
+
62
+ def to_h
63
+ {
64
+ name: Util.plain(@name),
65
+ sensitive: Util.plain(@sensitive),
66
+ configured: Util.plain(@configured),
67
+ value: Util.plain(@value),
68
+ }.reject { |_k, v| v.nil? }
69
+ end
70
+ end
71
+
72
+ class AIProviderCredentialPatch
73
+ attr_reader :credentials, :clear_fields
74
+
75
+ def initialize(credentials: nil, clear_fields: nil)
76
+ @credentials = credentials
77
+ @clear_fields = clear_fields
78
+ end
79
+
80
+ def self.from_json(data)
81
+ new(
82
+ credentials: data["credentials"].nil? ? nil : Types.decode_AIProviderCredential(data["credentials"]),
83
+ clear_fields: data["clearFields"],
84
+ )
85
+ end
86
+
87
+ def to_h
88
+ {
89
+ credentials: Util.plain(@credentials),
90
+ clear_fields: Util.plain(@clear_fields),
91
+ }.reject { |_k, v| v.nil? }
92
+ end
93
+ end
94
+
95
+ class AIProviderCredentialStatus
96
+ attr_reader :type, :fields
97
+
98
+ def initialize(type: nil, fields: nil)
99
+ @type = type
100
+ @fields = fields
101
+ end
102
+
103
+ def self.from_json(data)
104
+ new(
105
+ type: data["type"],
106
+ fields: data["fields"].nil? ? nil : (data["fields"]).map { |item| Types::AIProviderCredentialFieldStatus.from_json(item) },
107
+ )
108
+ end
109
+
110
+ def to_h
111
+ {
112
+ type: Util.plain(@type),
113
+ fields: Util.plain(@fields),
114
+ }.reject { |_k, v| v.nil? }
115
+ end
116
+ end
117
+
35
118
  class AIProviderKey
36
119
  attr_reader :metadata, :spec, :info
37
120
 
@@ -58,13 +141,17 @@ module Cadenya
58
141
  end
59
142
  end
60
143
 
144
+ AiProviderKeyInfoModelManagement = ["MODEL_MANAGEMENT_UNSPECIFIED", "MODEL_MANAGEMENT_CADENYA", "MODEL_MANAGEMENT_SYNCED", "MODEL_MANAGEMENT_CUSTOMIZABLE", "MODEL_MANAGEMENT_MANUAL"].freeze
145
+
61
146
  class AIProviderKeyInfo
62
- attr_reader :enabled_model_count, :disabled_model_count, :is_promotional
147
+ attr_reader :enabled_model_count, :disabled_model_count, :is_promotional, :credential_status, :model_management
63
148
 
64
- def initialize(enabled_model_count: nil, disabled_model_count: nil, is_promotional: nil)
149
+ def initialize(enabled_model_count: nil, disabled_model_count: nil, is_promotional: nil, credential_status: nil, model_management: nil)
65
150
  @enabled_model_count = enabled_model_count
66
151
  @disabled_model_count = disabled_model_count
67
152
  @is_promotional = is_promotional
153
+ @credential_status = credential_status
154
+ @model_management = model_management
68
155
  end
69
156
 
70
157
  def self.from_json(data)
@@ -72,6 +159,8 @@ module Cadenya
72
159
  enabled_model_count: data["enabledModelCount"],
73
160
  disabled_model_count: data["disabledModelCount"],
74
161
  is_promotional: data["isPromotional"],
162
+ credential_status: data["credentialStatus"].nil? ? nil : Types::AIProviderCredentialStatus.from_json(data["credentialStatus"]),
163
+ model_management: data["modelManagement"],
75
164
  )
76
165
  end
77
166
 
@@ -80,11 +169,13 @@ module Cadenya
80
169
  enabled_model_count: Util.plain(@enabled_model_count),
81
170
  disabled_model_count: Util.plain(@disabled_model_count),
82
171
  is_promotional: Util.plain(@is_promotional),
172
+ credential_status: Util.plain(@credential_status),
173
+ model_management: Util.plain(@model_management),
83
174
  }.reject { |_k, v| v.nil? }
84
175
  end
85
176
  end
86
177
 
87
- AiProviderKeySpecProvider = ["AI_PROVIDER_UNSPECIFIED", "AI_PROVIDER_OPENROUTER", "AI_PROVIDER_OPENAI", "AI_PROVIDER_ANTHROPIC", "AI_PROVIDER_GEMINI", "AI_PROVIDER_OPENAI_COMPATIBLE"].freeze
178
+ AiProviderKeySpecProvider = ["AI_PROVIDER_UNSPECIFIED", "AI_PROVIDER_OPENROUTER", "AI_PROVIDER_OPENAI", "AI_PROVIDER_ANTHROPIC", "AI_PROVIDER_GEMINI", "AI_PROVIDER_OPENAI_COMPATIBLE", "AI_PROVIDER_VERTEX", "AI_PROVIDER_BEDROCK"].freeze
88
179
 
89
180
  class AIProviderKeySpec
90
181
  attr_reader :provider, :credentials, :config
@@ -1028,6 +1119,26 @@ module Cadenya
1028
1119
  end
1029
1120
  end
1030
1121
 
1122
+ class BedrockConfig
1123
+ attr_reader :region
1124
+
1125
+ def initialize(region: nil)
1126
+ @region = region
1127
+ end
1128
+
1129
+ def self.from_json(data)
1130
+ new(
1131
+ region: data["region"],
1132
+ )
1133
+ end
1134
+
1135
+ def to_h
1136
+ {
1137
+ region: Util.plain(@region),
1138
+ }.reject { |_k, v| v.nil? }
1139
+ end
1140
+ end
1141
+
1031
1142
  def self.decode_CallableTool(data)
1032
1143
  return nil if data.nil? || data["type"].to_s.empty?
1033
1144
  case data["type"]
@@ -1665,6 +1776,35 @@ module Cadenya
1665
1776
  end
1666
1777
  end
1667
1778
 
1779
+ class CreateModelRequest
1780
+ attr_reader :workspace_id, :ai_provider_key_id, :metadata, :spec
1781
+
1782
+ def initialize(workspace_id: nil, ai_provider_key_id: nil, metadata: nil, spec: nil)
1783
+ @workspace_id = workspace_id
1784
+ @ai_provider_key_id = ai_provider_key_id
1785
+ @metadata = metadata
1786
+ @spec = spec
1787
+ end
1788
+
1789
+ def self.from_json(data)
1790
+ new(
1791
+ workspace_id: data["workspaceId"],
1792
+ ai_provider_key_id: data["aiProviderKeyId"],
1793
+ metadata: data["metadata"].nil? ? nil : Types::CreateResourceMetadata.from_json(data["metadata"]),
1794
+ spec: data["spec"].nil? ? nil : Types::ModelSpec.from_json(data["spec"]),
1795
+ )
1796
+ end
1797
+
1798
+ def to_h
1799
+ {
1800
+ workspace_id: Util.plain(@workspace_id),
1801
+ ai_provider_key_id: Util.plain(@ai_provider_key_id),
1802
+ metadata: Util.plain(@metadata),
1803
+ spec: Util.plain(@spec),
1804
+ }.reject { |_k, v| v.nil? }
1805
+ end
1806
+ end
1807
+
1668
1808
  class CreateObjectiveFeedbackRequest
1669
1809
  attr_reader :workspace_id, :objective_id, :metadata, :data
1670
1810
 
@@ -2079,6 +2219,52 @@ module Cadenya
2079
2219
  end
2080
2220
  end
2081
2221
 
2222
+ class CredentialAWSAccessKey
2223
+ attr_reader :access_key_id, :secret_access_key, :session_token
2224
+
2225
+ def initialize(access_key_id: nil, secret_access_key: nil, session_token: nil)
2226
+ @access_key_id = access_key_id
2227
+ @secret_access_key = secret_access_key
2228
+ @session_token = session_token
2229
+ end
2230
+
2231
+ def self.from_json(data)
2232
+ new(
2233
+ access_key_id: data["accessKeyId"],
2234
+ secret_access_key: data["secretAccessKey"],
2235
+ session_token: data["sessionToken"],
2236
+ )
2237
+ end
2238
+
2239
+ def to_h
2240
+ {
2241
+ access_key_id: Util.plain(@access_key_id),
2242
+ secret_access_key: Util.plain(@secret_access_key),
2243
+ session_token: Util.plain(@session_token),
2244
+ }.reject { |_k, v| v.nil? }
2245
+ end
2246
+ end
2247
+
2248
+ class CredentialGoogleServiceAccount
2249
+ attr_reader :json
2250
+
2251
+ def initialize(json: nil)
2252
+ @json = json
2253
+ end
2254
+
2255
+ def self.from_json(data)
2256
+ new(
2257
+ json: data["json"],
2258
+ )
2259
+ end
2260
+
2261
+ def to_h
2262
+ {
2263
+ json: Util.plain(@json),
2264
+ }.reject { |_k, v| v.nil? }
2265
+ end
2266
+ end
2267
+
2082
2268
  class CredentialHeaders
2083
2269
  attr_reader :headers
2084
2270
 
@@ -2625,29 +2811,6 @@ module Cadenya
2625
2811
  end
2626
2812
  end
2627
2813
 
2628
- class ListObjectiveTasksResponse
2629
- attr_reader :items, :pagination
2630
-
2631
- def initialize(items: nil, pagination: nil)
2632
- @items = items
2633
- @pagination = pagination
2634
- end
2635
-
2636
- def self.from_json(data)
2637
- new(
2638
- items: data["items"].nil? ? nil : (data["items"]).map { |item| Types::ObjectiveTask.from_json(item) },
2639
- pagination: data["pagination"].nil? ? nil : Types::Page.from_json(data["pagination"]),
2640
- )
2641
- end
2642
-
2643
- def to_h
2644
- {
2645
- items: Util.plain(@items),
2646
- pagination: Util.plain(@pagination),
2647
- }.reject { |_k, v| v.nil? }
2648
- end
2649
- end
2650
-
2651
2814
  class ListObjectiveToolCallsResponse
2652
2815
  attr_reader :items, :pagination
2653
2816
 
@@ -3333,14 +3496,19 @@ module Cadenya
3333
3496
 
3334
3497
  ModelState = ["STATE_UNSPECIFIED", "STATE_ENABLED", "STATE_DISABLED"].freeze
3335
3498
 
3499
+ ModelProvenance = ["PROVENANCE_UNSPECIFIED", "PROVENANCE_SYNCED_FROM_PROVIDER", "PROVENANCE_MANUALLY_ENTERED"].freeze
3500
+
3336
3501
  class Model
3337
- attr_reader :metadata, :spec, :info, :state
3502
+ attr_reader :metadata, :spec, :info, :state, :provenance, :pricing_override, :base_pricing
3338
3503
 
3339
- def initialize(metadata: nil, spec: nil, info: nil, state: nil)
3504
+ def initialize(metadata: nil, spec: nil, info: nil, state: nil, provenance: nil, pricing_override: nil, base_pricing: nil)
3340
3505
  @metadata = metadata
3341
3506
  @spec = spec
3342
3507
  @info = info
3343
3508
  @state = state
3509
+ @provenance = provenance
3510
+ @pricing_override = pricing_override
3511
+ @base_pricing = base_pricing
3344
3512
  end
3345
3513
 
3346
3514
  def self.from_json(data)
@@ -3349,6 +3517,9 @@ module Cadenya
3349
3517
  spec: data["spec"].nil? ? nil : Types::ModelSpec.from_json(data["spec"]),
3350
3518
  info: data["info"].nil? ? nil : Types::ModelInfo.from_json(data["info"]),
3351
3519
  state: data["state"],
3520
+ provenance: data["provenance"],
3521
+ pricing_override: data["pricingOverride"].nil? ? nil : Types::ModelPricingOverride.from_json(data["pricingOverride"]),
3522
+ base_pricing: data["basePricing"].nil? ? nil : Types::ModelBasePricing.from_json(data["basePricing"]),
3352
3523
  )
3353
3524
  end
3354
3525
 
@@ -3358,6 +3529,32 @@ module Cadenya
3358
3529
  spec: Util.plain(@spec),
3359
3530
  info: Util.plain(@info),
3360
3531
  state: Util.plain(@state),
3532
+ provenance: Util.plain(@provenance),
3533
+ pricing_override: Util.plain(@pricing_override),
3534
+ base_pricing: Util.plain(@base_pricing),
3535
+ }.reject { |_k, v| v.nil? }
3536
+ end
3537
+ end
3538
+
3539
+ class ModelBasePricing
3540
+ attr_reader :input_price_per_million_tokens, :output_price_per_million_tokens
3541
+
3542
+ def initialize(input_price_per_million_tokens: nil, output_price_per_million_tokens: nil)
3543
+ @input_price_per_million_tokens = input_price_per_million_tokens
3544
+ @output_price_per_million_tokens = output_price_per_million_tokens
3545
+ end
3546
+
3547
+ def self.from_json(data)
3548
+ new(
3549
+ input_price_per_million_tokens: data["inputPricePerMillionTokens"],
3550
+ output_price_per_million_tokens: data["outputPricePerMillionTokens"],
3551
+ )
3552
+ end
3553
+
3554
+ def to_h
3555
+ {
3556
+ input_price_per_million_tokens: Util.plain(@input_price_per_million_tokens),
3557
+ output_price_per_million_tokens: Util.plain(@output_price_per_million_tokens),
3361
3558
  }.reject { |_k, v| v.nil? }
3362
3559
  end
3363
3560
  end
@@ -3388,10 +3585,33 @@ module Cadenya
3388
3585
  end
3389
3586
  end
3390
3587
 
3588
+ class ModelPricingOverride
3589
+ attr_reader :input_price_per_million_tokens, :output_price_per_million_tokens
3590
+
3591
+ def initialize(input_price_per_million_tokens: nil, output_price_per_million_tokens: nil)
3592
+ @input_price_per_million_tokens = input_price_per_million_tokens
3593
+ @output_price_per_million_tokens = output_price_per_million_tokens
3594
+ end
3595
+
3596
+ def self.from_json(data)
3597
+ new(
3598
+ input_price_per_million_tokens: data["inputPricePerMillionTokens"],
3599
+ output_price_per_million_tokens: data["outputPricePerMillionTokens"],
3600
+ )
3601
+ end
3602
+
3603
+ def to_h
3604
+ {
3605
+ input_price_per_million_tokens: Util.plain(@input_price_per_million_tokens),
3606
+ output_price_per_million_tokens: Util.plain(@output_price_per_million_tokens),
3607
+ }.reject { |_k, v| v.nil? }
3608
+ end
3609
+ end
3610
+
3391
3611
  class ModelSpec
3392
- attr_reader :provider, :family, :max_input_tokens, :max_output_tokens, :input_price_per_million_tokens, :output_price_per_million_tokens, :capabilities
3612
+ attr_reader :provider, :family, :max_input_tokens, :max_output_tokens, :input_price_per_million_tokens, :output_price_per_million_tokens, :capabilities, :provider_model_id
3393
3613
 
3394
- def initialize(provider: nil, family: nil, max_input_tokens: nil, max_output_tokens: nil, input_price_per_million_tokens: nil, output_price_per_million_tokens: nil, capabilities: nil)
3614
+ def initialize(provider: nil, family: nil, max_input_tokens: nil, max_output_tokens: nil, input_price_per_million_tokens: nil, output_price_per_million_tokens: nil, capabilities: nil, provider_model_id: nil)
3395
3615
  @provider = provider
3396
3616
  @family = family
3397
3617
  @max_input_tokens = max_input_tokens
@@ -3399,6 +3619,7 @@ module Cadenya
3399
3619
  @input_price_per_million_tokens = input_price_per_million_tokens
3400
3620
  @output_price_per_million_tokens = output_price_per_million_tokens
3401
3621
  @capabilities = capabilities
3622
+ @provider_model_id = provider_model_id
3402
3623
  end
3403
3624
 
3404
3625
  def self.from_json(data)
@@ -3410,6 +3631,7 @@ module Cadenya
3410
3631
  input_price_per_million_tokens: data["inputPricePerMillionTokens"],
3411
3632
  output_price_per_million_tokens: data["outputPricePerMillionTokens"],
3412
3633
  capabilities: data["capabilities"].nil? ? nil : (data["capabilities"]).map { |item| Types.decode_ModelSpec_Capability(item) },
3634
+ provider_model_id: data["providerModelId"],
3413
3635
  )
3414
3636
  end
3415
3637
 
@@ -3422,6 +3644,7 @@ module Cadenya
3422
3644
  input_price_per_million_tokens: Util.plain(@input_price_per_million_tokens),
3423
3645
  output_price_per_million_tokens: Util.plain(@output_price_per_million_tokens),
3424
3646
  capabilities: Util.plain(@capabilities),
3647
+ provider_model_id: Util.plain(@provider_model_id),
3425
3648
  }.reject { |_k, v| v.nil? }
3426
3649
  end
3427
3650
  end
@@ -3995,58 +4218,6 @@ module Cadenya
3995
4218
  end
3996
4219
  end
3997
4220
 
3998
- class ObjectiveTask
3999
- attr_reader :metadata, :data
4000
-
4001
- def initialize(metadata: nil, data: nil)
4002
- @metadata = metadata
4003
- @data = data
4004
- end
4005
-
4006
- def self.from_json(data)
4007
- new(
4008
- metadata: data["metadata"].nil? ? nil : Types::BareMetadata.from_json(data["metadata"]),
4009
- data: data["data"].nil? ? nil : Types::ObjectiveTaskData.from_json(data["data"]),
4010
- )
4011
- end
4012
-
4013
- def to_h
4014
- {
4015
- metadata: Util.plain(@metadata),
4016
- data: Util.plain(@data),
4017
- }.reject { |_k, v| v.nil? }
4018
- end
4019
- end
4020
-
4021
- class ObjectiveTaskData
4022
- attr_reader :number, :task, :completed, :completed_at
4023
-
4024
- def initialize(number: nil, task: nil, completed: nil, completed_at: nil)
4025
- @number = number
4026
- @task = task
4027
- @completed = completed
4028
- @completed_at = completed_at
4029
- end
4030
-
4031
- def self.from_json(data)
4032
- new(
4033
- number: data["number"],
4034
- task: data["task"],
4035
- completed: data["completed"],
4036
- completed_at: data["completedAt"].nil? ? nil : Time.iso8601(data["completedAt"]),
4037
- )
4038
- end
4039
-
4040
- def to_h
4041
- {
4042
- number: Util.plain(@number),
4043
- task: Util.plain(@task),
4044
- completed: Util.plain(@completed),
4045
- completed_at: Util.plain(@completed_at),
4046
- }.reject { |_k, v| v.nil? }
4047
- end
4048
- end
4049
-
4050
4221
  class ObjectiveTimedOut
4051
4222
  attr_reader :message
4052
4223
 
@@ -4280,21 +4451,24 @@ module Cadenya
4280
4451
  end
4281
4452
 
4282
4453
  class ObjectiveToolCallResult_TextBlock
4283
- attr_reader :text
4454
+ attr_reader :text, :size_bytes
4284
4455
 
4285
- def initialize(text: nil)
4456
+ def initialize(text: nil, size_bytes: nil)
4286
4457
  @text = text
4458
+ @size_bytes = size_bytes
4287
4459
  end
4288
4460
 
4289
4461
  def self.from_json(data)
4290
4462
  new(
4291
4463
  text: data["text"],
4464
+ size_bytes: data["sizeBytes"],
4292
4465
  )
4293
4466
  end
4294
4467
 
4295
4468
  def to_h
4296
4469
  {
4297
4470
  text: Util.plain(@text),
4471
+ size_bytes: Util.plain(@size_bytes),
4298
4472
  }.reject { |_k, v| v.nil? }
4299
4473
  end
4300
4474
  end
@@ -6533,14 +6707,15 @@ module Cadenya
6533
6707
  end
6534
6708
 
6535
6709
  class UpdateAIProviderKeyRequest
6536
- attr_reader :workspace_id, :id, :metadata, :spec, :update_mask
6710
+ attr_reader :workspace_id, :id, :metadata, :spec, :update_mask, :credential_patch
6537
6711
 
6538
- def initialize(workspace_id: nil, id: nil, metadata: nil, spec: nil, update_mask: nil)
6712
+ def initialize(workspace_id: nil, id: nil, metadata: nil, spec: nil, update_mask: nil, credential_patch: nil)
6539
6713
  @workspace_id = workspace_id
6540
6714
  @id = id
6541
6715
  @metadata = metadata
6542
6716
  @spec = spec
6543
6717
  @update_mask = update_mask
6718
+ @credential_patch = credential_patch
6544
6719
  end
6545
6720
 
6546
6721
  def self.from_json(data)
@@ -6550,6 +6725,7 @@ module Cadenya
6550
6725
  metadata: data["metadata"].nil? ? nil : Types::UpdateResourceMetadata.from_json(data["metadata"]),
6551
6726
  spec: data["spec"].nil? ? nil : Types::AIProviderKeySpec.from_json(data["spec"]),
6552
6727
  update_mask: data["updateMask"],
6728
+ credential_patch: data["credentialPatch"].nil? ? nil : Types::AIProviderCredentialPatch.from_json(data["credentialPatch"]),
6553
6729
  )
6554
6730
  end
6555
6731
 
@@ -6560,6 +6736,7 @@ module Cadenya
6560
6736
  metadata: Util.plain(@metadata),
6561
6737
  spec: Util.plain(@spec),
6562
6738
  update_mask: Util.plain(@update_mask),
6739
+ credential_patch: Util.plain(@credential_patch),
6563
6740
  }.reject { |_k, v| v.nil? }
6564
6741
  end
6565
6742
  end
@@ -6823,6 +7000,41 @@ module Cadenya
6823
7000
  end
6824
7001
  end
6825
7002
 
7003
+ class UpdateModelRequest
7004
+ attr_reader :workspace_id, :id, :metadata, :spec, :pricing_override, :update_mask
7005
+
7006
+ def initialize(workspace_id: nil, id: nil, metadata: nil, spec: nil, pricing_override: nil, update_mask: nil)
7007
+ @workspace_id = workspace_id
7008
+ @id = id
7009
+ @metadata = metadata
7010
+ @spec = spec
7011
+ @pricing_override = pricing_override
7012
+ @update_mask = update_mask
7013
+ end
7014
+
7015
+ def self.from_json(data)
7016
+ new(
7017
+ workspace_id: data["workspaceId"],
7018
+ id: data["id"],
7019
+ metadata: data["metadata"].nil? ? nil : Types::UpdateResourceMetadata.from_json(data["metadata"]),
7020
+ spec: data["spec"].nil? ? nil : Types::ModelSpec.from_json(data["spec"]),
7021
+ pricing_override: data["pricingOverride"].nil? ? nil : Types::ModelPricingOverride.from_json(data["pricingOverride"]),
7022
+ update_mask: data["updateMask"],
7023
+ )
7024
+ end
7025
+
7026
+ def to_h
7027
+ {
7028
+ workspace_id: Util.plain(@workspace_id),
7029
+ id: Util.plain(@id),
7030
+ metadata: Util.plain(@metadata),
7031
+ spec: Util.plain(@spec),
7032
+ pricing_override: Util.plain(@pricing_override),
7033
+ update_mask: Util.plain(@update_mask),
7034
+ }.reject { |_k, v| v.nil? }
7035
+ end
7036
+ end
7037
+
6826
7038
  class UpdateResourceMetadata
6827
7039
  attr_reader :name, :external_id, :labels
6828
7040
 
@@ -7187,6 +7399,29 @@ module Cadenya
7187
7399
  end
7188
7400
  end
7189
7401
 
7402
+ class VertexConfig
7403
+ attr_reader :project_id, :location
7404
+
7405
+ def initialize(project_id: nil, location: nil)
7406
+ @project_id = project_id
7407
+ @location = location
7408
+ end
7409
+
7410
+ def self.from_json(data)
7411
+ new(
7412
+ project_id: data["projectId"],
7413
+ location: data["location"],
7414
+ )
7415
+ end
7416
+
7417
+ def to_h
7418
+ {
7419
+ project_id: Util.plain(@project_id),
7420
+ location: Util.plain(@location),
7421
+ }.reject { |_k, v| v.nil? }
7422
+ end
7423
+ end
7424
+
7190
7425
  class WebhookDelivery
7191
7426
  attr_reader :metadata, :data
7192
7427
 
@@ -9296,6 +9531,52 @@ module Cadenya
9296
9531
  end
9297
9532
  end
9298
9533
 
9534
+ class AIProviderCredential_GoogleServiceAccount
9535
+ attr_reader :type, :google_service_account
9536
+
9537
+ def initialize(type: nil, google_service_account: nil)
9538
+ @type = type
9539
+ @google_service_account = google_service_account
9540
+ end
9541
+
9542
+ def self.from_json(data)
9543
+ new(
9544
+ type: data["type"],
9545
+ google_service_account: data["googleServiceAccount"].nil? ? nil : Types::CredentialGoogleServiceAccount.from_json(data["googleServiceAccount"]),
9546
+ )
9547
+ end
9548
+
9549
+ def to_h
9550
+ {
9551
+ type: Util.plain(@type),
9552
+ google_service_account: Util.plain(@google_service_account),
9553
+ }.reject { |_k, v| v.nil? }
9554
+ end
9555
+ end
9556
+
9557
+ class AIProviderCredential_AwsAccessKey
9558
+ attr_reader :type, :aws_access_key
9559
+
9560
+ def initialize(type: nil, aws_access_key: nil)
9561
+ @type = type
9562
+ @aws_access_key = aws_access_key
9563
+ end
9564
+
9565
+ def self.from_json(data)
9566
+ new(
9567
+ type: data["type"],
9568
+ aws_access_key: data["awsAccessKey"].nil? ? nil : Types::CredentialAWSAccessKey.from_json(data["awsAccessKey"]),
9569
+ )
9570
+ end
9571
+
9572
+ def to_h
9573
+ {
9574
+ type: Util.plain(@type),
9575
+ aws_access_key: Util.plain(@aws_access_key),
9576
+ }.reject { |_k, v| v.nil? }
9577
+ end
9578
+ end
9579
+
9299
9580
  class AIProviderConfig_Openrouter
9300
9581
  attr_reader :type, :openrouter
9301
9582
 
@@ -9365,6 +9646,52 @@ module Cadenya
9365
9646
  end
9366
9647
  end
9367
9648
 
9649
+ class AIProviderConfig_Vertex
9650
+ attr_reader :type, :vertex
9651
+
9652
+ def initialize(type: nil, vertex: nil)
9653
+ @type = type
9654
+ @vertex = vertex
9655
+ end
9656
+
9657
+ def self.from_json(data)
9658
+ new(
9659
+ type: data["type"],
9660
+ vertex: data["vertex"].nil? ? nil : Types::VertexConfig.from_json(data["vertex"]),
9661
+ )
9662
+ end
9663
+
9664
+ def to_h
9665
+ {
9666
+ type: Util.plain(@type),
9667
+ vertex: Util.plain(@vertex),
9668
+ }.reject { |_k, v| v.nil? }
9669
+ end
9670
+ end
9671
+
9672
+ class AIProviderConfig_Bedrock
9673
+ attr_reader :type, :bedrock
9674
+
9675
+ def initialize(type: nil, bedrock: nil)
9676
+ @type = type
9677
+ @bedrock = bedrock
9678
+ end
9679
+
9680
+ def self.from_json(data)
9681
+ new(
9682
+ type: data["type"],
9683
+ bedrock: data["bedrock"].nil? ? nil : Types::BedrockConfig.from_json(data["bedrock"]),
9684
+ )
9685
+ end
9686
+
9687
+ def to_h
9688
+ {
9689
+ type: Util.plain(@type),
9690
+ bedrock: Util.plain(@bedrock),
9691
+ }.reject { |_k, v| v.nil? }
9692
+ end
9693
+ end
9694
+
9368
9695
  class ModelSpec_Capability_Temperature
9369
9696
  attr_reader :type, :temperature
9370
9697
 
@@ -9600,6 +9927,10 @@ module Cadenya
9600
9927
  (->(_v) { encode_AIProviderConfig_Openai(_v) }).call(data)
9601
9928
  when "openaiCompatible"
9602
9929
  (->(_v) { encode_AIProviderConfig_OpenaiCompatible(_v) }).call(data)
9930
+ when "vertex"
9931
+ (->(_v) { encode_AIProviderConfig_Vertex(_v) }).call(data)
9932
+ when "bedrock"
9933
+ (->(_v) { encode_AIProviderConfig_Bedrock(_v) }).call(data)
9603
9934
  else
9604
9935
  data
9605
9936
  end
@@ -9616,11 +9947,25 @@ module Cadenya
9616
9947
  (->(_v) { encode_AIProviderCredential_ApiKey(_v) }).call(data)
9617
9948
  when "headers"
9618
9949
  (->(_v) { encode_AIProviderCredential_Headers(_v) }).call(data)
9950
+ when "googleServiceAccount"
9951
+ (->(_v) { encode_AIProviderCredential_GoogleServiceAccount(_v) }).call(data)
9952
+ when "awsAccessKey"
9953
+ (->(_v) { encode_AIProviderCredential_AwsAccessKey(_v) }).call(data)
9619
9954
  else
9620
9955
  data
9621
9956
  end
9622
9957
  end
9623
9958
 
9959
+ ENCODE_AI_PROVIDER_CREDENTIAL_PATCH = {
9960
+ "credentials" => ["credentials", ->(_v) { encode_AIProviderCredential(_v) }],
9961
+ "clear_fields" => ["clearFields", nil],
9962
+ "clearFields" => ["clearFields", nil],
9963
+ }.freeze
9964
+
9965
+ def self.encode_AIProviderCredentialPatch(data)
9966
+ encode_fields(ENCODE_AI_PROVIDER_CREDENTIAL_PATCH, data)
9967
+ end
9968
+
9624
9969
  ENCODE_AI_PROVIDER_KEY_SPEC = {
9625
9970
  "provider" => ["provider", nil],
9626
9971
  "credentials" => ["credentials", ->(_v) { encode_AIProviderCredential(_v) }],
@@ -9784,6 +10129,30 @@ module Cadenya
9784
10129
  encode_fields(ENCODE_AGENT_VARIATION_SPEC_PROGRESSIVE_DISCOVERY, data)
9785
10130
  end
9786
10131
 
10132
+ ENCODE_BEDROCK_CONFIG = {
10133
+ "region" => ["region", nil],
10134
+ }.freeze
10135
+
10136
+ def self.encode_BedrockConfig(data)
10137
+ encode_fields(ENCODE_BEDROCK_CONFIG, data)
10138
+ end
10139
+
10140
+ ENCODE_CAPABILITY_REASONING = {
10141
+ "mode" => ["mode", nil],
10142
+ }.freeze
10143
+
10144
+ def self.encode_Capability_Reasoning(data)
10145
+ encode_fields(ENCODE_CAPABILITY_REASONING, data)
10146
+ end
10147
+
10148
+ ENCODE_CAPABILITY_STOP_SEQUENCES = {
10149
+ "limit" => ["limit", nil],
10150
+ }.freeze
10151
+
10152
+ def self.encode_Capability_StopSequences(data)
10153
+ encode_fields(ENCODE_CAPABILITY_STOP_SEQUENCES, data)
10154
+ end
10155
+
9787
10156
  ENCODE_COMPACTION_CONFIG_SUMMARIZATION_STRATEGY = {
9788
10157
  "instructions" => ["instructions", nil],
9789
10158
  }.freeze
@@ -9913,6 +10282,27 @@ module Cadenya
9913
10282
  encode_fields(ENCODE_CREDENTIAL_API_KEY, data)
9914
10283
  end
9915
10284
 
10285
+ ENCODE_CREDENTIAL_AWS_ACCESS_KEY = {
10286
+ "access_key_id" => ["accessKeyId", nil],
10287
+ "accessKeyId" => ["accessKeyId", nil],
10288
+ "secret_access_key" => ["secretAccessKey", nil],
10289
+ "secretAccessKey" => ["secretAccessKey", nil],
10290
+ "session_token" => ["sessionToken", nil],
10291
+ "sessionToken" => ["sessionToken", nil],
10292
+ }.freeze
10293
+
10294
+ def self.encode_CredentialAWSAccessKey(data)
10295
+ encode_fields(ENCODE_CREDENTIAL_AWS_ACCESS_KEY, data)
10296
+ end
10297
+
10298
+ ENCODE_CREDENTIAL_GOOGLE_SERVICE_ACCOUNT = {
10299
+ "json" => ["json", nil],
10300
+ }.freeze
10301
+
10302
+ def self.encode_CredentialGoogleServiceAccount(data)
10303
+ encode_fields(ENCODE_CREDENTIAL_GOOGLE_SERVICE_ACCOUNT, data)
10304
+ end
10305
+
9916
10306
  ENCODE_CREDENTIAL_HEADERS = {
9917
10307
  "headers" => ["headers", nil],
9918
10308
  }.freeze
@@ -9987,6 +10377,63 @@ module Cadenya
9987
10377
  encode_fields(ENCODE_MEMORY_REFERENCE, data)
9988
10378
  end
9989
10379
 
10380
+ ENCODE_MODEL_PRICING_OVERRIDE = {
10381
+ "input_price_per_million_tokens" => ["inputPricePerMillionTokens", nil],
10382
+ "inputPricePerMillionTokens" => ["inputPricePerMillionTokens", nil],
10383
+ "output_price_per_million_tokens" => ["outputPricePerMillionTokens", nil],
10384
+ "outputPricePerMillionTokens" => ["outputPricePerMillionTokens", nil],
10385
+ }.freeze
10386
+
10387
+ def self.encode_ModelPricingOverride(data)
10388
+ encode_fields(ENCODE_MODEL_PRICING_OVERRIDE, data)
10389
+ end
10390
+
10391
+ ENCODE_MODEL_SPEC = {
10392
+ "provider" => ["provider", nil],
10393
+ "family" => ["family", nil],
10394
+ "max_input_tokens" => ["maxInputTokens", nil],
10395
+ "maxInputTokens" => ["maxInputTokens", nil],
10396
+ "max_output_tokens" => ["maxOutputTokens", nil],
10397
+ "maxOutputTokens" => ["maxOutputTokens", nil],
10398
+ "input_price_per_million_tokens" => ["inputPricePerMillionTokens", nil],
10399
+ "inputPricePerMillionTokens" => ["inputPricePerMillionTokens", nil],
10400
+ "output_price_per_million_tokens" => ["outputPricePerMillionTokens", nil],
10401
+ "outputPricePerMillionTokens" => ["outputPricePerMillionTokens", nil],
10402
+ "capabilities" => ["capabilities", ->(_v) { _v.is_a?(Array) ? _v.map { |_i| (->(_v) { encode_ModelSpec_Capability(_v) }).call(_i) } : _v }],
10403
+ "provider_model_id" => ["providerModelId", nil],
10404
+ "providerModelId" => ["providerModelId", nil],
10405
+ }.freeze
10406
+
10407
+ def self.encode_ModelSpec(data)
10408
+ encode_fields(ENCODE_MODEL_SPEC, data)
10409
+ end
10410
+
10411
+ def self.encode_ModelSpec_Capability(data)
10412
+ data = data.to_h if !data.is_a?(Hash) && data.class.name.to_s.start_with?(name.split("::").first + "::Types")
10413
+ unless data.is_a?(Hash)
10414
+ raise TypeError, "expected a Hash (or a decoded Types value object), got #{data.class}"
10415
+ end
10416
+
10417
+ case data["type"] || data[:type]
10418
+ when "temperature"
10419
+ (->(_v) { encode_ModelSpec_Capability_Temperature(_v) }).call(data)
10420
+ when "topP"
10421
+ (->(_v) { encode_ModelSpec_Capability_TopP(_v) }).call(data)
10422
+ when "topK"
10423
+ (->(_v) { encode_ModelSpec_Capability_TopK(_v) }).call(data)
10424
+ when "stopSequences"
10425
+ (->(_v) { encode_ModelSpec_Capability_StopSequences(_v) }).call(data)
10426
+ when "maxOutputTokens"
10427
+ (->(_v) { encode_ModelSpec_Capability_MaxOutputTokens(_v) }).call(data)
10428
+ when "reasoning"
10429
+ (->(_v) { encode_ModelSpec_Capability_Reasoning(_v) }).call(data)
10430
+ when "caching"
10431
+ (->(_v) { encode_ModelSpec_Capability_Caching(_v) }).call(data)
10432
+ else
10433
+ data
10434
+ end
10435
+ end
10436
+
9990
10437
  ENCODE_OBJECTIVE_EPISODIC_CONFIG = {
9991
10438
  "key" => ["key", nil],
9992
10439
  }.freeze
@@ -10513,6 +10960,16 @@ module Cadenya
10513
10960
  encode_fields(ENCODE_UPLOAD_SPEC, data)
10514
10961
  end
10515
10962
 
10963
+ ENCODE_VERTEX_CONFIG = {
10964
+ "project_id" => ["projectId", nil],
10965
+ "projectId" => ["projectId", nil],
10966
+ "location" => ["location", nil],
10967
+ }.freeze
10968
+
10969
+ def self.encode_VertexConfig(data)
10970
+ encode_fields(ENCODE_VERTEX_CONFIG, data)
10971
+ end
10972
+
10516
10973
  ENCODE_WIDGET_SESSION_SPEC = {
10517
10974
  "widget_id" => ["widgetId", nil],
10518
10975
  "widgetId" => ["widgetId", nil],
@@ -10916,6 +11373,26 @@ module Cadenya
10916
11373
  encode_fields(ENCODE_AI_PROVIDER_CREDENTIAL_HEADERS, data)
10917
11374
  end
10918
11375
 
11376
+ ENCODE_AI_PROVIDER_CREDENTIAL_GOOGLE_SERVICE_ACCOUNT = {
11377
+ "type" => ["type", nil],
11378
+ "google_service_account" => ["googleServiceAccount", ->(_v) { encode_CredentialGoogleServiceAccount(_v) }],
11379
+ "googleServiceAccount" => ["googleServiceAccount", ->(_v) { encode_CredentialGoogleServiceAccount(_v) }],
11380
+ }.freeze
11381
+
11382
+ def self.encode_AIProviderCredential_GoogleServiceAccount(data)
11383
+ encode_fields(ENCODE_AI_PROVIDER_CREDENTIAL_GOOGLE_SERVICE_ACCOUNT, data)
11384
+ end
11385
+
11386
+ ENCODE_AI_PROVIDER_CREDENTIAL_AWS_ACCESS_KEY = {
11387
+ "type" => ["type", nil],
11388
+ "aws_access_key" => ["awsAccessKey", ->(_v) { encode_CredentialAWSAccessKey(_v) }],
11389
+ "awsAccessKey" => ["awsAccessKey", ->(_v) { encode_CredentialAWSAccessKey(_v) }],
11390
+ }.freeze
11391
+
11392
+ def self.encode_AIProviderCredential_AwsAccessKey(data)
11393
+ encode_fields(ENCODE_AI_PROVIDER_CREDENTIAL_AWS_ACCESS_KEY, data)
11394
+ end
11395
+
10919
11396
  ENCODE_AI_PROVIDER_CONFIG_OPENROUTER = {
10920
11397
  "type" => ["type", nil],
10921
11398
  "openrouter" => ["openrouter", ->(_v) { encode_OpenRouterConfig(_v) }],
@@ -10944,5 +11421,90 @@ module Cadenya
10944
11421
  encode_fields(ENCODE_AI_PROVIDER_CONFIG_OPENAI_COMPATIBLE, data)
10945
11422
  end
10946
11423
 
11424
+ ENCODE_AI_PROVIDER_CONFIG_VERTEX = {
11425
+ "type" => ["type", nil],
11426
+ "vertex" => ["vertex", ->(_v) { encode_VertexConfig(_v) }],
11427
+ }.freeze
11428
+
11429
+ def self.encode_AIProviderConfig_Vertex(data)
11430
+ encode_fields(ENCODE_AI_PROVIDER_CONFIG_VERTEX, data)
11431
+ end
11432
+
11433
+ ENCODE_AI_PROVIDER_CONFIG_BEDROCK = {
11434
+ "type" => ["type", nil],
11435
+ "bedrock" => ["bedrock", ->(_v) { encode_BedrockConfig(_v) }],
11436
+ }.freeze
11437
+
11438
+ def self.encode_AIProviderConfig_Bedrock(data)
11439
+ encode_fields(ENCODE_AI_PROVIDER_CONFIG_BEDROCK, data)
11440
+ end
11441
+
11442
+ ENCODE_MODEL_SPEC_CAPABILITY_TEMPERATURE = {
11443
+ "type" => ["type", nil],
11444
+ "temperature" => ["temperature", nil],
11445
+ }.freeze
11446
+
11447
+ def self.encode_ModelSpec_Capability_Temperature(data)
11448
+ encode_fields(ENCODE_MODEL_SPEC_CAPABILITY_TEMPERATURE, data)
11449
+ end
11450
+
11451
+ ENCODE_MODEL_SPEC_CAPABILITY_TOP_P = {
11452
+ "type" => ["type", nil],
11453
+ "top_p" => ["topP", nil],
11454
+ "topP" => ["topP", nil],
11455
+ }.freeze
11456
+
11457
+ def self.encode_ModelSpec_Capability_TopP(data)
11458
+ encode_fields(ENCODE_MODEL_SPEC_CAPABILITY_TOP_P, data)
11459
+ end
11460
+
11461
+ ENCODE_MODEL_SPEC_CAPABILITY_TOP_K = {
11462
+ "type" => ["type", nil],
11463
+ "top_k" => ["topK", nil],
11464
+ "topK" => ["topK", nil],
11465
+ }.freeze
11466
+
11467
+ def self.encode_ModelSpec_Capability_TopK(data)
11468
+ encode_fields(ENCODE_MODEL_SPEC_CAPABILITY_TOP_K, data)
11469
+ end
11470
+
11471
+ ENCODE_MODEL_SPEC_CAPABILITY_STOP_SEQUENCES = {
11472
+ "type" => ["type", nil],
11473
+ "stop_sequences" => ["stopSequences", ->(_v) { encode_Capability_StopSequences(_v) }],
11474
+ "stopSequences" => ["stopSequences", ->(_v) { encode_Capability_StopSequences(_v) }],
11475
+ }.freeze
11476
+
11477
+ def self.encode_ModelSpec_Capability_StopSequences(data)
11478
+ encode_fields(ENCODE_MODEL_SPEC_CAPABILITY_STOP_SEQUENCES, data)
11479
+ end
11480
+
11481
+ ENCODE_MODEL_SPEC_CAPABILITY_MAX_OUTPUT_TOKENS = {
11482
+ "type" => ["type", nil],
11483
+ "max_output_tokens" => ["maxOutputTokens", nil],
11484
+ "maxOutputTokens" => ["maxOutputTokens", nil],
11485
+ }.freeze
11486
+
11487
+ def self.encode_ModelSpec_Capability_MaxOutputTokens(data)
11488
+ encode_fields(ENCODE_MODEL_SPEC_CAPABILITY_MAX_OUTPUT_TOKENS, data)
11489
+ end
11490
+
11491
+ ENCODE_MODEL_SPEC_CAPABILITY_REASONING = {
11492
+ "type" => ["type", nil],
11493
+ "reasoning" => ["reasoning", ->(_v) { encode_Capability_Reasoning(_v) }],
11494
+ }.freeze
11495
+
11496
+ def self.encode_ModelSpec_Capability_Reasoning(data)
11497
+ encode_fields(ENCODE_MODEL_SPEC_CAPABILITY_REASONING, data)
11498
+ end
11499
+
11500
+ ENCODE_MODEL_SPEC_CAPABILITY_CACHING = {
11501
+ "type" => ["type", nil],
11502
+ "caching" => ["caching", nil],
11503
+ }.freeze
11504
+
11505
+ def self.encode_ModelSpec_Capability_Caching(data)
11506
+ encode_fields(ENCODE_MODEL_SPEC_CAPABILITY_CACHING, data)
11507
+ end
11508
+
10947
11509
  end
10948
11510
  end
data/lib/cadenya.rb CHANGED
@@ -16,9 +16,9 @@ require_relative "cadenya/resources/agents"
16
16
  require_relative "cadenya/resources/agent_schedules"
17
17
  require_relative "cadenya/resources/agent_variations"
18
18
  require_relative "cadenya/resources/ai_provider_keys"
19
+ require_relative "cadenya/resources/models"
19
20
  require_relative "cadenya/resources/memory_layers"
20
21
  require_relative "cadenya/resources/memory_entries"
21
- require_relative "cadenya/resources/models"
22
22
  require_relative "cadenya/resources/objectives"
23
23
  require_relative "cadenya/resources/tool_search"
24
24
  require_relative "cadenya/resources/tenants"
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.0.1
4
+ version: 1.1.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-08-28 00:00:00.000000000 Z
11
+ date: 2026-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday