Class: Cadenya::Types::AgentVariationSpec_ModelConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/cadenya/types.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of AgentVariationSpec_ModelConfig.



777
778
779
780
781
782
783
784
785
786
# File 'lib/cadenya/types.rb', line 777

def initialize(model_id: nil, temperature: nil, top_p: nil, top_k: nil, stop_sequences: nil, max_output_tokens: nil, reasoning_effort: nil, caching_enabled: nil)
  @model_id = model_id
  @temperature = temperature
  @top_p = top_p
  @top_k = top_k
  @stop_sequences = stop_sequences
  @max_output_tokens = max_output_tokens
  @reasoning_effort = reasoning_effort
  @caching_enabled = caching_enabled
end

Instance Attribute Details

#caching_enabledObject (readonly)

Returns the value of attribute caching_enabled.



775
776
777
# File 'lib/cadenya/types.rb', line 775

def caching_enabled
  @caching_enabled
end

#max_output_tokensObject (readonly)

Returns the value of attribute max_output_tokens.



775
776
777
# File 'lib/cadenya/types.rb', line 775

def max_output_tokens
  @max_output_tokens
end

#model_idObject (readonly)

Returns the value of attribute model_id.



775
776
777
# File 'lib/cadenya/types.rb', line 775

def model_id
  @model_id
end

#reasoning_effortObject (readonly)

Returns the value of attribute reasoning_effort.



775
776
777
# File 'lib/cadenya/types.rb', line 775

def reasoning_effort
  @reasoning_effort
end

#stop_sequencesObject (readonly)

Returns the value of attribute stop_sequences.



775
776
777
# File 'lib/cadenya/types.rb', line 775

def stop_sequences
  @stop_sequences
end

#temperatureObject (readonly)

Returns the value of attribute temperature.



775
776
777
# File 'lib/cadenya/types.rb', line 775

def temperature
  @temperature
end

#top_kObject (readonly)

Returns the value of attribute top_k.



775
776
777
# File 'lib/cadenya/types.rb', line 775

def top_k
  @top_k
end

#top_pObject (readonly)

Returns the value of attribute top_p.



775
776
777
# File 'lib/cadenya/types.rb', line 775

def top_p
  @top_p
end

Class Method Details

.from_json(data) ⇒ Object



788
789
790
791
792
793
794
795
796
797
798
799
# File 'lib/cadenya/types.rb', line 788

def self.from_json(data)
  new(
    model_id: data["modelId"],
    temperature: data["temperature"],
    top_p: data["topP"],
    top_k: data["topK"],
    stop_sequences: data["stopSequences"],
    max_output_tokens: data["maxOutputTokens"],
    reasoning_effort: data["reasoningEffort"],
    caching_enabled: data["cachingEnabled"],
  )
end

Instance Method Details

#to_hObject



801
802
803
804
805
806
807
808
809
810
811
812
# File 'lib/cadenya/types.rb', line 801

def to_h
  {
    model_id: Util.plain(@model_id),
    temperature: Util.plain(@temperature),
    top_p: Util.plain(@top_p),
    top_k: Util.plain(@top_k),
    stop_sequences: Util.plain(@stop_sequences),
    max_output_tokens: Util.plain(@max_output_tokens),
    reasoning_effort: Util.plain(@reasoning_effort),
    caching_enabled: Util.plain(@caching_enabled),
  }.reject { |_k, v| v.nil? }
end