Class: Cadenya::Models::Agents::AgentVariationSpecModelConfig

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/cadenya/models/agents/agent_variation_spec_model_config.rb,
sig/cadenya/models/agents/agent_variation_spec_model_config.rbs

Defined Under Namespace

Modules: ReasoningEffort

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(model_id:, max_output_tokens: nil, reasoning_effort: nil, stop_sequences: nil, temperature: nil, top_k: nil, top_p: nil) ⇒ Object

Some parameter documentations has been truncated, see Cadenya::Models::Agents::AgentVariationSpecModelConfig for more details.

ModelConfig defines the model configuration for a variation.

Every knob besides model_id is honored only when the assigned model's spec.capabilities lists the matching capability.

Parameters:

  • model_id (String)

    The model identifier in family/model format (e.g., "claude/opus-4.6", "claude/so

  • max_output_tokens (Integer) (defaults to: nil)

    Cap on output tokens per LLM call. Must not exceed the model's

  • reasoning_effort (Symbol, Cadenya::Models::Agents::AgentVariationSpecModelConfig::ReasoningEffort) (defaults to: nil)

    Reasoning effort. Requires the model's "reasoning" capability.

  • stop_sequences (Array<String>) (defaults to: nil)

    Sequences that stop generation when produced. Empty means none.

  • temperature (Float) (defaults to: nil)

    Sampling temperature for model inference (0.0 to 1.0)

  • top_k (Integer) (defaults to: nil)

    Only sample from the top_k most likely tokens.

  • top_p (Float) (defaults to: nil)

    Nucleus sampling: only tokens comprising the top_p probability mass



# File 'lib/cadenya/models/agents/agent_variation_spec_model_config.rb', line 61

Instance Attribute Details

#max_output_tokensInteger?

Cap on output tokens per LLM call. Must not exceed the model's spec.max_output_tokens. Requires the model's "maxOutputTokens" capability.

Parameters:

  • (Integer)

Returns:

  • (Integer, nil)


19
# File 'lib/cadenya/models/agents/agent_variation_spec_model_config.rb', line 19

optional :max_output_tokens, Integer, api_name: :maxOutputTokens

#model_idString

The model identifier in family/model format (e.g., "claude/opus-4.6", "claude/sonnet-4.5")

Parameters:

  • value (String)

Returns:

  • (String)


12
# File 'lib/cadenya/models/agents/agent_variation_spec_model_config.rb', line 12

required :model_id, String, api_name: :modelId

#reasoning_effortSymbol, ...

Reasoning effort. Requires the model's "reasoning" capability.



25
26
27
# File 'lib/cadenya/models/agents/agent_variation_spec_model_config.rb', line 25

optional :reasoning_effort,
enum: -> { Cadenya::Agents::AgentVariationSpecModelConfig::ReasoningEffort },
api_name: :reasoningEffort

#stop_sequencesArray<String>?

Sequences that stop generation when produced. Empty means none. No count cap here — providers impose their own limits (surfaced as the "stopSequences" capability's limit on the model spec), and it is the caller's responsibility to stay within the selected model's limit. Requires the model's "stopSequences" capability.

Parameters:

  • (::Array[String])

Returns:

  • (Array<String>, nil)


37
# File 'lib/cadenya/models/agents/agent_variation_spec_model_config.rb', line 37

optional :stop_sequences, Cadenya::Internal::Type::ArrayOf[String], api_name: :stopSequences

#temperatureFloat?

Sampling temperature for model inference (0.0 to 1.0) Lower values produce more deterministic outputs, higher values increase randomness. Presence-tracked so a deliberate 0.0 (fully deterministic) is distinguishable from unset.

Parameters:

  • (Float)

Returns:

  • (Float, nil)


45
# File 'lib/cadenya/models/agents/agent_variation_spec_model_config.rb', line 45

optional :temperature, Float

#top_kInteger?

Only sample from the top_k most likely tokens. Requires the model's "topK" capability.

Parameters:

  • (Integer)

Returns:

  • (Integer, nil)


52
# File 'lib/cadenya/models/agents/agent_variation_spec_model_config.rb', line 52

optional :top_k, Integer, api_name: :topK

#top_pFloat?

Nucleus sampling: only tokens comprising the top_p probability mass are considered. Requires the model's "topP" capability.

Parameters:

  • (Float)

Returns:

  • (Float, nil)


59
# File 'lib/cadenya/models/agents/agent_variation_spec_model_config.rb', line 59

optional :top_p, Float, api_name: :topP

Instance Method Details

#to_hash{

Returns:

  • ({)


56
# File 'sig/cadenya/models/agents/agent_variation_spec_model_config.rbs', line 56

def to_hash: -> {