Class: LaunchDarkly::Server::AI::ModelConfig
- Inherits:
-
Object
- Object
- LaunchDarkly::Server::AI::ModelConfig
- Defined in:
- lib/server/ai/client.rb
Overview
The ModelConfig class represents an AI model configuration.
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#custom(key) ⇒ Object?
Retrieve customer provided data.
-
#initialize(name:, parameters: {}, custom: {}) ⇒ ModelConfig
constructor
A new instance of ModelConfig.
-
#parameter(key) ⇒ Object?
Retrieve model-specific parameters.
- #to_h ⇒ Object
Constructor Details
#initialize(name:, parameters: {}, custom: {}) ⇒ ModelConfig
Returns a new instance of ModelConfig.
41 42 43 44 45 |
# File 'lib/server/ai/client.rb', line 41 def initialize(name:, parameters: {}, custom: {}) @name = name @parameters = parameters @custom = custom end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
39 40 41 |
# File 'lib/server/ai/client.rb', line 39 def name @name end |
Instance Method Details
#custom(key) ⇒ Object?
Retrieve customer provided data.
69 70 71 72 73 |
# File 'lib/server/ai/client.rb', line 69 def custom(key) return nil unless @custom.is_a?(Hash) @custom[key] end |
#parameter(key) ⇒ Object?
Retrieve model-specific parameters.
Accessing a named, typed attribute (e.g. name) will result in the call being delegated to the appropriate property.
56 57 58 59 60 61 |
# File 'lib/server/ai/client.rb', line 56 def parameter(key) return @name if key == 'name' return nil unless @parameters.is_a?(Hash) @parameters[key] end |
#to_h ⇒ Object
75 76 77 78 79 80 81 |
# File 'lib/server/ai/client.rb', line 75 def to_h { name: @name, parameters: @parameters, custom: @custom, } end |