Class: Vellum::FulfilledAdHocExecutePromptEvent
- Inherits:
-
Object
- Object
- Vellum::FulfilledAdHocExecutePromptEvent
- Defined in:
- lib/vellum_ai/types/fulfilled_ad_hoc_execute_prompt_event.rb
Overview
resolved values from the model can be found.
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #chat_message_metadata ⇒ Hash{String => Object} readonly
- #execution_id ⇒ String readonly
- #meta ⇒ Vellum::AdHocFulfilledPromptExecutionMeta readonly
- #outputs ⇒ Array<Vellum::PromptOutput> readonly
- #state ⇒ String readonly
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(state:, outputs:, execution_id:, meta: OMIT, chat_message_metadata: OMIT, additional_properties: nil) ⇒ Vellum::FulfilledAdHocExecutePromptEvent constructor
- #to_json ⇒ String
Constructor Details
#initialize(state:, outputs:, execution_id:, meta: OMIT, chat_message_metadata: OMIT, additional_properties: nil) ⇒ Vellum::FulfilledAdHocExecutePromptEvent
36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/vellum_ai/types/fulfilled_ad_hoc_execute_prompt_event.rb', line 36 def initialize(state:, outputs:, execution_id:, meta: OMIT, chat_message_metadata: OMIT, additional_properties: nil) @state = state @outputs = outputs @execution_id = execution_id @meta = if != OMIT @chat_message_metadata = if != OMIT @additional_properties = additional_properties @_field_set = { "state": state, "outputs": outputs, "execution_id": execution_id, "meta": , "chat_message_metadata": }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
22 23 24 |
# File 'lib/vellum_ai/types/fulfilled_ad_hoc_execute_prompt_event.rb', line 22 def additional_properties @additional_properties end |
#chat_message_metadata ⇒ Hash{String => Object} (readonly)
20 21 22 |
# File 'lib/vellum_ai/types/fulfilled_ad_hoc_execute_prompt_event.rb', line 20 def @chat_message_metadata end |
#execution_id ⇒ String (readonly)
16 17 18 |
# File 'lib/vellum_ai/types/fulfilled_ad_hoc_execute_prompt_event.rb', line 16 def execution_id @execution_id end |
#meta ⇒ Vellum::AdHocFulfilledPromptExecutionMeta (readonly)
18 19 20 |
# File 'lib/vellum_ai/types/fulfilled_ad_hoc_execute_prompt_event.rb', line 18 def @meta end |
#outputs ⇒ Array<Vellum::PromptOutput> (readonly)
14 15 16 |
# File 'lib/vellum_ai/types/fulfilled_ad_hoc_execute_prompt_event.rb', line 14 def outputs @outputs end |
#state ⇒ String (readonly)
12 13 14 |
# File 'lib/vellum_ai/types/fulfilled_ad_hoc_execute_prompt_event.rb', line 12 def state @state end |
Class Method Details
.from_json(json_object:) ⇒ Vellum::FulfilledAdHocExecutePromptEvent
51 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/fulfilled_ad_hoc_execute_prompt_event.rb', line 51 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) state = parsed_json["state"] outputs = parsed_json["outputs"]&.map do | item | item = item.to_json Vellum::PromptOutput.from_json(json_object: item) end execution_id = parsed_json["execution_id"] unless parsed_json["meta"].nil? = parsed_json["meta"].to_json = Vellum::AdHocFulfilledPromptExecutionMeta.from_json(json_object: ) else = nil end = parsed_json["chat_message_metadata"] new( state: state, outputs: outputs, execution_id: execution_id, meta: , chat_message_metadata: , additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
88 89 90 91 92 93 94 |
# File 'lib/vellum_ai/types/fulfilled_ad_hoc_execute_prompt_event.rb', line 88 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.") obj.outputs.is_a?(Array) != false || raise("Passed value for field obj.outputs 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..nil? || Vellum::AdHocFulfilledPromptExecutionMeta.validate_raw(obj: obj.) obj.&.is_a?(Hash) != false || raise("Passed value for field obj.chat_message_metadata is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
79 80 81 |
# File 'lib/vellum_ai/types/fulfilled_ad_hoc_execute_prompt_event.rb', line 79 def to_json @_field_set&.to_json end |