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.
42 43 44 45 46 |
# File 'lib/server/ai/client.rb', line 42 def initialize(name:, parameters: {}, custom: {}) @name = name @parameters = parameters @custom = custom end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
40 41 42 |
# File 'lib/server/ai/client.rb', line 40 def name @name end |
Instance Method Details
#custom(key) ⇒ Object?
Retrieve customer provided data.
70 71 72 73 74 |
# File 'lib/server/ai/client.rb', line 70 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.
57 58 59 60 61 62 |
# File 'lib/server/ai/client.rb', line 57 def parameter(key) return @name if key == 'name' return nil unless @parameters.is_a?(Hash) @parameters[key] end |
#to_h ⇒ Object
76 77 78 79 80 81 82 |
# File 'lib/server/ai/client.rb', line 76 def to_h { name: @name, parameters: @parameters, custom: @custom, } end |