Class: Vellum::InitiatedPromptExecutionMeta
- Inherits:
-
Object
- Object
- Vellum::InitiatedPromptExecutionMeta
- Defined in:
- lib/vellum_ai/types/initiated_prompt_execution_meta.rb
Overview
request opted into with ‘expand_meta`.
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #deployment_release_tag ⇒ String readonly
- #latency ⇒ Integer readonly
- #model_name ⇒ String readonly
- #prompt_version_id ⇒ String readonly
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(model_name: OMIT, latency: OMIT, deployment_release_tag: OMIT, prompt_version_id: OMIT, additional_properties: nil) ⇒ Vellum::InitiatedPromptExecutionMeta constructor
- #to_json ⇒ String
Constructor Details
#initialize(model_name: OMIT, latency: OMIT, deployment_release_tag: OMIT, prompt_version_id: OMIT, additional_properties: nil) ⇒ Vellum::InitiatedPromptExecutionMeta
31 32 33 34 35 36 37 38 39 40 |
# File 'lib/vellum_ai/types/initiated_prompt_execution_meta.rb', line 31 def initialize(model_name: OMIT, latency: OMIT, deployment_release_tag: OMIT, prompt_version_id: OMIT, additional_properties: nil) @model_name = model_name if model_name != OMIT @latency = latency if latency != OMIT @deployment_release_tag = deployment_release_tag if deployment_release_tag != OMIT @prompt_version_id = prompt_version_id if prompt_version_id != OMIT @additional_properties = additional_properties @_field_set = { "model_name": model_name, "latency": latency, "deployment_release_tag": deployment_release_tag, "prompt_version_id": prompt_version_id }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
18 19 20 |
# File 'lib/vellum_ai/types/initiated_prompt_execution_meta.rb', line 18 def additional_properties @additional_properties end |
#deployment_release_tag ⇒ String (readonly)
14 15 16 |
# File 'lib/vellum_ai/types/initiated_prompt_execution_meta.rb', line 14 def deployment_release_tag @deployment_release_tag end |
#latency ⇒ Integer (readonly)
12 13 14 |
# File 'lib/vellum_ai/types/initiated_prompt_execution_meta.rb', line 12 def latency @latency end |
#model_name ⇒ String (readonly)
10 11 12 |
# File 'lib/vellum_ai/types/initiated_prompt_execution_meta.rb', line 10 def model_name @model_name end |
#prompt_version_id ⇒ String (readonly)
16 17 18 |
# File 'lib/vellum_ai/types/initiated_prompt_execution_meta.rb', line 16 def prompt_version_id @prompt_version_id end |
Class Method Details
.from_json(json_object:) ⇒ Vellum::InitiatedPromptExecutionMeta
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/vellum_ai/types/initiated_prompt_execution_meta.rb', line 45 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) model_name = parsed_json["model_name"] latency = parsed_json["latency"] deployment_release_tag = parsed_json["deployment_release_tag"] prompt_version_id = parsed_json["prompt_version_id"] new( model_name: model_name, latency: latency, deployment_release_tag: deployment_release_tag, prompt_version_id: prompt_version_id, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
72 73 74 75 76 77 |
# File 'lib/vellum_ai/types/initiated_prompt_execution_meta.rb', line 72 def self.validate_raw(obj:) obj.model_name&.is_a?(String) != false || raise("Passed value for field obj.model_name is not the expected type, validation failed.") obj.latency&.is_a?(Integer) != false || raise("Passed value for field obj.latency is not the expected type, validation failed.") obj.deployment_release_tag&.is_a?(String) != false || raise("Passed value for field obj.deployment_release_tag is not the expected type, validation failed.") obj.prompt_version_id&.is_a?(String) != false || raise("Passed value for field obj.prompt_version_id is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
63 64 65 |
# File 'lib/vellum_ai/types/initiated_prompt_execution_meta.rb', line 63 def to_json @_field_set&.to_json end |