cadenya 0.51.1 → 0.52.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +14 -1
- data/README.md +2 -2
- data/SECURITY.md +6 -10
- data/lib/cadenya/internal/transport/base_client.rb +13 -13
- data/lib/cadenya/models/agents/agent_variation_spec.rb +5 -2
- data/lib/cadenya/models/agents/agent_variation_spec_model_config.rb +74 -5
- data/lib/cadenya/models/capability_max_output_tokens.rb +8 -0
- data/lib/cadenya/models/capability_reasoning.rb +38 -0
- data/lib/cadenya/models/capability_stop_sequences.rb +22 -0
- data/lib/cadenya/models/capability_temperature.rb +8 -0
- data/lib/cadenya/models/capability_top_k.rb +8 -0
- data/lib/cadenya/models/capability_top_p.rb +8 -0
- data/lib/cadenya/models/model_spec.rb +11 -26
- data/lib/cadenya/models/model_spec_capability.rb +29 -0
- data/lib/cadenya/models/model_spec_capability_max_output_tokens.rb +37 -0
- data/lib/cadenya/models/model_spec_capability_reasoning.rb +37 -0
- data/lib/cadenya/models/model_spec_capability_stop_sequences.rb +33 -0
- data/lib/cadenya/models/model_spec_capability_temperature.rb +33 -0
- data/lib/cadenya/models/model_spec_capability_top_k.rb +33 -0
- data/lib/cadenya/models/model_spec_capability_top_p.rb +33 -0
- data/lib/cadenya/models.rb +30 -0
- data/lib/cadenya/version.rb +1 -1
- data/lib/cadenya.rb +13 -0
- data/rbi/cadenya/models/agents/agent_variation_spec.rbi +8 -2
- data/rbi/cadenya/models/agents/agent_variation_spec_model_config.rbi +155 -11
- data/rbi/cadenya/models/capability_max_output_tokens.rbi +8 -0
- data/rbi/cadenya/models/capability_reasoning.rbi +75 -0
- data/rbi/cadenya/models/capability_stop_sequences.rbi +33 -0
- data/rbi/cadenya/models/capability_temperature.rbi +8 -0
- data/rbi/cadenya/models/capability_top_k.rbi +7 -0
- data/rbi/cadenya/models/capability_top_p.rbi +7 -0
- data/rbi/cadenya/models/model_spec.rbi +44 -49
- data/rbi/cadenya/models/model_spec_capability.rbi +28 -0
- data/rbi/cadenya/models/model_spec_capability_max_output_tokens.rbi +77 -0
- data/rbi/cadenya/models/model_spec_capability_reasoning.rbi +75 -0
- data/rbi/cadenya/models/model_spec_capability_stop_sequences.rbi +79 -0
- data/rbi/cadenya/models/model_spec_capability_temperature.rbi +74 -0
- data/rbi/cadenya/models/model_spec_capability_top_k.rbi +62 -0
- data/rbi/cadenya/models/model_spec_capability_top_p.rbi +62 -0
- data/rbi/cadenya/models.rbi +39 -0
- data/sig/cadenya/models/agents/agent_variation_spec_model_config.rbs +68 -5
- data/sig/cadenya/models/capability_max_output_tokens.rbs +5 -0
- data/sig/cadenya/models/capability_reasoning.rbs +32 -0
- data/sig/cadenya/models/capability_stop_sequences.rbs +15 -0
- data/sig/cadenya/models/capability_temperature.rbs +5 -0
- data/sig/cadenya/models/capability_top_k.rbs +5 -0
- data/sig/cadenya/models/capability_top_p.rbs +5 -0
- data/sig/cadenya/models/model_spec.rbs +12 -29
- data/sig/cadenya/models/model_spec_capability.rbs +17 -0
- data/sig/cadenya/models/model_spec_capability_max_output_tokens.rbs +35 -0
- data/sig/cadenya/models/model_spec_capability_reasoning.rbs +35 -0
- data/sig/cadenya/models/model_spec_capability_stop_sequences.rbs +35 -0
- data/sig/cadenya/models/model_spec_capability_temperature.rbs +35 -0
- data/sig/cadenya/models/model_spec_capability_top_k.rbs +32 -0
- data/sig/cadenya/models/model_spec_capability_top_p.rbs +32 -0
- data/sig/cadenya/models.rbs +26 -0
- metadata +41 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 031016da77105ecc74d1c80856344a6f2ea11cb57f07f6bd404909d211da9500
|
|
4
|
+
data.tar.gz: 3d50d476b619ab95929ccc0de37c637369dd7041dc392ea67846cc839e217781
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4b40db3b346cee3484aca5508e0ba303964390906542da1b9acf393d86753e2c1905095fddc9d09c8ae15d4f841a0da2b09d69137e29e2c3bba1a7ccf7fd8210
|
|
7
|
+
data.tar.gz: '0729374eb58115ab3e48792bfb25d577353b8990268fb78aedfd48cd7c997969f5b30b42fd7f2d639e1576a7da2da76926ece09c84a2a2f71da84d434b0c9a83'
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.52.0](https://github.com/cadenya/cadenya-ruby/compare/v0.51.1...v0.52.0) (2026-08-12)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* regenerate from spec with webhooks and discriminator overlays ([#57](https://github.com/cadenya/cadenya-ruby/issues/57)) ([8a05f27](https://github.com/cadenya/cadenya-ruby/commit/8a05f27fedfc351069d2f77baeb501aafac02498))
|
|
9
|
+
* sync SDKs to current API spec and add stlc promote/sync workflows ([8a05f27](https://github.com/cadenya/cadenya-ruby/commit/8a05f27fedfc351069d2f77baeb501aafac02498))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Chores
|
|
13
|
+
|
|
14
|
+
* disable Lint/UselessTimes (generator emits 1.times with max_retries: 0) ([8a05f27](https://github.com/cadenya/cadenya-ruby/commit/8a05f27fedfc351069d2f77baeb501aafac02498))
|
|
15
|
+
|
|
3
16
|
## 0.51.1 (2026-08-06)
|
|
4
17
|
|
|
5
18
|
Full Changelog: [v0.51.0...v0.51.1](https://github.com/cadenya/cadenya-ruby/compare/v0.51.0...v0.51.1)
|
|
@@ -42,7 +55,7 @@ Full Changelog: [v0.47.0...v0.48.0](https://github.com/cadenya/cadenya-ruby/comp
|
|
|
42
55
|
|
|
43
56
|
### Features
|
|
44
57
|
|
|
45
|
-
* **
|
|
58
|
+
* **ci:** configurable CI runner and private-production-repo support in workflow templates ([efc2777](https://github.com/cadenya/cadenya-ruby/commit/efc2777d7b7623ef2a27c102302c3f192ca642f1))
|
|
46
59
|
|
|
47
60
|
## 0.47.0 (2026-07-18)
|
|
48
61
|
|
data/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
The Cadenya Ruby library provides convenient access to the Cadenya REST API from any Ruby 3.2.0+ application. It ships with comprehensive types & docstrings in Yard, RBS, and RBI – [see below](https://github.com/cadenya/cadenya-ruby#Sorbet) for usage with Sorbet. The standard library's `net/http` is used as the HTTP transport, with connection pooling via the `connection_pool` gem.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
This library is maintained by Cadenya, including its coding agents. Community contributions are welcome — see [Contributing](#contributing).
|
|
6
6
|
|
|
7
7
|
## Documentation
|
|
8
8
|
|
|
@@ -17,7 +17,7 @@ To use this gem, install via Bundler by adding the following to your application
|
|
|
17
17
|
<!-- x-release-please-start-version -->
|
|
18
18
|
|
|
19
19
|
```ruby
|
|
20
|
-
gem "cadenya", "~> 0.
|
|
20
|
+
gem "cadenya", "~> 0.52.0"
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
<!-- x-release-please-end -->
|
data/SECURITY.md
CHANGED
|
@@ -2,26 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
## Reporting Security Issues
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
We take security seriously, and encourage you to report any security vulnerability promptly so that appropriate action can be taken.
|
|
6
6
|
|
|
7
|
-
To report a security issue
|
|
7
|
+
To report a security issue in this SDK, please use [GitHub security advisories](https://github.com/cadenya/cadenya-ruby/security/advisories/new) for this repository.
|
|
8
8
|
|
|
9
9
|
## Responsible Disclosure
|
|
10
10
|
|
|
11
11
|
We appreciate the efforts of security researchers and individuals who help us maintain the security of
|
|
12
|
-
|
|
12
|
+
this SDK. If you believe you have found a security vulnerability, please adhere to responsible
|
|
13
13
|
disclosure practices by allowing us a reasonable amount of time to investigate and address the issue
|
|
14
14
|
before making any information public.
|
|
15
15
|
|
|
16
16
|
## Reporting Non-SDK Related Security Issues
|
|
17
17
|
|
|
18
|
-
If you encounter security issues that are not directly related to
|
|
19
|
-
or products provided by Cadenya, please
|
|
20
|
-
|
|
21
|
-
### Cadenya Terms and Policies
|
|
22
|
-
|
|
23
|
-
Please contact support@cadenya.com for any questions or concerns regarding the security of our services.
|
|
18
|
+
If you encounter security issues that are not directly related to this SDK but pertain to the services
|
|
19
|
+
or products provided by Cadenya, please contact support@cadenya.com.
|
|
24
20
|
|
|
25
21
|
---
|
|
26
22
|
|
|
27
|
-
Thank you for helping us keep
|
|
23
|
+
Thank you for helping us keep this SDK and the systems it interacts with secure.
|
|
@@ -15,12 +15,12 @@ module Cadenya
|
|
|
15
15
|
# rubocop:disable Style/MutableConstant
|
|
16
16
|
PLATFORM_HEADERS =
|
|
17
17
|
{
|
|
18
|
-
"x-
|
|
19
|
-
"x-
|
|
20
|
-
"x-
|
|
21
|
-
"x-
|
|
22
|
-
"x-
|
|
23
|
-
"x-
|
|
18
|
+
"x-cadenya-arch" => Cadenya::Internal::Util.arch,
|
|
19
|
+
"x-cadenya-lang" => "ruby",
|
|
20
|
+
"x-cadenya-os" => Cadenya::Internal::Util.os,
|
|
21
|
+
"x-cadenya-package-version" => Cadenya::VERSION,
|
|
22
|
+
"x-cadenya-runtime" => ::RUBY_ENGINE,
|
|
23
|
+
"x-cadenya-runtime-version" => ::RUBY_ENGINE_VERSION
|
|
24
24
|
}
|
|
25
25
|
# rubocop:enable Style/MutableConstant
|
|
26
26
|
|
|
@@ -228,7 +228,7 @@ module Cadenya
|
|
|
228
228
|
# @api private
|
|
229
229
|
#
|
|
230
230
|
# @return [String]
|
|
231
|
-
private def generate_idempotency_key = "
|
|
231
|
+
private def generate_idempotency_key = "cadenya-ruby-retry-#{SecureRandom.uuid}"
|
|
232
232
|
|
|
233
233
|
# @api private
|
|
234
234
|
#
|
|
@@ -287,13 +287,13 @@ module Cadenya
|
|
|
287
287
|
headers[@idempotency_header] = opts.fetch(:idempotency_key) { generate_idempotency_key }
|
|
288
288
|
end
|
|
289
289
|
|
|
290
|
-
unless headers.key?("x-
|
|
291
|
-
headers["x-
|
|
290
|
+
unless headers.key?("x-cadenya-retry-count")
|
|
291
|
+
headers["x-cadenya-retry-count"] = "0"
|
|
292
292
|
end
|
|
293
293
|
|
|
294
294
|
timeout = opts.fetch(:timeout, @timeout).to_f.clamp(0..)
|
|
295
|
-
unless headers.key?("x-
|
|
296
|
-
headers["x-
|
|
295
|
+
unless headers.key?("x-cadenya-timeout") || timeout.zero?
|
|
296
|
+
headers["x-cadenya-timeout"] = timeout.to_s
|
|
297
297
|
end
|
|
298
298
|
|
|
299
299
|
headers.reject! { |_, v| v.to_s.empty? }
|
|
@@ -381,7 +381,7 @@ module Cadenya
|
|
|
381
381
|
input = {**request.except(:timeout), deadline: Cadenya::Internal::Util.monotonic_secs + timeout}
|
|
382
382
|
|
|
383
383
|
if send_retry_header
|
|
384
|
-
headers["x-
|
|
384
|
+
headers["x-cadenya-retry-count"] = retry_count.to_s
|
|
385
385
|
end
|
|
386
386
|
|
|
387
387
|
begin
|
|
@@ -490,7 +490,7 @@ module Cadenya
|
|
|
490
490
|
url = request.fetch(:url)
|
|
491
491
|
|
|
492
492
|
# Don't send the current retry count in the headers if the caller modified the header defaults.
|
|
493
|
-
send_retry_header = request.fetch(:headers)["x-
|
|
493
|
+
send_retry_header = request.fetch(:headers)["x-cadenya-retry-count"] == "0"
|
|
494
494
|
status, response, stream = send_request(
|
|
495
495
|
request,
|
|
496
496
|
redirect_count: 0,
|
|
@@ -37,7 +37,10 @@ module Cadenya
|
|
|
37
37
|
optional :first_user_message_template, String, api_name: :firstUserMessageTemplate
|
|
38
38
|
|
|
39
39
|
# @!attribute model_config
|
|
40
|
-
# ModelConfig defines the model configuration for a variation
|
|
40
|
+
# ModelConfig defines the model configuration for a variation.
|
|
41
|
+
#
|
|
42
|
+
# Every knob besides model_id is honored only when the assigned model's
|
|
43
|
+
# spec.capabilities lists the matching capability.
|
|
41
44
|
#
|
|
42
45
|
# @return [Cadenya::Models::Agents::AgentVariationSpecModelConfig, nil]
|
|
43
46
|
optional :model_config, -> { Cadenya::Agents::AgentVariationSpecModelConfig }, api_name: :modelConfig
|
|
@@ -76,7 +79,7 @@ module Cadenya
|
|
|
76
79
|
#
|
|
77
80
|
# @param first_user_message_template [String] Liquid template for the first user message of objectives using this variation.
|
|
78
81
|
#
|
|
79
|
-
# @param model_config [Cadenya::Models::Agents::AgentVariationSpecModelConfig] ModelConfig defines the model configuration for a variation
|
|
82
|
+
# @param model_config [Cadenya::Models::Agents::AgentVariationSpecModelConfig] ModelConfig defines the model configuration for a variation.
|
|
80
83
|
#
|
|
81
84
|
# @param progressive_discovery [Cadenya::Models::Agents::AgentVariationSpecProgressiveDiscovery] ProgressiveDiscovery is used to indicate that the agent should automatically dis
|
|
82
85
|
#
|
|
@@ -8,25 +8,94 @@ module Cadenya
|
|
|
8
8
|
# The model identifier in family/model format (e.g., "claude/opus-4.6",
|
|
9
9
|
# "claude/sonnet-4.5")
|
|
10
10
|
#
|
|
11
|
-
# @return [String
|
|
12
|
-
|
|
11
|
+
# @return [String]
|
|
12
|
+
required :model_id, String, api_name: :modelId
|
|
13
|
+
|
|
14
|
+
# @!attribute max_output_tokens
|
|
15
|
+
# Cap on output tokens per LLM call. Must not exceed the model's
|
|
16
|
+
# spec.max_output_tokens. Requires the model's "maxOutputTokens" capability.
|
|
17
|
+
#
|
|
18
|
+
# @return [Integer, nil]
|
|
19
|
+
optional :max_output_tokens, Integer, api_name: :maxOutputTokens
|
|
20
|
+
|
|
21
|
+
# @!attribute reasoning_effort
|
|
22
|
+
# Reasoning effort. Requires the model's "reasoning" capability.
|
|
23
|
+
#
|
|
24
|
+
# @return [Symbol, Cadenya::Models::Agents::AgentVariationSpecModelConfig::ReasoningEffort, nil]
|
|
25
|
+
optional :reasoning_effort,
|
|
26
|
+
enum: -> { Cadenya::Agents::AgentVariationSpecModelConfig::ReasoningEffort },
|
|
27
|
+
api_name: :reasoningEffort
|
|
28
|
+
|
|
29
|
+
# @!attribute stop_sequences
|
|
30
|
+
# Sequences that stop generation when produced. Empty means none. No count cap
|
|
31
|
+
# here — providers impose their own limits (surfaced as the "stopSequences"
|
|
32
|
+
# capability's `limit` on the model spec), and it is the caller's responsibility
|
|
33
|
+
# to stay within the selected model's limit. Requires the model's "stopSequences"
|
|
34
|
+
# capability.
|
|
35
|
+
#
|
|
36
|
+
# @return [Array<String>, nil]
|
|
37
|
+
optional :stop_sequences, Cadenya::Internal::Type::ArrayOf[String], api_name: :stopSequences
|
|
13
38
|
|
|
14
39
|
# @!attribute temperature
|
|
15
40
|
# Sampling temperature for model inference (0.0 to 1.0) Lower values produce more
|
|
16
|
-
# deterministic outputs, higher values increase randomness
|
|
41
|
+
# deterministic outputs, higher values increase randomness. Presence-tracked so a
|
|
42
|
+
# deliberate 0.0 (fully deterministic) is distinguishable from unset.
|
|
17
43
|
#
|
|
18
44
|
# @return [Float, nil]
|
|
19
45
|
optional :temperature, Float
|
|
20
46
|
|
|
21
|
-
# @!
|
|
47
|
+
# @!attribute top_k
|
|
48
|
+
# Only sample from the top_k most likely tokens. Requires the model's "topK"
|
|
49
|
+
# capability.
|
|
50
|
+
#
|
|
51
|
+
# @return [Integer, nil]
|
|
52
|
+
optional :top_k, Integer, api_name: :topK
|
|
53
|
+
|
|
54
|
+
# @!attribute top_p
|
|
55
|
+
# Nucleus sampling: only tokens comprising the top_p probability mass are
|
|
56
|
+
# considered. Requires the model's "topP" capability.
|
|
57
|
+
#
|
|
58
|
+
# @return [Float, nil]
|
|
59
|
+
optional :top_p, Float, api_name: :topP
|
|
60
|
+
|
|
61
|
+
# @!method initialize(model_id:, max_output_tokens: nil, reasoning_effort: nil, stop_sequences: nil, temperature: nil, top_k: nil, top_p: nil)
|
|
22
62
|
# Some parameter documentations has been truncated, see
|
|
23
63
|
# {Cadenya::Models::Agents::AgentVariationSpecModelConfig} for more details.
|
|
24
64
|
#
|
|
25
|
-
# ModelConfig defines the model configuration for a variation
|
|
65
|
+
# ModelConfig defines the model configuration for a variation.
|
|
66
|
+
#
|
|
67
|
+
# Every knob besides model_id is honored only when the assigned model's
|
|
68
|
+
# spec.capabilities lists the matching capability.
|
|
26
69
|
#
|
|
27
70
|
# @param model_id [String] The model identifier in family/model format (e.g., "claude/opus-4.6", "claude/so
|
|
28
71
|
#
|
|
72
|
+
# @param max_output_tokens [Integer] Cap on output tokens per LLM call. Must not exceed the model's
|
|
73
|
+
#
|
|
74
|
+
# @param reasoning_effort [Symbol, Cadenya::Models::Agents::AgentVariationSpecModelConfig::ReasoningEffort] Reasoning effort. Requires the model's "reasoning" capability.
|
|
75
|
+
#
|
|
76
|
+
# @param stop_sequences [Array<String>] Sequences that stop generation when produced. Empty means none.
|
|
77
|
+
#
|
|
29
78
|
# @param temperature [Float] Sampling temperature for model inference (0.0 to 1.0)
|
|
79
|
+
#
|
|
80
|
+
# @param top_k [Integer] Only sample from the top_k most likely tokens.
|
|
81
|
+
#
|
|
82
|
+
# @param top_p [Float] Nucleus sampling: only tokens comprising the top_p probability mass
|
|
83
|
+
|
|
84
|
+
# Reasoning effort. Requires the model's "reasoning" capability.
|
|
85
|
+
#
|
|
86
|
+
# @see Cadenya::Models::Agents::AgentVariationSpecModelConfig#reasoning_effort
|
|
87
|
+
module ReasoningEffort
|
|
88
|
+
extend Cadenya::Internal::Type::Enum
|
|
89
|
+
|
|
90
|
+
REASONING_EFFORT_UNSPECIFIED = :REASONING_EFFORT_UNSPECIFIED
|
|
91
|
+
REASONING_EFFORT_NONE = :REASONING_EFFORT_NONE
|
|
92
|
+
REASONING_EFFORT_LOW = :REASONING_EFFORT_LOW
|
|
93
|
+
REASONING_EFFORT_MEDIUM = :REASONING_EFFORT_MEDIUM
|
|
94
|
+
REASONING_EFFORT_HIGH = :REASONING_EFFORT_HIGH
|
|
95
|
+
|
|
96
|
+
# @!method self.values
|
|
97
|
+
# @return [Array<Symbol>]
|
|
98
|
+
end
|
|
30
99
|
end
|
|
31
100
|
end
|
|
32
101
|
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Cadenya
|
|
4
|
+
module Models
|
|
5
|
+
class CapabilityReasoning < Cadenya::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute mode
|
|
7
|
+
# How reasoning is enabled for this model. Catalog data used to decide whether
|
|
8
|
+
# thinking is requested for objective iterations on this model.
|
|
9
|
+
#
|
|
10
|
+
# @return [Symbol, Cadenya::Models::CapabilityReasoning::Mode, nil]
|
|
11
|
+
optional :mode, enum: -> { Cadenya::CapabilityReasoning::Mode }
|
|
12
|
+
|
|
13
|
+
# @!method initialize(mode: nil)
|
|
14
|
+
# Some parameter documentations has been truncated, see
|
|
15
|
+
# {Cadenya::Models::CapabilityReasoning} for more details.
|
|
16
|
+
#
|
|
17
|
+
# Reasoning / extended thinking (ModelConfig.reasoning_effort). A model that does
|
|
18
|
+
# not reason simply omits this capability.
|
|
19
|
+
#
|
|
20
|
+
# @param mode [Symbol, Cadenya::Models::CapabilityReasoning::Mode] How reasoning is enabled for this model. Catalog data used to decide
|
|
21
|
+
|
|
22
|
+
# How reasoning is enabled for this model. Catalog data used to decide whether
|
|
23
|
+
# thinking is requested for objective iterations on this model.
|
|
24
|
+
#
|
|
25
|
+
# @see Cadenya::Models::CapabilityReasoning#mode
|
|
26
|
+
module Mode
|
|
27
|
+
extend Cadenya::Internal::Type::Enum
|
|
28
|
+
|
|
29
|
+
MODE_UNSPECIFIED = :MODE_UNSPECIFIED
|
|
30
|
+
MODE_ADAPTIVE = :MODE_ADAPTIVE
|
|
31
|
+
MODE_BUDGET = :MODE_BUDGET
|
|
32
|
+
|
|
33
|
+
# @!method self.values
|
|
34
|
+
# @return [Array<Symbol>]
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Cadenya
|
|
4
|
+
module Models
|
|
5
|
+
class CapabilityStopSequences < Cadenya::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute limit
|
|
7
|
+
# Maximum number of stop sequences the model accepts per request. 0 means the
|
|
8
|
+
# provider imposes no meaningful limit.
|
|
9
|
+
#
|
|
10
|
+
# @return [Integer, nil]
|
|
11
|
+
optional :limit, Integer
|
|
12
|
+
|
|
13
|
+
# @!method initialize(limit: nil)
|
|
14
|
+
# Some parameter documentations has been truncated, see
|
|
15
|
+
# {Cadenya::Models::CapabilityStopSequences} for more details.
|
|
16
|
+
#
|
|
17
|
+
# Custom stop sequences (ModelConfig.stop_sequences).
|
|
18
|
+
#
|
|
19
|
+
# @param limit [Integer] Maximum number of stop sequences the model accepts per request.
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -15,6 +15,14 @@ module Cadenya
|
|
|
15
15
|
# @return [String]
|
|
16
16
|
required :provider, String
|
|
17
17
|
|
|
18
|
+
# @!attribute capabilities
|
|
19
|
+
# The inference knobs this model supports. Catalog data; drives which ModelConfig
|
|
20
|
+
# fields a variation on this model may set. Reasoning support (and its mode) lives
|
|
21
|
+
# here too, as the "reasoning" capability.
|
|
22
|
+
#
|
|
23
|
+
# @return [Array<Cadenya::Models::ModelSpecCapabilityTemperature, Cadenya::Models::ModelSpecCapabilityTopP, Cadenya::Models::ModelSpecCapabilityTopK, Cadenya::Models::ModelSpecCapabilityStopSequences, Cadenya::Models::ModelSpecCapabilityMaxOutputTokens, Cadenya::Models::ModelSpecCapabilityReasoning>, nil]
|
|
24
|
+
optional :capabilities, -> { Cadenya::Internal::Type::ArrayOf[union: Cadenya::ModelSpecCapability] }
|
|
25
|
+
|
|
18
26
|
# @!attribute input_price_per_million_tokens
|
|
19
27
|
# Cost per million input tokens in cents (e.g., 300 = $3.00)
|
|
20
28
|
#
|
|
@@ -39,14 +47,7 @@ module Cadenya
|
|
|
39
47
|
# @return [String, nil]
|
|
40
48
|
optional :output_price_per_million_tokens, String, api_name: :outputPricePerMillionTokens
|
|
41
49
|
|
|
42
|
-
# @!
|
|
43
|
-
# The model's reasoning capability. Catalog data used to decide whether thinking
|
|
44
|
-
# is requested for objective iterations on this model.
|
|
45
|
-
#
|
|
46
|
-
# @return [Symbol, Cadenya::Models::ModelSpec::Reasoning, nil]
|
|
47
|
-
optional :reasoning, enum: -> { Cadenya::ModelSpec::Reasoning }
|
|
48
|
-
|
|
49
|
-
# @!method initialize(family:, provider:, input_price_per_million_tokens: nil, max_input_tokens: nil, max_output_tokens: nil, output_price_per_million_tokens: nil, reasoning: nil)
|
|
50
|
+
# @!method initialize(family:, provider:, capabilities: nil, input_price_per_million_tokens: nil, max_input_tokens: nil, max_output_tokens: nil, output_price_per_million_tokens: nil)
|
|
50
51
|
# Some parameter documentations has been truncated, see
|
|
51
52
|
# {Cadenya::Models::ModelSpec} for more details.
|
|
52
53
|
#
|
|
@@ -54,6 +55,8 @@ module Cadenya
|
|
|
54
55
|
#
|
|
55
56
|
# @param provider [String] The model provider (e.g., "anthropic", "openai", "google")
|
|
56
57
|
#
|
|
58
|
+
# @param capabilities [Array<Cadenya::Models::ModelSpecCapabilityTemperature, Cadenya::Models::ModelSpecCapabilityTopP, Cadenya::Models::ModelSpecCapabilityTopK, Cadenya::Models::ModelSpecCapabilityStopSequences, Cadenya::Models::ModelSpecCapabilityMaxOutputTokens, Cadenya::Models::ModelSpecCapabilityReasoning>] The inference knobs this model supports. Catalog data; drives which
|
|
59
|
+
#
|
|
57
60
|
# @param input_price_per_million_tokens [String] Cost per million input tokens in cents (e.g., 300 = $3.00)
|
|
58
61
|
#
|
|
59
62
|
# @param max_input_tokens [Integer] Maximum number of input tokens the model supports
|
|
@@ -61,24 +64,6 @@ module Cadenya
|
|
|
61
64
|
# @param max_output_tokens [Integer] Maximum number of output tokens the model can generate
|
|
62
65
|
#
|
|
63
66
|
# @param output_price_per_million_tokens [String] Cost per million output tokens in cents (e.g., 1500 = $15.00)
|
|
64
|
-
#
|
|
65
|
-
# @param reasoning [Symbol, Cadenya::Models::ModelSpec::Reasoning] The model's reasoning capability. Catalog data used to decide whether
|
|
66
|
-
|
|
67
|
-
# The model's reasoning capability. Catalog data used to decide whether thinking
|
|
68
|
-
# is requested for objective iterations on this model.
|
|
69
|
-
#
|
|
70
|
-
# @see Cadenya::Models::ModelSpec#reasoning
|
|
71
|
-
module Reasoning
|
|
72
|
-
extend Cadenya::Internal::Type::Enum
|
|
73
|
-
|
|
74
|
-
REASONING_UNSPECIFIED = :REASONING_UNSPECIFIED
|
|
75
|
-
REASONING_NONE = :REASONING_NONE
|
|
76
|
-
REASONING_ADAPTIVE = :REASONING_ADAPTIVE
|
|
77
|
-
REASONING_BUDGET = :REASONING_BUDGET
|
|
78
|
-
|
|
79
|
-
# @!method self.values
|
|
80
|
-
# @return [Array<Symbol>]
|
|
81
|
-
end
|
|
82
67
|
end
|
|
83
68
|
end
|
|
84
69
|
end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Cadenya
|
|
4
|
+
module Models
|
|
5
|
+
# Capability describes one inference knob this model supports, with any
|
|
6
|
+
# model-specific parameters for it. A variation's ModelConfig may only set a knob
|
|
7
|
+
# whose capability is listed on the model's spec.
|
|
8
|
+
module ModelSpecCapability
|
|
9
|
+
extend Cadenya::Internal::Type::Union
|
|
10
|
+
|
|
11
|
+
discriminator :type
|
|
12
|
+
|
|
13
|
+
variant :temperature, -> { Cadenya::ModelSpecCapabilityTemperature }
|
|
14
|
+
|
|
15
|
+
variant :topP, -> { Cadenya::ModelSpecCapabilityTopP }
|
|
16
|
+
|
|
17
|
+
variant :topK, -> { Cadenya::ModelSpecCapabilityTopK }
|
|
18
|
+
|
|
19
|
+
variant :stopSequences, -> { Cadenya::ModelSpecCapabilityStopSequences }
|
|
20
|
+
|
|
21
|
+
variant :maxOutputTokens, -> { Cadenya::ModelSpecCapabilityMaxOutputTokens }
|
|
22
|
+
|
|
23
|
+
variant :reasoning, -> { Cadenya::ModelSpecCapabilityReasoning }
|
|
24
|
+
|
|
25
|
+
# @!method self.variants
|
|
26
|
+
# @return [Array(Cadenya::Models::ModelSpecCapabilityTemperature, Cadenya::Models::ModelSpecCapabilityTopP, Cadenya::Models::ModelSpecCapabilityTopK, Cadenya::Models::ModelSpecCapabilityStopSequences, Cadenya::Models::ModelSpecCapabilityMaxOutputTokens, Cadenya::Models::ModelSpecCapabilityReasoning)]
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Cadenya
|
|
4
|
+
module Models
|
|
5
|
+
class ModelSpecCapabilityMaxOutputTokens < Cadenya::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute max_output_tokens
|
|
7
|
+
# Per-request output token cap (ModelConfig.max_output_tokens). The effective
|
|
8
|
+
# ceiling is ModelSpec.max_output_tokens.
|
|
9
|
+
#
|
|
10
|
+
# @return [Object]
|
|
11
|
+
required :max_output_tokens, Cadenya::Internal::Type::Unknown, api_name: :maxOutputTokens
|
|
12
|
+
|
|
13
|
+
# @!attribute type
|
|
14
|
+
#
|
|
15
|
+
# @return [Symbol, Cadenya::Models::ModelSpecCapabilityMaxOutputTokens::Type]
|
|
16
|
+
required :type, enum: -> { Cadenya::ModelSpecCapabilityMaxOutputTokens::Type }
|
|
17
|
+
|
|
18
|
+
# @!method initialize(max_output_tokens:, type:)
|
|
19
|
+
# Some parameter documentations has been truncated, see
|
|
20
|
+
# {Cadenya::Models::ModelSpecCapabilityMaxOutputTokens} for more details.
|
|
21
|
+
#
|
|
22
|
+
# @param max_output_tokens [Object] Per-request output token cap (ModelConfig.max_output_tokens).
|
|
23
|
+
#
|
|
24
|
+
# @param type [Symbol, Cadenya::Models::ModelSpecCapabilityMaxOutputTokens::Type]
|
|
25
|
+
|
|
26
|
+
# @see Cadenya::Models::ModelSpecCapabilityMaxOutputTokens#type
|
|
27
|
+
module Type
|
|
28
|
+
extend Cadenya::Internal::Type::Enum
|
|
29
|
+
|
|
30
|
+
MAX_OUTPUT_TOKENS = :maxOutputTokens
|
|
31
|
+
|
|
32
|
+
# @!method self.values
|
|
33
|
+
# @return [Array<Symbol>]
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Cadenya
|
|
4
|
+
module Models
|
|
5
|
+
class ModelSpecCapabilityReasoning < Cadenya::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute reasoning
|
|
7
|
+
# Reasoning / extended thinking (ModelConfig.reasoning_effort). A model that does
|
|
8
|
+
# not reason simply omits this capability.
|
|
9
|
+
#
|
|
10
|
+
# @return [Cadenya::Models::CapabilityReasoning]
|
|
11
|
+
required :reasoning, -> { Cadenya::CapabilityReasoning }
|
|
12
|
+
|
|
13
|
+
# @!attribute type
|
|
14
|
+
#
|
|
15
|
+
# @return [Symbol, Cadenya::Models::ModelSpecCapabilityReasoning::Type]
|
|
16
|
+
required :type, enum: -> { Cadenya::ModelSpecCapabilityReasoning::Type }
|
|
17
|
+
|
|
18
|
+
# @!method initialize(reasoning:, type:)
|
|
19
|
+
# Some parameter documentations has been truncated, see
|
|
20
|
+
# {Cadenya::Models::ModelSpecCapabilityReasoning} for more details.
|
|
21
|
+
#
|
|
22
|
+
# @param reasoning [Cadenya::Models::CapabilityReasoning] Reasoning / extended thinking (ModelConfig.reasoning_effort). A model
|
|
23
|
+
#
|
|
24
|
+
# @param type [Symbol, Cadenya::Models::ModelSpecCapabilityReasoning::Type]
|
|
25
|
+
|
|
26
|
+
# @see Cadenya::Models::ModelSpecCapabilityReasoning#type
|
|
27
|
+
module Type
|
|
28
|
+
extend Cadenya::Internal::Type::Enum
|
|
29
|
+
|
|
30
|
+
REASONING = :reasoning
|
|
31
|
+
|
|
32
|
+
# @!method self.values
|
|
33
|
+
# @return [Array<Symbol>]
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Cadenya
|
|
4
|
+
module Models
|
|
5
|
+
class ModelSpecCapabilityStopSequences < Cadenya::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute stop_sequences
|
|
7
|
+
# Custom stop sequences (ModelConfig.stop_sequences).
|
|
8
|
+
#
|
|
9
|
+
# @return [Cadenya::Models::CapabilityStopSequences]
|
|
10
|
+
required :stop_sequences, -> { Cadenya::CapabilityStopSequences }, api_name: :stopSequences
|
|
11
|
+
|
|
12
|
+
# @!attribute type
|
|
13
|
+
#
|
|
14
|
+
# @return [Symbol, Cadenya::Models::ModelSpecCapabilityStopSequences::Type]
|
|
15
|
+
required :type, enum: -> { Cadenya::ModelSpecCapabilityStopSequences::Type }
|
|
16
|
+
|
|
17
|
+
# @!method initialize(stop_sequences:, type:)
|
|
18
|
+
# @param stop_sequences [Cadenya::Models::CapabilityStopSequences] Custom stop sequences (ModelConfig.stop_sequences).
|
|
19
|
+
#
|
|
20
|
+
# @param type [Symbol, Cadenya::Models::ModelSpecCapabilityStopSequences::Type]
|
|
21
|
+
|
|
22
|
+
# @see Cadenya::Models::ModelSpecCapabilityStopSequences#type
|
|
23
|
+
module Type
|
|
24
|
+
extend Cadenya::Internal::Type::Enum
|
|
25
|
+
|
|
26
|
+
STOP_SEQUENCES = :stopSequences
|
|
27
|
+
|
|
28
|
+
# @!method self.values
|
|
29
|
+
# @return [Array<Symbol>]
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Cadenya
|
|
4
|
+
module Models
|
|
5
|
+
class ModelSpecCapabilityTemperature < Cadenya::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute temperature
|
|
7
|
+
# Sampling temperature (ModelConfig.temperature).
|
|
8
|
+
#
|
|
9
|
+
# @return [Object]
|
|
10
|
+
required :temperature, Cadenya::Internal::Type::Unknown
|
|
11
|
+
|
|
12
|
+
# @!attribute type
|
|
13
|
+
#
|
|
14
|
+
# @return [Symbol, Cadenya::Models::ModelSpecCapabilityTemperature::Type]
|
|
15
|
+
required :type, enum: -> { Cadenya::ModelSpecCapabilityTemperature::Type }
|
|
16
|
+
|
|
17
|
+
# @!method initialize(temperature:, type:)
|
|
18
|
+
# @param temperature [Object] Sampling temperature (ModelConfig.temperature).
|
|
19
|
+
#
|
|
20
|
+
# @param type [Symbol, Cadenya::Models::ModelSpecCapabilityTemperature::Type]
|
|
21
|
+
|
|
22
|
+
# @see Cadenya::Models::ModelSpecCapabilityTemperature#type
|
|
23
|
+
module Type
|
|
24
|
+
extend Cadenya::Internal::Type::Enum
|
|
25
|
+
|
|
26
|
+
TEMPERATURE = :temperature
|
|
27
|
+
|
|
28
|
+
# @!method self.values
|
|
29
|
+
# @return [Array<Symbol>]
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Cadenya
|
|
4
|
+
module Models
|
|
5
|
+
class ModelSpecCapabilityTopK < Cadenya::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute top_k
|
|
7
|
+
# Top-k sampling (ModelConfig.top_k).
|
|
8
|
+
#
|
|
9
|
+
# @return [Object]
|
|
10
|
+
required :top_k, Cadenya::Internal::Type::Unknown, api_name: :topK
|
|
11
|
+
|
|
12
|
+
# @!attribute type
|
|
13
|
+
#
|
|
14
|
+
# @return [Symbol, Cadenya::Models::ModelSpecCapabilityTopK::Type]
|
|
15
|
+
required :type, enum: -> { Cadenya::ModelSpecCapabilityTopK::Type }
|
|
16
|
+
|
|
17
|
+
# @!method initialize(top_k:, type:)
|
|
18
|
+
# @param top_k [Object] Top-k sampling (ModelConfig.top_k).
|
|
19
|
+
#
|
|
20
|
+
# @param type [Symbol, Cadenya::Models::ModelSpecCapabilityTopK::Type]
|
|
21
|
+
|
|
22
|
+
# @see Cadenya::Models::ModelSpecCapabilityTopK#type
|
|
23
|
+
module Type
|
|
24
|
+
extend Cadenya::Internal::Type::Enum
|
|
25
|
+
|
|
26
|
+
TOP_K = :topK
|
|
27
|
+
|
|
28
|
+
# @!method self.values
|
|
29
|
+
# @return [Array<Symbol>]
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|