Class: Vellum::WorkflowResultEventOutputDataFunctionCall
- Inherits:
-
Object
- Object
- Vellum::WorkflowResultEventOutputDataFunctionCall
- Defined in:
- lib/vellum_ai/types/workflow_result_event_output_data_function_call.rb
Overview
A Function Call output returned 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 ⇒ Vellum::FunctionCall readonly
Class Method Summary collapse
- .from_json(json_object:) ⇒ Vellum::WorkflowResultEventOutputDataFunctionCall
- .validate_raw(obj:) ⇒ Void
Instance Method Summary collapse
- #initialize(id: OMIT, name:, state:, node_id:, delta: OMIT, type:, value: OMIT, additional_properties: nil) ⇒ Vellum::WorkflowResultEventOutputDataFunctionCall constructor
- #to_json ⇒ String
Constructor Details
#initialize(id: OMIT, name:, state:, node_id:, delta: OMIT, type:, value: OMIT, additional_properties: nil) ⇒ Vellum::WorkflowResultEventOutputDataFunctionCall
43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/vellum_ai/types/workflow_result_event_output_data_function_call.rb', line 43 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.
26 27 28 |
# File 'lib/vellum_ai/types/workflow_result_event_output_data_function_call.rb', line 26 def additional_properties @additional_properties end |
#delta ⇒ Object (readonly)
STREAMING.
20 21 22 |
# File 'lib/vellum_ai/types/workflow_result_event_output_data_function_call.rb', line 20 def delta @delta end |
#id ⇒ String (readonly)
11 12 13 |
# File 'lib/vellum_ai/types/workflow_result_event_output_data_function_call.rb', line 11 def id @id end |
#name ⇒ String (readonly)
13 14 15 |
# File 'lib/vellum_ai/types/workflow_result_event_output_data_function_call.rb', line 13 def name @name end |
#node_id ⇒ String (readonly)
17 18 19 |
# File 'lib/vellum_ai/types/workflow_result_event_output_data_function_call.rb', line 17 def node_id @node_id end |
#state ⇒ Vellum::WorkflowNodeResultEventState (readonly)
15 16 17 |
# File 'lib/vellum_ai/types/workflow_result_event_output_data_function_call.rb', line 15 def state @state end |
#type ⇒ String (readonly)
22 23 24 |
# File 'lib/vellum_ai/types/workflow_result_event_output_data_function_call.rb', line 22 def type @type end |
#value ⇒ Vellum::FunctionCall (readonly)
24 25 26 |
# File 'lib/vellum_ai/types/workflow_result_event_output_data_function_call.rb', line 24 def value @value end |
Class Method Details
.from_json(json_object:) ⇒ Vellum::WorkflowResultEventOutputDataFunctionCall
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/vellum_ai/types/workflow_result_event_output_data_function_call.rb', line 61 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"] unless parsed_json["value"].nil? value = parsed_json["value"].to_json value = Vellum::FunctionCall.from_json(json_object: value) else value = nil end 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
100 101 102 103 104 105 106 107 108 |
# File 'lib/vellum_ai/types/workflow_result_event_output_data_function_call.rb', line 100 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.nil? || Vellum::FunctionCall.validate_raw(obj: obj.value) end |
Instance Method Details
#to_json ⇒ String
91 92 93 |
# File 'lib/vellum_ai/types/workflow_result_event_output_data_function_call.rb', line 91 def to_json @_field_set&.to_json end |