Class: Vellum::RejectedAdHocExecutePromptEvent
- Inherits:
-
Object
- Object
- Vellum::RejectedAdHocExecutePromptEvent
- Defined in:
- lib/vellum_ai/types/rejected_ad_hoc_execute_prompt_event.rb
Overview
The final data returned indicating an error occurred during the stream.
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #error ⇒ Vellum::VellumError readonly
- #execution_id ⇒ String readonly
- #meta ⇒ Vellum::AdHocRejectedPromptExecutionMeta readonly
- #state ⇒ String readonly
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(state:, error:, execution_id:, meta: OMIT, additional_properties: nil) ⇒ Vellum::RejectedAdHocExecutePromptEvent constructor
- #to_json ⇒ String
Constructor Details
#initialize(state:, error:, execution_id:, meta: OMIT, additional_properties: nil) ⇒ Vellum::RejectedAdHocExecutePromptEvent
32 33 34 35 36 37 38 39 40 41 |
# File 'lib/vellum_ai/types/rejected_ad_hoc_execute_prompt_event.rb', line 32 def initialize(state:, error:, execution_id:, meta: OMIT, additional_properties: nil) @state = state @error = error @execution_id = execution_id @meta = if != OMIT @additional_properties = additional_properties @_field_set = { "state": state, "error": error, "execution_id": execution_id, "meta": }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
19 20 21 |
# File 'lib/vellum_ai/types/rejected_ad_hoc_execute_prompt_event.rb', line 19 def additional_properties @additional_properties end |
#error ⇒ Vellum::VellumError (readonly)
13 14 15 |
# File 'lib/vellum_ai/types/rejected_ad_hoc_execute_prompt_event.rb', line 13 def error @error end |
#execution_id ⇒ String (readonly)
15 16 17 |
# File 'lib/vellum_ai/types/rejected_ad_hoc_execute_prompt_event.rb', line 15 def execution_id @execution_id end |
#meta ⇒ Vellum::AdHocRejectedPromptExecutionMeta (readonly)
17 18 19 |
# File 'lib/vellum_ai/types/rejected_ad_hoc_execute_prompt_event.rb', line 17 def @meta end |
#state ⇒ String (readonly)
11 12 13 |
# File 'lib/vellum_ai/types/rejected_ad_hoc_execute_prompt_event.rb', line 11 def state @state end |
Class Method Details
.from_json(json_object:) ⇒ Vellum::RejectedAdHocExecutePromptEvent
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/vellum_ai/types/rejected_ad_hoc_execute_prompt_event.rb', line 46 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) state = parsed_json["state"] unless parsed_json["error"].nil? error = parsed_json["error"].to_json error = Vellum::VellumError.from_json(json_object: error) else error = nil end execution_id = parsed_json["execution_id"] unless parsed_json["meta"].nil? = parsed_json["meta"].to_json = Vellum::AdHocRejectedPromptExecutionMeta.from_json(json_object: ) else = nil end new( state: state, error: error, execution_id: execution_id, meta: , additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
83 84 85 86 87 88 |
# File 'lib/vellum_ai/types/rejected_ad_hoc_execute_prompt_event.rb', line 83 def self.validate_raw(obj:) obj.state.is_a?(String) != false || raise("Passed value for field obj.state is not the expected type, validation failed.") Vellum::VellumError.validate_raw(obj: obj.error) obj.execution_id.is_a?(String) != false || raise("Passed value for field obj.execution_id is not the expected type, validation failed.") obj..nil? || Vellum::AdHocRejectedPromptExecutionMeta.validate_raw(obj: obj.) end |
Instance Method Details
#to_json ⇒ String
74 75 76 |
# File 'lib/vellum_ai/types/rejected_ad_hoc_execute_prompt_event.rb', line 74 def to_json @_field_set&.to_json end |