Class: Vellum::PromptDeploymentExpandMetaRequestRequest
- Inherits:
-
Object
- Object
- Vellum::PromptDeploymentExpandMetaRequestRequest
- Defined in:
- lib/vellum_ai/types/prompt_deployment_expand_meta_request_request.rb
Instance Attribute Summary collapse
-
#additional_properties ⇒ Object
readonly
Returns the value of attribute additional_properties.
-
#deployment_release_tag ⇒ Object
readonly
Returns the value of attribute deployment_release_tag.
-
#finish_reason ⇒ Object
readonly
Returns the value of attribute finish_reason.
-
#latency ⇒ Object
readonly
Returns the value of attribute latency.
-
#model_name ⇒ Object
readonly
Returns the value of attribute model_name.
-
#prompt_version_id ⇒ Object
readonly
Returns the value of attribute prompt_version_id.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ PromptDeploymentExpandMetaRequestRequest
Deserialize a JSON object to an instance of PromptDeploymentExpandMetaRequestRequest.
-
.validate_raw(obj:) ⇒ Void
Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object’s property definitions.
Instance Method Summary collapse
- #initialize(model_name: nil, latency: nil, deployment_release_tag: nil, prompt_version_id: nil, finish_reason: nil, additional_properties: nil) ⇒ PromptDeploymentExpandMetaRequestRequest constructor
-
#to_json(*_args) ⇒ JSON
Serialize an instance of PromptDeploymentExpandMetaRequestRequest to a JSON object.
Constructor Details
#initialize(model_name: nil, latency: nil, deployment_release_tag: nil, prompt_version_id: nil, finish_reason: nil, additional_properties: nil) ⇒ PromptDeploymentExpandMetaRequestRequest
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/vellum_ai/types/prompt_deployment_expand_meta_request_request.rb', line 17 def initialize(model_name: nil, latency: nil, deployment_release_tag: nil, prompt_version_id: nil, finish_reason: nil, additional_properties: nil) # @type [Boolean] If enabled, the response will include the model identifier representing the ML Model invoked by the Prompt Deployment. @model_name = model_name # @type [Boolean] If enabled, the response will include the time in nanoseconds it took to execute the Prompt Deployment. @latency = latency # @type [Boolean] If enabled, the response will include the release tag of the Prompt Deployment. @deployment_release_tag = deployment_release_tag # @type [Boolean] If enabled, the response will include the ID of the Prompt Version backing the deployment. @prompt_version_id = prompt_version_id # @type [Boolean] If enabled, the response will include the reason provided by the model for why the execution finished. @finish_reason = finish_reason # @type [OpenStruct] Additional properties unmapped to the current class definition @additional_properties = additional_properties end |
Instance Attribute Details
#additional_properties ⇒ Object (readonly)
Returns the value of attribute additional_properties.
7 8 9 |
# File 'lib/vellum_ai/types/prompt_deployment_expand_meta_request_request.rb', line 7 def additional_properties @additional_properties end |
#deployment_release_tag ⇒ Object (readonly)
Returns the value of attribute deployment_release_tag.
7 8 9 |
# File 'lib/vellum_ai/types/prompt_deployment_expand_meta_request_request.rb', line 7 def deployment_release_tag @deployment_release_tag end |
#finish_reason ⇒ Object (readonly)
Returns the value of attribute finish_reason.
7 8 9 |
# File 'lib/vellum_ai/types/prompt_deployment_expand_meta_request_request.rb', line 7 def finish_reason @finish_reason end |
#latency ⇒ Object (readonly)
Returns the value of attribute latency.
7 8 9 |
# File 'lib/vellum_ai/types/prompt_deployment_expand_meta_request_request.rb', line 7 def latency @latency end |
#model_name ⇒ Object (readonly)
Returns the value of attribute model_name.
7 8 9 |
# File 'lib/vellum_ai/types/prompt_deployment_expand_meta_request_request.rb', line 7 def model_name @model_name end |
#prompt_version_id ⇒ Object (readonly)
Returns the value of attribute prompt_version_id.
7 8 9 |
# File 'lib/vellum_ai/types/prompt_deployment_expand_meta_request_request.rb', line 7 def prompt_version_id @prompt_version_id end |
Class Method Details
.from_json(json_object:) ⇒ PromptDeploymentExpandMetaRequestRequest
Deserialize a JSON object to an instance of PromptDeploymentExpandMetaRequestRequest
37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/vellum_ai/types/prompt_deployment_expand_meta_request_request.rb', line 37 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) JSON.parse(json_object) model_name = struct.model_name latency = struct.latency deployment_release_tag = struct.deployment_release_tag prompt_version_id = struct.prompt_version_id finish_reason = struct.finish_reason new(model_name: model_name, latency: latency, deployment_release_tag: deployment_release_tag, prompt_version_id: prompt_version_id, finish_reason: finish_reason, additional_properties: struct) end |
.validate_raw(obj:) ⇒ Void
Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object’s property definitions.
66 67 68 69 70 71 72 |
# File 'lib/vellum_ai/types/prompt_deployment_expand_meta_request_request.rb', line 66 def self.validate_raw(obj:) obj.model_name&.is_a?(Boolean) != false || raise("Passed value for field obj.model_name is not the expected type, validation failed.") obj.latency&.is_a?(Boolean) != false || raise("Passed value for field obj.latency is not the expected type, validation failed.") obj.deployment_release_tag&.is_a?(Boolean) != false || raise("Passed value for field obj.deployment_release_tag is not the expected type, validation failed.") obj.prompt_version_id&.is_a?(Boolean) != false || raise("Passed value for field obj.prompt_version_id is not the expected type, validation failed.") obj.finish_reason&.is_a?(Boolean) != false || raise("Passed value for field obj.finish_reason is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ JSON
Serialize an instance of PromptDeploymentExpandMetaRequestRequest to a JSON object
52 53 54 55 56 57 58 59 60 |
# File 'lib/vellum_ai/types/prompt_deployment_expand_meta_request_request.rb', line 52 def to_json(*_args) { "model_name": @model_name, "latency": @latency, "deployment_release_tag": @deployment_release_tag, "prompt_version_id": @prompt_version_id, "finish_reason": @finish_reason }.to_json end |