Class: Cadenya::Types::AIProviderConfig_OpenaiCompatible

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(type: nil, openai_compatible: nil) ⇒ AIProviderConfig_OpenaiCompatible

Returns a new instance of AIProviderConfig_OpenaiCompatible.



9348
9349
9350
9351
# File 'lib/cadenya/types.rb', line 9348

def initialize(type: nil, openai_compatible: nil)
  @type = type
  @openai_compatible = openai_compatible
end

Instance Attribute Details

#openai_compatibleObject (readonly)

Returns the value of attribute openai_compatible.



9346
9347
9348
# File 'lib/cadenya/types.rb', line 9346

def openai_compatible
  @openai_compatible
end

#typeObject (readonly)

Returns the value of attribute type.



9346
9347
9348
# File 'lib/cadenya/types.rb', line 9346

def type
  @type
end

Class Method Details

.from_json(data) ⇒ Object



9353
9354
9355
9356
9357
9358
# File 'lib/cadenya/types.rb', line 9353

def self.from_json(data)
  new(
    type: data["type"],
    openai_compatible: data["openaiCompatible"].nil? ? nil : Types::OpenAICompatibleConfig.from_json(data["openaiCompatible"]),
  )
end

Instance Method Details

#to_hObject



9360
9361
9362
9363
9364
9365
# File 'lib/cadenya/types.rb', line 9360

def to_h
  {
    type: Util.plain(@type),
    openai_compatible: Util.plain(@openai_compatible),
  }.reject { |_k, v| v.nil? }
end