Class: Vellum::PromptNodeResultData
- Inherits:
-
Object
- Object
- Vellum::PromptNodeResultData
- Defined in:
- lib/vellum_ai/types/prompt_node_result_data.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #array_output_id ⇒ String readonly
- #delta ⇒ String readonly
- #execution_id ⇒ String readonly
- #execution_meta ⇒ Vellum::PromptNodeExecutionMeta readonly
- #output_id ⇒ String readonly
- #text ⇒ String readonly
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(execution_meta: OMIT, output_id:, array_output_id: OMIT, execution_id: OMIT, text: OMIT, delta: OMIT, additional_properties: nil) ⇒ Vellum::PromptNodeResultData constructor
- #to_json ⇒ String
Constructor Details
#initialize(execution_meta: OMIT, output_id:, array_output_id: OMIT, execution_id: OMIT, text: OMIT, delta: OMIT, additional_properties: nil) ⇒ Vellum::PromptNodeResultData
36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/vellum_ai/types/prompt_node_result_data.rb', line 36 def initialize(execution_meta: OMIT, output_id:, array_output_id: OMIT, execution_id: OMIT, text: OMIT, delta: OMIT, additional_properties: nil) @execution_meta = if != OMIT @output_id = output_id @array_output_id = array_output_id if array_output_id != OMIT @execution_id = execution_id if execution_id != OMIT @text = text if text != OMIT @delta = delta if delta != OMIT @additional_properties = additional_properties @_field_set = { "execution_meta": , "output_id": output_id, "array_output_id": array_output_id, "execution_id": execution_id, "text": text, "delta": delta }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
21 22 23 |
# File 'lib/vellum_ai/types/prompt_node_result_data.rb', line 21 def additional_properties @additional_properties end |
#array_output_id ⇒ String (readonly)
13 14 15 |
# File 'lib/vellum_ai/types/prompt_node_result_data.rb', line 13 def array_output_id @array_output_id end |
#delta ⇒ String (readonly)
19 20 21 |
# File 'lib/vellum_ai/types/prompt_node_result_data.rb', line 19 def delta @delta end |
#execution_id ⇒ String (readonly)
15 16 17 |
# File 'lib/vellum_ai/types/prompt_node_result_data.rb', line 15 def execution_id @execution_id end |
#execution_meta ⇒ Vellum::PromptNodeExecutionMeta (readonly)
9 10 11 |
# File 'lib/vellum_ai/types/prompt_node_result_data.rb', line 9 def @execution_meta end |
#output_id ⇒ String (readonly)
11 12 13 |
# File 'lib/vellum_ai/types/prompt_node_result_data.rb', line 11 def output_id @output_id end |
#text ⇒ String (readonly)
17 18 19 |
# File 'lib/vellum_ai/types/prompt_node_result_data.rb', line 17 def text @text end |
Class Method Details
.from_json(json_object:) ⇒ Vellum::PromptNodeResultData
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/vellum_ai/types/prompt_node_result_data.rb', line 52 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) unless parsed_json["execution_meta"].nil? = parsed_json["execution_meta"].to_json = Vellum::PromptNodeExecutionMeta.from_json(json_object: ) else = nil end output_id = parsed_json["output_id"] array_output_id = parsed_json["array_output_id"] execution_id = parsed_json["execution_id"] text = parsed_json["text"] delta = parsed_json["delta"] new( execution_meta: , output_id: output_id, array_output_id: array_output_id, execution_id: execution_id, text: text, delta: delta, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
88 89 90 91 92 93 94 95 |
# File 'lib/vellum_ai/types/prompt_node_result_data.rb', line 88 def self.validate_raw(obj:) obj..nil? || Vellum::PromptNodeExecutionMeta.validate_raw(obj: obj.) obj.output_id.is_a?(String) != false || raise("Passed value for field obj.output_id is not the expected type, validation failed.") obj.array_output_id&.is_a?(String) != false || raise("Passed value for field obj.array_output_id is not the expected type, validation failed.") obj.execution_id&.is_a?(String) != false || raise("Passed value for field obj.execution_id is not the expected type, validation failed.") obj.text&.is_a?(String) != false || raise("Passed value for field obj.text 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.") end |
Instance Method Details
#to_json ⇒ String
79 80 81 |
# File 'lib/vellum_ai/types/prompt_node_result_data.rb', line 79 def to_json @_field_set&.to_json end |