Class: Vellum::MlModelUsageWrapper
- Inherits:
-
Object
- Object
- Vellum::MlModelUsageWrapper
- Defined in:
- lib/vellum_ai/types/ml_model_usage_wrapper.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #ml_model_name ⇒ String readonly
- #ml_model_usage ⇒ Vellum::MlModelUsage readonly
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(ml_model_name:, ml_model_usage:, additional_properties: nil) ⇒ Vellum::MlModelUsageWrapper constructor
- #to_json ⇒ String
Constructor Details
#initialize(ml_model_name:, ml_model_usage:, additional_properties: nil) ⇒ Vellum::MlModelUsageWrapper
24 25 26 27 28 29 |
# File 'lib/vellum_ai/types/ml_model_usage_wrapper.rb', line 24 def initialize(ml_model_name:, ml_model_usage:, additional_properties: nil) @ml_model_name = ml_model_name @ml_model_usage = ml_model_usage @additional_properties = additional_properties @_field_set = { "ml_model_name": ml_model_name, "ml_model_usage": ml_model_usage } end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
13 14 15 |
# File 'lib/vellum_ai/types/ml_model_usage_wrapper.rb', line 13 def additional_properties @additional_properties end |
#ml_model_name ⇒ String (readonly)
9 10 11 |
# File 'lib/vellum_ai/types/ml_model_usage_wrapper.rb', line 9 def ml_model_name @ml_model_name end |
#ml_model_usage ⇒ Vellum::MlModelUsage (readonly)
11 12 13 |
# File 'lib/vellum_ai/types/ml_model_usage_wrapper.rb', line 11 def ml_model_usage @ml_model_usage end |
Class Method Details
.from_json(json_object:) ⇒ Vellum::MlModelUsageWrapper
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/vellum_ai/types/ml_model_usage_wrapper.rb', line 34 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) ml_model_name = parsed_json["ml_model_name"] unless parsed_json["ml_model_usage"].nil? ml_model_usage = parsed_json["ml_model_usage"].to_json ml_model_usage = Vellum::MlModelUsage.from_json(json_object: ml_model_usage) else ml_model_usage = nil end new( ml_model_name: ml_model_name, ml_model_usage: ml_model_usage, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
62 63 64 65 |
# File 'lib/vellum_ai/types/ml_model_usage_wrapper.rb', line 62 def self.validate_raw(obj:) obj.ml_model_name.is_a?(String) != false || raise("Passed value for field obj.ml_model_name is not the expected type, validation failed.") Vellum::MlModelUsage.validate_raw(obj: obj.ml_model_usage) end |
Instance Method Details
#to_json ⇒ String
53 54 55 |
# File 'lib/vellum_ai/types/ml_model_usage_wrapper.rb', line 53 def to_json @_field_set&.to_json end |