Class: Vellum::WorkflowResultEventOutputDataNumber
- Inherits:
-
Object
- Object
- Vellum::WorkflowResultEventOutputDataNumber
- Defined in:
- lib/vellum_ai/types/workflow_result_event_output_data_number.rb
Overview
A number output streamed from a Workflow execution.
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#delta ⇒ Object
readonly
STREAMING.
- #id ⇒ String readonly
- #name ⇒ String readonly
- #node_id ⇒ String readonly
- #state ⇒ Vellum::WorkflowNodeResultEventState readonly
- #type ⇒ String readonly
- #value ⇒ Float readonly
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(id: OMIT, name:, state:, node_id:, delta: OMIT, type:, value: OMIT, additional_properties: nil) ⇒ Vellum::WorkflowResultEventOutputDataNumber constructor
- #to_json ⇒ String
Constructor Details
#initialize(id: OMIT, name:, state:, node_id:, delta: OMIT, type:, value: OMIT, additional_properties: nil) ⇒ Vellum::WorkflowResultEventOutputDataNumber
42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/vellum_ai/types/workflow_result_event_output_data_number.rb', line 42 def initialize(id: OMIT, name:, state:, node_id:, delta: OMIT, type:, value: OMIT, additional_properties: nil) @id = id if id != OMIT @name = name @state = state @node_id = node_id @delta = delta if delta != OMIT @type = type @value = value if value != OMIT @additional_properties = additional_properties @_field_set = { "id": id, "name": name, "state": state, "node_id": node_id, "delta": delta, "type": type, "value": value }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
25 26 27 |
# File 'lib/vellum_ai/types/workflow_result_event_output_data_number.rb', line 25 def additional_properties @additional_properties end |
#delta ⇒ Object (readonly)
STREAMING.
19 20 21 |
# File 'lib/vellum_ai/types/workflow_result_event_output_data_number.rb', line 19 def delta @delta end |
#id ⇒ String (readonly)
10 11 12 |
# File 'lib/vellum_ai/types/workflow_result_event_output_data_number.rb', line 10 def id @id end |
#name ⇒ String (readonly)
12 13 14 |
# File 'lib/vellum_ai/types/workflow_result_event_output_data_number.rb', line 12 def name @name end |
#node_id ⇒ String (readonly)
16 17 18 |
# File 'lib/vellum_ai/types/workflow_result_event_output_data_number.rb', line 16 def node_id @node_id end |
#state ⇒ Vellum::WorkflowNodeResultEventState (readonly)
14 15 16 |
# File 'lib/vellum_ai/types/workflow_result_event_output_data_number.rb', line 14 def state @state end |
#type ⇒ String (readonly)
21 22 23 |
# File 'lib/vellum_ai/types/workflow_result_event_output_data_number.rb', line 21 def type @type end |
#value ⇒ Float (readonly)
23 24 25 |
# File 'lib/vellum_ai/types/workflow_result_event_output_data_number.rb', line 23 def value @value end |
Class Method Details
.from_json(json_object:) ⇒ Vellum::WorkflowResultEventOutputDataNumber
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/vellum_ai/types/workflow_result_event_output_data_number.rb', line 59 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) id = parsed_json["id"] name = parsed_json["name"] state = parsed_json["state"] node_id = parsed_json["node_id"] delta = parsed_json["delta"] type = parsed_json["type"] value = parsed_json["value"] new( id: id, name: name, state: state, node_id: node_id, delta: delta, type: type, value: value, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
92 93 94 95 96 97 98 99 100 |
# File 'lib/vellum_ai/types/workflow_result_event_output_data_number.rb', line 92 def self.validate_raw(obj:) obj.id&.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.") obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.") obj.state.is_a?(Vellum::WorkflowNodeResultEventState) != false || raise("Passed value for field obj.state is not the expected type, validation failed.") obj.node_id.is_a?(String) != false || raise("Passed value for field obj.node_id is not the expected type, validation failed.") obj.delta&.is_a?(String) != false || raise("Passed value for field obj.delta is not the expected type, validation failed.") obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.") obj.value&.is_a?(Float) != false || raise("Passed value for field obj.value is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
83 84 85 |
# File 'lib/vellum_ai/types/workflow_result_event_output_data_number.rb', line 83 def to_json @_field_set&.to_json end |