Class: Vellum::GenerateResultError
- Inherits:
-
Object
- Object
- Vellum::GenerateResultError
- Defined in:
- lib/vellum_ai/types/generate_result_error.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#message ⇒ String
readonly
The error message returned by the LLM provider.
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(message:, additional_properties: nil) ⇒ Vellum::GenerateResultError constructor
- #to_json ⇒ String
Constructor Details
#initialize(message:, additional_properties: nil) ⇒ Vellum::GenerateResultError
20 21 22 23 24 |
# File 'lib/vellum_ai/types/generate_result_error.rb', line 20 def initialize(message:, additional_properties: nil) @message = @additional_properties = additional_properties @_field_set = { "message": } end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
10 11 12 |
# File 'lib/vellum_ai/types/generate_result_error.rb', line 10 def additional_properties @additional_properties end |
#message ⇒ String (readonly)
Returns The error message returned by the LLM provider.
8 9 10 |
# File 'lib/vellum_ai/types/generate_result_error.rb', line 8 def @message end |
Class Method Details
.from_json(json_object:) ⇒ Vellum::GenerateResultError
29 30 31 32 33 34 |
# File 'lib/vellum_ai/types/generate_result_error.rb', line 29 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) = parsed_json["message"] new(message: , additional_properties: struct) end |
.validate_raw(obj:) ⇒ Void
47 48 49 |
# File 'lib/vellum_ai/types/generate_result_error.rb', line 47 def self.validate_raw(obj:) obj..is_a?(String) != false || raise("Passed value for field obj.message is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
38 39 40 |
# File 'lib/vellum_ai/types/generate_result_error.rb', line 38 def to_json @_field_set&.to_json end |